Closed ASinanSaglam closed 3 years ago
One major change since the pull request was created. NFsim will now expect a reference specific to TFUN functions:
and the function expression given by the XML should have this constant at the location where the file values should be, e.g.
__TFUN__VAL__/(6.022e8*(0.25^3))
This reference is used to replace the __TFUN__VAL__
constant with the value pulled from the given file. This now allows the re-use of the same counter observable/function in the same expression, which is the expected behavior. E.g.
k = TFUN(ctr, "rates.txt") * ctr
function definition will work now.
This pull request adds a new function type to NFsim called TFUN. In BioNetGen it can be called via the following syntax
my_func = TFUN(counter_name, "my_file.dat")
in NFsim XML this will convert to a new function type with the following attributes
<Function id="my_func" type="TFUN" file='my_file.dat' ctrName="counter_name">
Note that this conversion will only happen after this pull request is complete.
The changes in this pull request allows NFsim to parse the above XML correctly, call new methods to GlobalFunction and CompositeFunction classes to allow the function to read the file given and store the data and associate the function with the appropriate counter. Counters can be either an observable in the system or can be another function, e.g. the following syntax in BNG works
So that you can scale a counter observable and also scale the values returned from a file. Mechanically, this works by checking a boolean attribute of each function before evaluation to see if it's associated with a file. If so, a method that updates the file value is called. After the update the function evaluation continues as normal.
TODO: