Simulation
BioSimulator.parse_model — Functionparse_model(network::Network)Construct a state <: Vector{Int} and model <: ReactionSystem from a Network object.
Use this in simulate to avoid constructing internal data structures over multiple samples.
BioSimulator.simulate — Functionsimulate(network::Network, algname::SimulationAlgorithm;
[tfinal = 0.0],
[rates_cache = HasRates],
[save_points = nothing],
[save_function = save_state])Simulate a Network of interacting populations. Note that simulations may terminate early if the cumulative intensity reaches 0 (that is, reaching an absorbing state).
Keyword Arguments
tfinal: The final simulation time.rates_cache: Indicates the type of information stored in aratescache. IfHasRatesis chosen, store the actual rates. IfHasSumsis chosen, store partial sums of therates. This effectively toggles between linear and binary searches, provided the algorithm supports the option.save_points: An indexable collection indicating time points to sample and record system state. The defaultnothingforces saving after every reaction event.save_function: A three argument function that maps the three arguments(simulator, state, model)to data recorded in aSamplePath. Default behavior is to record each species.
simulate(state, model, algname::SimulationAlgorithm;
[tfinal = 0.0],
[rates_cache = HasRates],
[save_points = nothing],
[save_function = save_state])Simulate a model with the given initial state. Note that simulations may terminate early if the cumulative intensity reaches 0 (that is, reaching an absorbing state).
Arguments
For well-mixed systems:
state: AVector{Int}constructed byparse_model.model: AReactionSystemtype constructed byparse_model.
For lattice-based systems:
state: ALatticetype whose topology comptabile is compatible withmodel.model: AnInteractingParticleSystemtype built from@enumerate_with_sclass.
Keyword Arguments
tfinal: The final simulation time.rates_cache: Indicates the type of information stored in aratescache. IfHasRatesis chosen, store the actual rates. IfHasSumsis chosen, store partial sums of therates. This effectively toggles between linear and binary searches, provided the algorithm supports the option.save_points: An indexable collection indicating time points to sample and record system state. The defaultnothingforces saving after every reaction event.save_function: A three argument function that maps the three arguments(simulator, state, model)to data recorded in aSamplePath. Default behavior is to store population counts for well-mixed systems orConfigurationobjects for lattice-based systems.