roadrunner  2.6.0
Fast simulator for SBML models
Public Types | Public Member Functions | Public Attributes | Friends | List of all members
rr::CompiledExecutableModel Class Reference

Both the CModelGenerator and the CSharpModelGenerator use the same paradigm of producing source code, calling a external compiler and loadig the resulting shared library. More...

#include <rrCompiledExecutableModel.h>

Inheritance diagram for rr::CompiledExecutableModel:
rr::ExecutableModel

Public Types

enum  StateStackOptions { PopDiscard = 0x00000001 }
 
- Public Types inherited from rr::ExecutableModel
enum  ExecutableModelFlags { INTEGRATION = (0x1 << 0) , OPTIMIZE_REACTION_RATE_SELECTION = (0x1 << 1) }
 

Public Member Functions

virtual std::string getExecutableModelDesc () const
 Returns a human-readable description of the code generation backend, e.g. LLVM, legacy C, etc. More...
 
 CompiledExecutableModel (const ModelSymbols &symbols, ModelSharedLibrary *dll)
 makes a copy of the ModelSymbols and keeps it. More...
 
virtual bool getConservedSumChanged ()
 
virtual void setConservedSumChanged (bool)
 
virtual std::string getModelName ()
 get the name of the model
 
virtual void setTime (double _time)
 
virtual double getTime ()
 
virtual void evalInitialConditions ()
 
virtual void reset ()
 reset the model to its original state
 
virtual void reset (int options)
 reset the model accordign to a bitfield specified by the SelectionRecord::SelectionType values.
 
virtual int pushState (unsigned options=0)
 A ExecutableModel holds a stack of states, the entire state of this model is pushed onto the saved state stack, and the current state remains unchanged. More...
 
virtual int popState (unsigned options=0)
 restore the state from a previously saved state, if the state stack is empty, this has no effect. More...
 
virtual int getNumIndFloatingSpecies ()
 independent species do are not defined by rules, they typically participate in reactions and can have thier values set at any time.
 
virtual int getNumDepFloatingSpecies ()
 dependent species are defined by rules and the only way to change them is by changing the values on which they depend.
 
virtual int getNumFloatingSpecies ()
 total number of floating species.
 
virtual int getFloatingSpeciesIndex (const std::string &name)
 
virtual std::string getFloatingSpeciesId (int index)
 
virtual int getNumBoundarySpecies ()
 get the number of boundary species.
 
virtual int getBoundarySpeciesIndex (const std::string &name)
 
virtual std::string getBoundarySpeciesId (int index)
 
virtual int getBoundarySpeciesCompartmentIndex (int index)
 
virtual int getFloatingSpeciesAmounts (int len, int const *indx, double *values)
 get the floating species amounts More...
 
virtual int setFloatingSpeciesAmounts (int len, int const *indx, const double *values)
 
virtual int getFloatingSpeciesConcentrations (int len, int const *indx, double *values)
 get the floating species concentrations More...
 
virtual int setFloatingSpeciesConcentrations (int len, int const *indx, double const *values)
 set the floating species concentrations More...
 
virtual int getFloatingSpeciesAmountRates (int len, int const *indx, double *values)
 
virtual int getFloatingSpeciesConcentrationRates (int len, int const *indx, double *values)
 
virtual int getBoundarySpeciesAmounts (int len, int const *indx, double *values)
 get the boundary species amounts More...
 
virtual int getBoundarySpeciesConcentrations (int len, int const *indx, double *values)
 get the boundary species concentrations More...
 
virtual int setBoundarySpeciesConcentrations (int len, int const *indx, double const *values)
 set the boundary species concentrations More...
 
virtual int getNumGlobalParameters ()
 get the number of global parameters
 
virtual int getGlobalParameterIndex (const std::string &name)
 index of the global parameter id, -1 if it does not exist.
 
virtual std::string getGlobalParameterId (int index)
 
virtual int getGlobalParameterValues (int len, int const *indx, double *values)
 get the global parameter values More...
 
virtual int setGlobalParameterValues (int len, int const *indx, const double *values)
 
virtual int getNumCompartments ()
 
virtual int getCompartmentIndex (const std::string &name)
 
virtual std::string getCompartmentId (int index)
 
virtual int getCompartmentVolumes (int len, int const *indx, double *values)
 get the compartment volumes More...
 
virtual int getNumRateRules ()
 
