Skip to content

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

@msneddon

Description

@msneddon

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions