CellML Discussion List

Text archives Help


[cellml-discussion] cmeta:id's and the CCGS


Chronological Thread 
  • From: david.nickerson at nus.edu.sg (David Nickerson)
  • Subject: [cellml-discussion] cmeta:id's and the CCGS
  • Date: Tue, 26 Dec 2006 14:41:57 +0800

Hi all,

I have been thinking about the best way to map between variables in a
model and variables in code generated from the model (or more precisely
the mapping between variables in a model and results from numerical
simulation of the model using the code generated by the CCGS). The
typical way to do anything with a particular variable in a model is via
the variable's cmeta:id (i.e., graph metadata).

Using the current CCGS implementation it is fairly easy to grab the
original CellML variable object for each variable in the generated code
and from that you can get the variable's cmeta:id. However, the problem
is that there can be multiple variables in a model which resolve to the
same underlying variable in the generated code. Thus, when trying to use
a particular variable from a model via its cmeta:id it may not appear
directly in the code, and hence the simulation result data.

One way to get all the variables in a model which link to a given
variable in the generated code is to simply search the model looking at
connections and source variables, etc. to determine this information. An
alternate method is to provide this information directly via the CCGS -
which internally handles all model connections in a more efficient manner.

Following up on this I have modified the CCGS to provide a method on the
CCodeVariable object/interface which provides a character array
containing a comma separated list of all the cmeta:id's which are linked
to each code variable (see attached patch for current trunk source). For
me this works quite well and provides a means to describe in the
generated code all the variables in a model which are linked to a given
variable/array index in the generated code.

I'm sure the actual implementation is pretty bad, but the general idea
seems sound to me. What do people think? Perhaps there is already a way
to do this or something similar, but I couldn't find it. Or maybe I'm
just going about this in completely the wrong way?


David.

--
David Nickerson, PhD
Research Fellow
Division of Bioengineering
Faculty of Engineering
National University of Singapore
Email: david.nickerson at nus.edu.sg
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ids.patch
Type: text/x-patch
Size: 5899 bytes
Desc: not available
Url :
http://www.cellml.org/pipermail/cellml-discussion/attachments/20061226/7d51eef7/attachment.bin





Archive powered by MHonArc 2.6.18.

Top of page