draeger-lab / SBSCL

The Systems Biology Simulation Core Library (SBSCL) provides an efficient and exhaustive Java implementation of methods to interpret the content of models encoded in the Systems Biology Markup Language (SBML) and its numerical solution.
https://draeger-lab.github.io/SBSCL/
GNU Lesser General Public License v3.0
20 stars 13 forks source link

Add delay property to the rateOf function #46

Open hemilpanchiwala opened 4 years ago

hemilpanchiwala commented 4 years ago

Currently, whenever the rateOf is defined inside the delay tag for any of the SBML model then it does not take that delay into account and just provides the rateOf values as the time proceeds.

Issue found while simulating the model 1400, 1401 from SBML Test Suite.

Screenshot of simulation result for the model 1400: Screenshot from 2020-06-17 00-36-35

Here, for the parameter with id P1, the assignment rule is defined to have a delay of 1 in calculating the rateOf while for the parameter with id P0; its only calculating rateOf with time. But the results show that P0 and P1 are just having the same values all the time, which means the delay is not considered here.

hemilpanchiwala commented 4 years ago

This occurs as currently whenever the rateOf function is called it just gets the value from the changeRate array at that time, instead, there should be something like if I can make an ASTNodeValue object of that value from changeRate array as a REAL nodeType and just run compileDouble method by passing time and delay then everything should run fine, i.e., delays will be considered.

@draeger, @matthiaskoenig What do you think about it? And if yes, can I convert a double value (a value from changeRate array) to an ASTNodeValue instance?