virtual int getNumReactions ()
 get the number of reactions the model has
 
virtual int getReactionRates (int len, const int *indx, double *values)
 
virtual int getReactionIndex (const std::string &reactionName)
 get the index of a named reaction More...
 
virtual std::string getReactionId (int index)
 get the name of the specified reaction
 
virtual int getNumEvents ()
 
virtual void computeEventPriorites ()
 
void setConcentration (int index, double value)
 
virtual void evalReactionRates ()
 
virtual void setCompartmentVolumes ()
 
virtual int getNumLocalParameters (int reactionId)
 
virtual void computeRules ()
 
virtual void initializeInitialConditions ()
 
virtual void setParameterValues ()
 
virtual void setBoundaryConditions ()
 
virtual void setInitialConditions ()
 
virtual void evalInitialAssignments ()
 
virtual void convertToAmounts ()
 
virtual void computeConservedTotals ()
 
virtual void getRateRuleValues (double *rateRuleValues)
 get the 'values' i.e. More...
 
double getAmount (const int i)
 
virtual void initializeRates ()
 
virtual std::string getStateVectorId (int index)
 
virtual void setRateRuleValues (const double *rateRuleValues)
 
virtual int getStateVector (double *stateVector)
 copies the internal model state std::vector into the provided buffer. More...
 
virtual int setStateVector (const double *stateVector)
 sets the internal model state to the provided packed state std::vector. More...
 
virtual void convertToConcentrations ()
 
virtual void updateDependentSpeciesValues ()
 
virtual void computeAllRatesOfChange ()
 
virtual void getStateVectorRate (double time, const double *y, double *dydt=0)
 the state std::vector y is the rate rule values and floating species concentrations concatenated. More...
 
virtual void evalEvents (const double time, const double *y)
 
virtual void resetEvents ()
 
virtual void testConstraints ()
 
virtual void initializeRateRuleSymbols ()
 
virtual std::string getInfo ()
 
virtual void print (std::ostream &stream)
 
virtual void getIds (int types, std::list< std::string > &ids)
 populates a given list with all the ids that this class can accept. More...
 
virtual int getSupportedIdTypes ()
 returns a bit field of the ids that this class supports.
 
virtual double getValue (const std::string &id)
 gets the value for the given id std::string. More...
 
virtual void setValue (const std::string &id, double value)
 sets the value coresponding to the given selection stringl
 
virtual int getEventDelays (int len, int const *indx, double *values)
 
virtual int getEventPriorities (int len, int const *indx, double *values)
 
virtual void eventAssignment (int eventId)
 
virtual double * evalEventAssignment (int eventId)
 
virtual void applyEventAssignment (int eventId, double *values)
 
virtual int getEventTriggers (int len, const int *indx, unsigned char *values)
 
virtual int getNumConservedMoieties ()
 
virtual int getConservedMoietyIndex (const std::string &name)
 
virtual std::string getConservedMoietyId (int index)
 
virtual int getConservedMoietyValues (int len, int const *indx, double *values)
 
virtual int setConservedMoietyValues (int len, int const *indx, const double *values)
 
virtual int setCompartmentVolumes (int len, int const *indx, const double *values)
 
virtual int setFloatingSpeciesInitConcentrations (int len, int const *indx, double const *values)
 
virtual int getFloatingSpeciesInitConcentrations (int len, int const *indx, double *values)
 
virtual double getStoichiometry (int speciesIndex, int reactionIndex)
 Get the current stiochiometry value for the given species / reaction. More...
 
virtual int getStoichiometryMatrix (int *rows, int *cols, double **data)
 allocate a block of memory and copy the stochiometric values into it, and return it. More...
 
double getFloatingSpeciesConcentration (int index)
 
bool setupModelData ()
 initialize and allocate space for the ModelData buffers.
 
virtual bool setupDLLFunctions ()
 setup the function pointer variables to point to the C functions in the loaded shared library.
 
std::vector< int > retestEvents (const double &timeEnd, const std::vector< int > &handledEvents, std::vector< int > &removeEvents)
 
std::vector< int > retestEvents (const double &timeEnd, std::vector< int > &handledEvents, const bool &assignOldState)
 
std::vector< int > retestEvents (const double &timeEnd, const std::vector< int > &handledEvents, const bool &assignOldState, std::vector< int > &removeEvents)
 
virtual int applyPendingEvents (double timeEnd)
 
virtual int applyEvents (double timeEnd, const unsigned char *previousEventStatus, const double *initialState, double *finalState)
 Itterate through all of the current and pending events and apply them. More...
 
virtual void getEventRoots (double time, const double *y, double *gdot)
 evaluate the event 'roots' – when events transition form triggered - non-triggered or triggered to non-triggered state. More...
 
virtual double getNextPendingEventTime (bool pop)
 
virtual int getPendingEventSize ()
 
void removePendingAssignmentForIndex (int eventIndex)
 
void sortEventsByPriority (std::vector< Event > &firedEvents)
 
void sortEventsByPriority (std::vector< int > &firedEvents)
 
virtual int setFloatingSpeciesInitAmounts (int len, int const *indx, double const *values)
 
virtual int getFloatingSpeciesInitAmounts (int len, int const *indx, double *values)
 
virtual int setCompartmentInitVolumes (int len, int const *indx, double const *values)
 
virtual int getCompartmentInitVolumes (int len, int const *indx, double *values)
 
virtual int getEventIndex (const std::string &)
 Gets the index for an event id. More...
 
virtual std::string getEventId (int)
 
virtual void setEventListener (int, rr::EventListenerPtr)
 
virtual rr::EventListenerPtr getEventListener (int)
 
virtual double getFloatingSpeciesAmountRate (int index, const double *reactionRates)
 
virtual void setRandomSeed (int64_t)
 set the seed used by the random number generator. More...
 
virtual int64_t getRandomSeed ()
 get the seed used by the RNG.
 
virtual double getRandom ()
 Get a uniform random number between 0 and 1 created by the RNG. More...
 
virtual uint32_t getFlags () const
 Get the current set of flags.
 
virtual void setFlags (uint32_t)
 Set certain options that determine the state of the ExecutableModel, these are listed in.
 
- Public Member Functions inherited from rr::ExecutableModel
 ExecutableModel ()
 Returns a human-readable description of the code generation backend, e.g. LLVM, legacy C, etc. More...
 
virtual std::string getFloatingSpeciesId (size_t index)=0
 
virtual int getFloatingSpeciesAmounts (size_t len, int const *indx, double *values)=0
 get the floating species amounts More...
 
virtual int setFloatingSpeciesAmounts (size_t len, int const *indx, const double *values)=0
 
virtual int setFloatingSpeciesAmounts (size_t len, int const *indx, const double *values, bool strict)=0
 
virtual int getFloatingSpeciesAmountRates (size_t len, int const *indx, double *values)=0
 get the floating species amount rates More...
 
virtual int getFloatingSpeciesConcentrationRates (size_t len, int const *indx, double *values)=0
 get the floating species concentration rates More...
 
virtual int getFloatingSpeciesConcentrations (size_t len, int const *indx, double *values)=0
 get the floating species concentrations More...
 
virtual int setFloatingSpeciesConcentrations (size_t len, int const *indx, double const *values)=0
 set the floating species concentrations More...
 
virtual int setFloatingSpeciesInitConcentrations (size_t len, int const *indx, double const *values)=0
 Set the initial concentrations of the floating species. More...
 
virtual int getFloatingSpeciesInitConcentrations (size_t len, int const *indx, double *values)=0
 Get the initial concentrations of the floating species, uses the same indexing as the other floating species methods.
 
virtual int setFloatingSpeciesInitAmounts (size_t len, int const *indx, double const *values)=0
 Set the initial amounts of the floating species. More...
 
virtual int getFloatingSpeciesInitAmounts (size_t len, int const *indx, double *values)=0
 Get the initial amounts of the floating species, uses the same indexing as the other floating species methods.
 
virtual std::string getBoundarySpeciesId (size_t index)=0
 
virtual int getBoundarySpeciesAmounts (size_t len, int const *indx, double *values)=0
 get the boundary species amounts More...
 
virtual int getBoundarySpeciesConcentrations (size_t len, int const *indx, double *values)=0
 get the boundary species concentrations More...
 
virtual int setBoundarySpeciesConcentrations (size_t len, int const *indx, double const *values)=0
 set the boundary species concentrations More...
 
virtual int setBoundarySpeciesAmounts (size_t len, int const *indx, double const *values)=0
 
virtual int setBoundarySpeciesAmounts (size_t len, int const *indx, double const *values, bool strict)=0
 
virtual int setBoundarySpeciesInitConcentrations (size_t len, int const *indx, double const *values)=0
 Set the initial concentrations of the boundary species. More...
 
virtual int getBoundarySpeciesInitConcentrations (size_t len, int const *indx, double *values)=0
 Get the initial concentrations of the boundary species, uses the same indexing as the other boundary species methods.
 
virtual int setBoundarySpeciesInitAmounts (size_t len, int const *indx, double const *values)=0
 Set the initial amounts of the boundary species. More...
 
virtual int getBoundarySpeciesInitAmounts (size_t len, int const *indx, double *values)=0
 Get the initial amounts of the boundary species, uses the same indexing as the other boundary species methods.
 
virtual std::string getGlobalParameterId (size_t index)=0
 id of the indexed global parameter.
 
virtual int getGlobalParameterValues (size_t len, int const *indx, double *values)=0
 get the global parameter values More...
 
virtual int setGlobalParameterValues (size_t len, int const *indx, const double *values)=0
 
virtual int setGlobalParameterValues (size_t len, int const *indx, const double *values, bool strict)=0
 
virtual int setGlobalParameterInitValues (size_t len, int const *indx, double const *values)=0
 Set the initial value of the global parameter. More...
 
virtual int getGlobalParameterInitValues (size_t len, int const *indx, double *values)=0
 Get the initial amounts of the global parameter, uses the same indexing as the other global parameter methods.
 
virtual int getCompartmentIndexForFloatingSpecies (size_t index)=0
 
virtual int getCompartmentIndexForBoundarySpecies (size_t index)=0
 
virtual std::string getCompartmentId (size_t index)=0
 
virtual int getCompartmentVolumes (size_t len, int const *indx, double *values)=0
 get the compartment volumes More...
 
virtual int setCompartmentVolumes (size_t len, int const *indx, const double *values)=0
 
virtual int setCompartmentVolumes (size_t len, int const *indx, const double *values, bool strict)=0
 
virtual int setCompartmentInitVolumes (size_t len, int const *indx, double const *values)=0
 Set the initial volumes of the compartments. More...
 
virtual int getCompartmentInitVolumes (size_t len, int const *indx, double *values)=0
 Get the initial volume of the compartments, uses the same indexing as the other compartment methods.
 
virtual int setStoichiometries (size_t len, int const *indx, const double *values)=0
 
virtual int setStoichiometries (size_t len, int const *indx, const double *values, bool strict)=0
 
virtual int setStoichiometry (int index, double value)=0
 
virtual int setStoichiometry (int speciesIndex, int reactionIndex, double value)=0
 
virtual double getStoichiometry (int index)=0
 Get the current stiochiometry value with the given index. More...
 
virtual std::string getConservedMoietyId (size_t index)=0
 
virtual int getConservedMoietyValues (size_t len, int const *indx, double *values)=0
 
virtual int setConservedMoietyValues (size_t len, int const *indx, const double *values)=0
 
virtual std::vector< std::string > getRateRuleSymbols () const =0
 Gets the symbols defined by rate rules, i.e. returns all x such that x' = f(x) is a rule which defines parameter x. More...
 
virtual std::string getReactionId (size_t index)=0
 get the name of the specified reaction
 
virtual int getStoichiometryIndex (const std::string &)=0
 get the index of a named stoichiometry More...
 
virtual int getStoichiometryIndex (const std::string &, const std::string &)=0
 get the index of a named stoichiometry More...
 
virtual std::string getStoichiometryId (size_t index)=0
 get the name of the specified stoichiometry
 
virtual int getReactionRates (size_t len, int const *indx, double *values)=0
 get the std::vector of reaction rates. More...
 
virtual int getRateRuleRates (size_t len, int const *indx, double *values)
 get the 'rates' i.e. More...
 
virtual std::string getStateVectorId (size_t index)=0
 get the id of an element of the state std::vector.
 
virtual int getEventTriggers (size_t len, const int *indx, unsigned char *values)=0
 get the event status, false if the even is not triggered, true if it is. More...
 
virtual void getPiecewiseTriggerRoots (double time, const double *y, double *gdot)=0
 
virtual int getNumPiecewiseTriggers ()=0
 We do root-finding for 'piecewise triggers': those times in a piecewise function that transition from one condition to the next.
 
virtual ~ExecutableModel ()
 need a virtual destructor as object implementing this interface can be deleted directly, i.e. More...
 
virtual std::string getEventId (size_t index)=0
 
virtual void getEventIds (std::list< std::string > &)=0
 
virtual void getAssignmentRuleIds (std::list< std::string > &)=0
 
virtual void getRateRuleIds (std::list< std::string > &)=0
 
virtual void getInitialAssignmentIds (std::list< std::string > &)=0
 
virtual void setEventListener (size_t index, EventListenerPtr eventHandler)=0
 
virtual EventListenerPtr getEventListener (size_t index)=0
 
virtual double getFloatingSpeciesAmountRate (size_t index, const double *reactionRates)=0
 Get the amount rate of change for the i'th floating species given a reaction rates std::vector. More...
 
void computeAllRatesOfChange ()
 for source compatability
 
virtual void saveState (std::ostream &out)
 
virtual void setIntegrationStartTime (double time)
 

Public Attributes

bool mConservedSumChanged
 
int mDummyInt
 
int mDummyDouble
 
double * mDummyDoubleArray
 
ModelData mData
 the data that is exchanged with the loaded shared lib, and all sorts of other routines such as CVODE.
 
ModelSymbols ms
 
bool mIsInitialized
 If all functions are found properly in the dll, this one is true.
 
ModelSharedLibrarymDLL
 
std::stack< CompiledModelState * > modelStates
 
c_int_MDS cInitModel
 
c_int_MDS cInitModelData
 
c_charStar_MDS cgetModelName
 
c_void_MDS cinitializeInitialConditions
 
c_void_MDS csetParameterValues
 
c_void_MDS csetCompartmentVolumes
 
c_int_MDS_int cgetNumLocalParameters
 
c_void_MDS csetBoundaryConditions
 
c_void_MDS csetInitialConditions
 
c_void_MDS cevalInitialAssignments
 
c_void_MDS cupdateDependentSpeciesValues
 
c_void_MDS ccomputeRules
 
c_void_MDS cconvertToAmounts
 
c_void_MDS ccomputeConservedTotals
 
c_double_MDS_int cgetConcentration
 
c_doubleStar_MDS cGetCurrentValues
 
c_void_MDS_double_doubleStar cevalModel
 
c_void_MDS cconvertToConcentrations
 
c_void_MDS_double_doubleStar cevalEvents
 
c_void_MDS ccomputeAllRatesOfChange
 
c_void_MDS cAssignRates_a
 
c_void_MDS_doubleStar cAssignRates_b
 
c_void_MDS ctestConstraints
 
c_void_MDS cresetEvents
 
c_void_MDS cInitializeRates
 
c_void_MDS cInitializeRateRuleSymbols
 
c_void_MDS_int_double csetConcentration
 
c_void_MDS cComputeReactionRates
 
c_void_MDS ccomputeEventPriorities
 
std::vector< PendingAssignmentmAssignments
 
std::vector< double > mAssignmentTimes
 
DoubleMatrix stoichiometryMatrix
 

Friends

class CompiledModelState
 

Additional Inherited Members

- Protected Member Functions inherited from rr::ExecutableModel
void setIntegration (bool value)
 is integration is currently proceeding.
 
- Protected Attributes inherited from rr::ExecutableModel
double mIntegrationStartTime
 

Detailed Description

Both the CModelGenerator and the CSharpModelGenerator use the same paradigm of producing source code, calling a external compiler and loadig the resulting shared library.

This class implements the ExecutableModel interface using this paradigm.

Member Enumeration Documentation

◆ StateStackOptions

Enumerator
PopDiscard 

Default behavior is to pop and restore previous state, (like OpenGL), this pops the last save and discards it without restoring the state.

Constructor & Destructor Documentation

◆ CompiledExecutableModel()

rr::CompiledExecutableModel::CompiledExecutableModel ( const ModelSymbols symbols,
ModelSharedLibrary dll 
)

makes a copy of the ModelSymbols and keeps it.

takes ownership of the shared lib.

Member Function Documentation

◆ applyEvents()

int rr::CompiledExecutableModel::applyEvents ( double  timeEnd,
const unsigned char *  previousEventStatus,
const double *  initialState,
double *  finalState 
)
virtual

Itterate through all of the current and pending events and apply them.

If any events trigger a state change which triggers any additional events, these are applied as well. After this method finishes, all events are processed.

Parameters
timeEndmodel time when the event occured.
previousEventStatusarray of previous event triggered states.
initialState(optional): initial state std::vector, may be NULL, in which the current state is used.
finalState(optional): final state std::vector, where the final state is coppied to. May be NULL, in which case, ignored.

Implements rr::ExecutableModel.

◆ getBoundarySpeciesAmounts()

int rr::CompiledExecutableModel::getBoundarySpeciesAmounts ( int  len,
int const *  indx,
double *  values 
)
virtual

get the boundary species amounts

Parameters
[in]lenthe length of the indx and values arrays.
[in]indxan array of length len of boundary species to return.
[out]valuesan array of at least length len which will store the returned boundary species amounts.

◆ getBoundarySpeciesConcentrations()

int rr::CompiledExecutableModel::getBoundarySpeciesConcentrations ( int  len,
int const *  indx,
double *  values 
)
virtual

get the boundary species concentrations

Parameters
[in]lenthe length of the indx and values arrays.
[in]indxan array of length len of boundary species to return.
[out]valuesan array of at least length len which will store the returned boundary species amounts.

◆ getCompartmentVolumes()

int rr::CompiledExecutableModel::getCompartmentVolumes ( int  len,
int const *  indx,
double *  values 
)
virtual

get the compartment volumes

Parameters
[in]lenthe length of the indx and values arrays.
[in]indxan array of length len of boundary species to return.
[out]valuesan array of at least length len which will store the returned boundary species amounts.

◆ getEventIndex()

int rr::CompiledExecutableModel::getEventIndex ( const std::string &  eid)
virtual

Gets the index for an event id.

If there is no event with this id, returns -1.

Implements rr::ExecutableModel.

◆ getEventRoots()

void rr::CompiledExecutableModel::getEventRoots ( double  time,
const double *  y,
double *  gdot 
)
virtual

evaluate the event 'roots' – when events transition form triggered - non-triggered or triggered to non-triggered state.

Simplest method is to return 1 for triggered, -1 for not-triggered, so long as there is a zero crossing.

Parameters
[in]timecurrent time
[in]ythe state std::vector
[out]gdotresult event roots, this is of length numEvents.

Implements rr::ExecutableModel.

◆ getExecutableModelDesc()

virtual std::string rr::CompiledExecutableModel::getExecutableModelDesc ( ) const
inlinevirtual

Returns a human-readable description of the code generation backend, e.g. LLVM, legacy C, etc.

Author
JKM
Date
07/31/2015

Implements rr::ExecutableModel.

◆ getFloatingSpeciesAmounts()

int rr::CompiledExecutableModel::getFloatingSpeciesAmounts ( int  len,
int const *  indx,
double *  values 
)
virtual

get the floating species amounts

Parameters
[in]lenthe length of the indx and values arrays.
[in]indxan array of length len of boundary species to return.
[out]valuesan array of at least length len which will store the returned boundary species amounts.

◆ getFloatingSpeciesConcentrations()

int rr::CompiledExecutableModel::getFloatingSpeciesConcentrations ( int  len,
int const *  indx,
double *  values 
)
virtual

get the floating species concentrations

Parameters
[in]lenthe length of the indx and values arrays.
[in]indxan array of length len of boundary species to return.
[out]valuesan array of at least length len which will store the returned boundary species amounts.

◆ getGlobalParameterValues()

int rr::CompiledExecutableModel::getGlobalParameterValues ( int  len,
int const *  indx,
double *  values 
)
virtual

get the global parameter values

Parameters
[in]lenthe length of the indx and values arrays.
[in]indxan array of length len of boundary species to return.
[out]valuesan array of at least length len which will store the returned boundary species amounts.

◆ getIds()

void rr::CompiledExecutableModel::getIds ( int  types,
std::list< std::string > &  ids 
)
virtual

populates a given list with all the ids that this class can accept.

Parameters
idsa list of strings that will be filled by this class.
typesthe types of ids that are requested. Can be set to 0xffffffff to request all the ids that this class supports. This should by a bitwise OR of the filelds in SelectionRecord::SelectionType

Implements rr::ExecutableModel.

◆ getRandom()

double rr::CompiledExecutableModel::getRandom ( )
virtual

Get a uniform random number between 0 and 1 created by the RNG.

The type of RNG can be specified in the config file with the RANDOM_GENERATOR_TYPE key.

Implements rr::ExecutableModel.

◆ getRateRuleValues()

void rr::CompiledExecutableModel::getRateRuleValues ( double *  rateRuleValues)
virtual

get the 'values' i.e.

the what the rate rule integrates to, and store it in the given array.

The length of rateRuleValues obviously must be the number of rate rules we have.

Implements rr::ExecutableModel.

◆ getReactionIndex()

int rr::CompiledExecutableModel::getReactionIndex ( const std::string &  reactionName)
virtual

get the index of a named reaction

Returns
>= 0 on success, < 0 on failure.

Implements rr::ExecutableModel.

◆ getStateVector()

int rr::CompiledExecutableModel::getStateVector ( double *  stateVector)
virtual

copies the internal model state std::vector into the provided buffer.

Parameters
[out]stateVectora buffer to copy the state std::vector into, if NULL, return the size required.
Returns
the number of items coppied into the provided buffer, if stateVector is NULL, returns the length of the state std::vector.

Implements rr::ExecutableModel.

◆ getStateVectorRate()

void rr::CompiledExecutableModel::getStateVectorRate ( double  time,
const double *  y,
double *  dydt = 0 
)
virtual

the state std::vector y is the rate rule values and floating species concentrations concatenated.

y is of length numFloatingSpecies + numRateRules.

The state std::vector is packed such that the first n raterule elements are the values of the rate rules, and the last n floatingspecies are the floating species values.

Parameters
[in]timecurrent simulator time
[in]ystate std::vector, must be of size returned by getStateVector
[out]dydtcalculated rate of change of the state std::vector, if null, it is ignored.

Implements rr::ExecutableModel.

◆ getStoichiometry()

double rr::CompiledExecutableModel::getStoichiometry ( int  speciesIndex,
int  reactionIndex 
)
virtual

Get the current stiochiometry value for the given species / reaction.

If either are not valid, NaN is returned.

Implements rr::ExecutableModel.

◆ getStoichiometryMatrix()

int rr::CompiledExecutableModel::getStoichiometryMatrix ( int *  rows,
int *  cols,
double **  data 
)
virtual

allocate a block of memory and copy the stochiometric values into it, and return it.

The caller is responsible for freeing the memory that is referenced by data.

Parameters
[out]rowswill hold the number of rows in the matrix.
[out]colswill hold the number of columns in the matrix.
[out]dataa pointer which will hold a newly allocated memory block.

◆ getValue()

double rr::CompiledExecutableModel::getValue ( const std::string &  id)
virtual

gets the value for the given id std::string.

The std::string must be a SelectionRecord std::string that is accepted by this class.

Implements rr::ExecutableModel.

◆ popState()

int rr::CompiledExecutableModel::popState ( unsigned  options = 0)
virtual

restore the state from a previously saved state, if the state stack is empty, this has no effect.

Returns
the size of the saved stack after the top has been poped.

◆ pushState()

int rr::CompiledExecutableModel::pushState ( unsigned  options = 0)
virtual

A ExecutableModel holds a stack of states, the entire state of this model is pushed onto the saved state stack, and the current state remains unchanged.

Returns
the size of the saved stack after the current state has been pushed.

◆ setBoundarySpeciesConcentrations()

int rr::CompiledExecutableModel::setBoundarySpeciesConcentrations ( int  len,
int const *  indx,
double const *  values 
)
virtual

set the boundary species concentrations

Parameters
[in]lenthe length of the indx and values arrays.
[in]indxan array of length len of boundary species to return.
[in]valuesan array of at least length len which will store the returned boundary species amounts.

◆ setFloatingSpeciesConcentrations()

int rr::CompiledExecutableModel::setFloatingSpeciesConcentrations ( int  len,
int const *  indx,
double const *  values 
)
virtual

set the floating species concentrations

Parameters
[in]lenthe length of the indx and values arrays.
[in]indxan array of length len of boundary species to return.
[in]valuesan array of at least length len which will store the returned boundary species amounts.

◆ setRandomSeed()

void rr::CompiledExecutableModel::setRandomSeed ( int64_t  )
virtual

set the seed used by the random number generator.

This will by definition reset the RNG.

Implements rr::ExecutableModel.

◆ setStateVector()

int rr::CompiledExecutableModel::setStateVector ( const double *  stateVector)
virtual

sets the internal model state to the provided packed state std::vector.

Parameters
[in]anarray which holds the packed state std::vector, must be at least the size returned by getStateVector.
Returns
the number of items copied from the state std::vector, negative on failure.

Implements rr::ExecutableModel.


The documentation for this class was generated from the following files: