MEDYAN.addreactioncallback!

Tuple{MEDYAN.SysDef, MEDYAN.CompartmentReaction, Any}

addreactioncallback!(s::SysDef, reaction::CompartmentReaction, callback)::SysDef
addreactioncallback!(s::SysDef, reactantexpr::AbstractString, rate::Float64, invvolumepower::Int, callback)::SysDef

Like addreaction! but also adds callback. callback is called when the reaction happens with input of MEDYAN.Context and Int the compartment id where the reaction happened.

The reaction should normally have no net stoichiometry because the callback should handle updating species counts. If an AbstractString is passed instead of a CompartmentReaction for the reaction, that string will be parsed to determine the reactants. The net stoichiometry will be zero.

MEDYAN.errorcheck_addcallback(callback,s::SysDef) can optionally be overloaded to add errorchecking when the callback is added.

Tuple{MEDYAN.SysDef, MEDYAN.BulkReaction, Any}

Callback for bulk reactions: Context -> Nothing.