Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Local function on Molecular scope not evaluated with -nocslf flag set #17

Open
msneddon opened this issue Jan 5, 2016 · 1 comment
Open

Comments

@msneddon
Copy link
Owner

msneddon commented Jan 5, 2016

Local functions can be evaluated over an entire connected complex or a single molecule, based on scope indicated by the tag. The -nocslf flag turns off calculation of local functions that are evaluated over a complex, which is a useful performance enhancement, but should not affect calculation or update of functions evaluated on a single molecule scope.

However, for some reactions, if -nocslf is set, then functions evaluated on a single molecule scope fail to update. Here is a simple model that reproduces the problem:

begin molecule types
  A(p~0~1,m~0~1)
  B(p~0~1)
end molecule types

begin species
  A(p~0,m~0) 100
  B(p~0) 100
end species

begin observables
  Molecules Ap A(p~1)
  Molecules Bp B(p~1)
end observables

begin functions
  func1(x) = 1*Ap(x)
end functions

begin reaction rules
  A(p~0) <-> A(p~1) 1,1
  B(p~0) + A%x() -> B(p~1) + A%x() func1(x)
  B(p~1) -> B(p~0) 1
end reaction rules

writeXML()

When running as:

nfsim -xml test.xml -sim 10 -oSteps 5 -v

We get as expected the DOR reaction firing as seen after the simulation:

DORRxnClass: _R2  ( baseRate=1,  a=96, fired=1125 times )
  -|2 mappings| B(p~0)
  -(DOR) |100 mappings| A()
         (rateFactorSum=48).

However when we turn on the -nocslf

nfsim -xml test.xml -sim 10 -oSteps 5 -v -nocslf

The rateFactorSum never updates, and the rule never fires

DORRxnClass: _R2  ( baseRate=1,  a=0, fired=0 times )
  -|100 mappings|   B(p~0)
  -(DOR) |100 mappings| A()
         (rateFactorSum=0).
@msneddon
Copy link
Owner Author

msneddon commented Jan 5, 2016

May have found a fix (https://github.com/msneddon/nfsim/tree/lf-fix), but I want to test a few other things. Looks like the recent changes/fixes in the dev branch may have also fixed this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant