C API Documentation
Public Member Functions | Static Public Member Functions | List of all members
rr::RoadRunner Class Reference

#include <rrRoadRunner.h>

Public Member Functions

 RoadRunner (unsigned int level=3, unsigned int version=2)
 
 RoadRunner (const std::string &uriOrSBML, const Dictionary *options=0)
 
 RoadRunner (const std::string &compiler, const std::string &tempDir, const std::string &supportCodeDir)
 
 RoadRunner (const RoadRunner &rr)
 
virtual ~RoadRunner ()
 
int getInstanceID ()
 
int getInstanceCount ()
 
std::string getInfo ()
 
class Compiler * getCompiler ()
 
void setCompiler (const std::string &compiler)
 
IntegratorgetIntegrator ()
 
IntegratorgetIntegratorByName (const std::string &name)
 
IntegratormakeIntegrator (std::string name)
 
SteadyStateSolvergetSteadyStateSolver ()
 
std::vector< std::string > getExistingIntegratorNames ()
 
void setIntegrator (std::string name)
 
bool integratorExists (std::string name)
 
void setSteadyStateSolver (std::string name)
 
bool steadyStateSolverExists (std::string name)
 
bool isModelLoaded ()
 
std::string getModelName ()
 
bool clearModel ()
 Clears the currently loaded model and all associated memory. More...
 
double oneStep (double currentTime, double stepSize, bool reset=true)
 
double internalOneStep (double currentTime, double stepSize, bool reset=true)
 
const ls::DoubleMatrix * simulate (const Dictionary *options=0)
 
void saveState (std::string filename, char opt='b')
 
void loadState (std::string filename)
 
const ls::DoubleMatrix * getSimulationData () const
 
void setSimulateOptions (const SimulateOptions &settings)
 
SimulateOptionsgetSimulateOptions ()
 
RoadRunnerOptionsgetOptions ()
 
void setOptions (const RoadRunnerOptions &)
 
std::string getSBML (int level=0, int version=0)
 
std::string getCurrentSBML (int level=0, int version=0)
 
void reset ()
 
void reset (int options)
 
void resetSelectionLists ()
 
void changeInitialConditions (const std::vector< double > &ic)
 
ExecutableModelgetModel ()
 
void load (const std::string &uriOrSBML, const Dictionary *options=0)
 
rr::SelectionRecord createSelection (const std::string &str)
 
std::vector< rr::SelectionRecord > & getSelections ()
 
double getValue (const std::string &sel)
 
double getValue (const SelectionRecord &record)
 
void setSelections (const std::vector< std::string > &selections)
 
void setSelections (const std::vector< rr::SelectionRecord > &selections)
 
std::vector< double > getSelectedValues ()
 
void getIds (int types, std::list< std::string > &ids)
 
std::vector< std::string > getIndependentFloatingSpeciesIds ()
 Gets the ids for all independent floating species. More...
 
std::vector< std::string > getDependentFloatingSpeciesIds ()
 Gets the ids for all dependent floating species. More...
 
std::vector< std::string > getFloatingSpeciesConcentrationIds ()
 Gets the ids for all floating species concentrations. More...
 
std::vector< std::string > getFloatingSpeciesInitialConcentrationIds ()
 Gets the ids for all initial floating species concentrations. More...
 
int getSupportedIdTypes ()
 
void setValue (const std::string &id, double value)
 
ls::DoubleMatrix getFloatingSpeciesAmountsNamedArray ()
 Returns the floating species amounts as a named array. More...
 
ls::DoubleMatrix getFloatingSpeciesConcentrationsNamedArray ()
 Returns the floating species concentrations as a named array. More...
 
ls::DoubleMatrix getBoundarySpeciesAmountsNamedArray ()
 Returns the boundary species amounts as a named array. More...
 
ls::DoubleMatrix getBoundarySpeciesConcentrationsNamedArray ()
 Returns the boundary species concentrations as a named array. More...
 
std::vector< double > getRatesOfChange ()
 Returns the rate of change of the floating species as an array. More...
 
ls::DoubleMatrix getRatesOfChangeNamedArray ()
 Returns the rate of change of the floating species as a named array. More...
 
std::vector< double > getIndependentRatesOfChange ()
 Returns the rate of change of the independent floating species as an array. More...
 
ls::DoubleMatrix getIndependentRatesOfChangeNamedArray ()
 Returns the rate of change of the independent floating species as a named array. More...
 
std::vector< double > getDependentRatesOfChange ()
 Returns the rate of change of the dependent floating species as an array. More...
 
ls::DoubleMatrix getDependentRatesOfChangeNamedArray ()
 Returns the rate of change of the dependent floating species as a named array. More...
 
ls::DoubleMatrix getFullJacobian ()
 
ls::DoubleMatrix getFullReorderedJacobian ()
 
ls::DoubleMatrix getReducedJacobian (double h=-1.0)
 
std::vector< ls::Complex > getFullEigenValues ()
 
std::vector< ls::Complex > getReducedEigenValues ()
 
ls::DoubleMatrix getLinkMatrix ()
 
ls::DoubleMatrix getNrMatrix ()
 
ls::DoubleMatrix getKMatrix ()
 
ls::DoubleMatrix getReducedStoichiometryMatrix ()
 
ls::DoubleMatrix getFullStoichiometryMatrix ()
 
ls::DoubleMatrix getExtendedStoichiometryMatrix ()
 
ls::DoubleMatrix getL0Matrix ()
 
ls::DoubleMatrix getConservationMatrix ()
 
ls::DoubleMatrix getUnscaledConcentrationControlCoefficientMatrix ()
 
ls::DoubleMatrix getScaledConcentrationControlCoefficientMatrix ()
 
ls::DoubleMatrix getUnscaledFluxControlCoefficientMatrix ()
 
ls::DoubleMatrix getScaledFluxControlCoefficientMatrix ()
 
std::vector< std::string > getEigenValueIds ()
 
double getUnscaledParameterElasticity (const string &reactionName, const string &parameterName)
 
ls::DoubleMatrix getFrequencyResponse (double startFrequency, int numberOfDecades, int numberOfPoints, const std::string &parameterName, const std::string &variableName, bool useDB, bool useHz)
 
void setConservedMoietyAnalysis (bool value)
 
bool getConservedMoietyAnalysis ()
 
double getDiffStepSize () const
 Set the differential step size used in MCA routines like getCC. More...
 
void setDiffStepSize (double val)
 Set the differential step size used in MCA routines like getCC. More...
 
double getSteadyStateThreshold () const
 Get the steady state threshold used in getCC. More...
 
void setSteadyStateThreshold (double val)
 Set the steady state threshold used in getCC. More...
 
double getuCC (const std::string &variableName, const std::string &parameterName)
 
double getCC (const std::string &variableName, const std::string &parameterName)
 
double getuEE (const std::string &reactionName, const std::string &parameterName)
 
double getuEE (const std::string &reactionName, const std::string &parameterName, bool computeSteadystate)
 
double getEE (const std::string &reactionName, const std::string &parameterName)
 
double getEE (const std::string &reactionName, const std::string &parameterName, bool computeSteadyState)
 
ls::DoubleMatrix getUnscaledElasticityMatrix ()
 
ls::DoubleMatrix getScaledElasticityMatrix ()
 
double getScaledFloatingSpeciesElasticity (const std::string &reactionName, const std::string &speciesName)
 
double getUnscaledSpeciesElasticity (int reactionId, int speciesIndex)
 
void addSpecies (const std::string &sid, const std::string &compartment, double initAmount=0, bool hasOnlySubstanceUnits=false, bool boundaryCondition=false, const std::string &substanceUnits="", bool forceRegenerate=true)
 
void removeSpecies (const std::string &sid, bool forceRegenerate=true)
 
void setBoundary (const std::string &sid, bool boundaryCondition, bool forceRegenerate=true)
 
void setHasOnlySubstanceUnits (const std::string &sid, bool hasOnlySubstanceUnits, bool forceRegenerate=true)
 
void setInitAmount (const std::string &sid, double initAmount, bool forceRegenerate=true)
 
void setInitConcentration (const std::string &sid, double initConcentration, bool forceRegenerate=true)
 
void setConstant (const std::string &sid, bool constant, bool forceRegenerate=true)
 
void addReaction (const std::string &sbmlRep, bool forceRegenerate=true)
 
void addReaction (const std::string &rid, std::vector< string > reactants, std::vector< string > products, const std::string &kineticLaw, bool forceRegenerate=true)
 
void removeReaction (const std::string &rid, bool deleteUnusedParameters=false, bool forceRegenerate=true)
 
void setReversible (const std::string &rid, bool reversible, bool forceRegenerate=true)
 
void setKineticLaw (const std::string &rid, const std::string &kineticLaw, bool forceRegenerate=true)
 
std::string getKineticLaw (const std::string &rid)
 
void addParameter (const std::string &pid, double value, bool forceRegenerate=true)
 
void removeParameter (const std::string &pid, bool forceRegenerate=true)
 
void addCompartment (const std::string &cid, double initVolume, bool forceRegenerate=true)
 
void removeCompartment (const std::string &cid, bool forceRegenerate=true)
 
void addAssignmentRule (const std::string &vid, const std::string &formula, bool forceRegenerate=true)
 
void addRateRule (const std::string &vid, const std::string &formula, bool forceRegenerate=true)
 
void removeRules (const std::string &vid, bool useInitialValue=false, bool forceRegenerate=true)
 
void addInitialAssignment (const std::string &vid, const std::string &formula, bool forceRegenerate=true)
 
void removeInitialAssignment (const std::string &vid, bool forceRegenerate=true)
 
void addEvent (const std::string &eid, bool useValuesFromTriggerTime, const std::string &trigger, bool forceRegenerate=true)
 
void addTrigger (const std::string &eid, const std::string &trigger, bool forceRegenerate=true)
 
void setPersistent (const std::string &eid, bool persistent, bool forceRegenerate=true)
 
void setTriggerInitialValue (const std::string &eid, bool initValue, bool forceRegenerate=true)
 
void addPriority (const std::string &eid, const std::string &priority, bool forceRegenerate=true)
 
void addDelay (const std::string &eid, const std::string &delay, bool forceRegenerate=true)
 
void addEventAssignment (const std::string &eid, const std::string &vid, const std::string &formula, bool forceRegenerate=true)
 
void removeEventAssignments (const std::string &eid, const std::string &vid, bool forceRegenerate=true)
 
void removeEvent (const std::string &eid, bool forceRegenerate=true)
 
void validateCurrentSBML ()
 
double mcaSteadyState ()
 
double steadyState (const Dictionary *dict=0)
 
double steadyStateApproximate (const Dictionary *dict=0)
 
ls::DoubleMatrix steadyStateNamedArray (const Dictionary *dict=0)
 
std::vector< rr::SelectionRecord > & getSteadyStateSelections ()
 
void setSteadyStateSelections (const std::vector< std::string > &steadyStateSelections)
 
void setSteadyStateSelections (const std::vector< rr::SelectionRecord > &steadyStateSelections)
 
std::vector< double > getSteadyStateValues ()
 
std::vector< std::string > getSteadyStateSelectionStrings () const
 
ls::DoubleMatrix getSteadyStateValuesNamedArray ()
 
void regenerate (bool forceRegenerate=true, bool reset=false)
 
void setBoundarySpeciesByIndex (const int &index, const double &value)
 
int getNumberOfIndependentSpecies ()
 
std::vector< std::string > getGlobalParameterIds ()
 
std::vector< std::string > getBoundarySpeciesIds ()
 
std::vector< std::string > getBoundarySpeciesConcentrationIds ()
 Gets the ids for all boundary species concentrations. More...
 
double getBoundarySpeciesByIndex (const int &index)
 
double getGlobalParameterByIndex (const int &index)
 
void setGlobalParameterByName (const std::string &param, double value)
 set the parameter with id More...
 
double getGlobalParameterByName (const std::string &param)
 get the More...
 
std::vector< double > getConservedMoietyValues ()
 Returns the sum of each conserved cycle. More...
 
std::vector< std::string > getConservedMoietyIds ()
 
 RR_DEPRECATED (int getNumberOfReactions())
 
 RR_DEPRECATED (double getReactionRate(const int &index))
 
 RR_DEPRECATED (double getRateOfChange(const int &index))
 
 RR_DEPRECATED (std::vector< std::string > getRateOfChangeIds())
 
 RR_DEPRECATED (int getNumberOfCompartments())
 
 RR_DEPRECATED (void setCompartmentByIndex(const int &index, const double &value))
 
 RR_DEPRECATED (double getCompartmentByIndex(const int &index))
 
 RR_DEPRECATED (std::vector< std::string > getCompartmentIds())
 
 RR_DEPRECATED (int getNumberOfBoundarySpecies())
 
 RR_DEPRECATED (std::vector< double > getBoundarySpeciesConcentrations())
 
 RR_DEPRECATED (void setBoundarySpeciesConcentrations(const std::vector< double > &values))
 
 RR_DEPRECATED (int getNumberOfFloatingSpecies())
 
 RR_DEPRECATED (double getFloatingSpeciesByIndex(int index))
 
 RR_DEPRECATED (void setFloatingSpeciesByIndex(int index, double value))
 
 RR_DEPRECATED (std::vector< double > getFloatingSpeciesConcentrationsV())
 
 RR_DEPRECATED (std::vector< double > getFloatingSpeciesAmountsV())
 
 RR_DEPRECATED (std::vector< double > getBoundarySpeciesConcentrationsV())
 
 RR_DEPRECATED (std::vector< double > getBoundarySpeciesAmountsV())
 
 RR_DEPRECATED (std::vector< double > getFloatingSpeciesInitialConcentrations())
 
 RR_DEPRECATED (void setFloatingSpeciesConcentrations(const std::vector< double > &values))
 
 RR_DEPRECATED (void setFloatingSpeciesInitialConcentrationByIndex(const int &index, const double &value))
 
 RR_DEPRECATED (void setFloatingSpeciesInitialConcentrations(const std::vector< double > &values))
 
 RR_DEPRECATED (std::vector< std::string > getFloatingSpeciesIds())
 
 RR_DEPRECATED (std::vector< std::string > getFloatingSpeciesInitialConditionIds())
 
 RR_DEPRECATED (size_t getNumberOfGlobalParameters())
 
 RR_DEPRECATED (void setGlobalParameterByIndex(const int index, const double value))
 
 RR_DEPRECATED (std::vector< double > getGlobalParameterValues())
 
void evalModel ()
 
 RR_DEPRECATED (int getNumberOfDependentSpecies())
 
 RR_DEPRECATED (std::vector< double > getReactionRates())
 
 RR_DEPRECATED (std::vector< std::string > getReactionIds())
 
void setTempDir (const std::string &folder)
 
std::string getTempDir ()
 

Static Public Member Functions

static std::string getParamPromotedSBML (const std::string &sArg)
 
static std::vector< std::string > getRegisteredIntegratorNames ()
 
static std::vector< std::string > getRegisteredSteadyStateSolverNames ()
 
static void ensureSolversRegistered ()
 
static std::string getExtendedVersionInfo ()
 

Detailed Description

The main RoadRunner class.

The RoadRunner class is responsible for loading and simulating SBML models.

MemoryManagment: Any pointer returned by a get... method is owned by the RoadRunner object and does NOT have to be deleted.

Constructor & Destructor Documentation

◆ RoadRunner() [1/4]

rr::RoadRunner::RoadRunner ( unsigned int  level = 3,
unsigned int  version = 2 
)

create an empty RoadRunner object with given SBML level and version.

◆ RoadRunner() [2/4]

rr::RoadRunner::RoadRunner ( const std::string &  uriOrSBML,
const Dictionary options = 0 
)

load an sbml document from anywhere.

same arguments as load.

If options is not null, then the RoadRunner::computeAndAssignConservationLaws flag is set to whatever value is specified in the options struct.

Parameters
uriOrSBMLa URI, local path or sbml document contents.
optionsan options struct, if null, default values are used.

◆ RoadRunner() [3/4]

rr::RoadRunner::RoadRunner ( const std::string &  compiler,
const std::string &  tempDir,
const std::string &  supportCodeDir 
)

All three of the RoadRunner options default to the empty string, in this case, the default values are used.

Parameters
compilerIf LLVM build is enabled, the compiler defaults to LLVM.
tempDirIf the old external C compiler is used, this is the where the C files are written to.
supportCodeDirIf the old external C compiler is used, this is the location where roadrunner C include files are.

◆ RoadRunner() [4/4]

rr::RoadRunner::RoadRunner ( const RoadRunner rr)

RoadRunner copy constructor Explicitly defined because of Python.

◆ ~RoadRunner()

virtual rr::RoadRunner::~RoadRunner ( )
virtual

free any memory this class allocated

Member Function Documentation

◆ addCompartment()

void rr::RoadRunner::addCompartment ( const std::string &  cid,
double  initVolume,
bool  forceRegenerate = true 
)

Add a compartment to the current model

Parameters
cidthe ID of the compartment to be added
initVolumethe initial volume of the compartment to be added
forceRegeneratea boolean value to indicate if the model is regenerated after this function call default value is true to regenerate model after each call of editing function to save time for editing for multiple times, one could set this flag to true only in the last call of editing

◆ addParameter()

void rr::RoadRunner::addParameter ( const std::string &  pid,
double  value,
bool  forceRegenerate = true 
)

Add a parameter to the current model

Parameters
pidthe ID of the parameter to be added
valuethe value of the parameter to be added
forceRegeneratea boolean value to indicate if the model is regenerated after this function call default value is true to regenerate model after each call of editing function to save time for editing for multiple times, one could set this flag to true only in the last call of editing

◆ addSpecies()

void rr::RoadRunner::addSpecies ( const std::string &  sid,
const std::string &  compartment,
double  initAmount = 0,
bool  hasOnlySubstanceUnits = false,
bool  boundaryCondition = false,
const std::string &  substanceUnits = "",
bool  forceRegenerate = true 
)

Add a species to the current model.

Parameters
sidthe ID of the species to be added
compartmentthe compartment of the species to be added
initAmountthe initial amount of the species to be added
substanceUnitsthe substance unit of the species to be added
forceRegeneratea boolean value to indicate if the model is regenerated after this function call default value is true to regenerate model after each call of editing function to save time for editing for multiple times, one could set this flag to true only in the last call of editing

◆ clearModel()

bool rr::RoadRunner::clearModel ( )

Clears the currently loaded model and all associated memory.

Deletes jitted code and libStruct data

Returns
True if memory was freed, false if no model was loaded in the first place

◆ createSelection()

rr::SelectionRecord rr::RoadRunner::createSelection ( const std::string &  str)

create a selection record. This record can be used to select values.

◆ ensureSolversRegistered()

static void rr::RoadRunner::ensureSolversRegistered ( )
static

Ensures all integrators and steady state solvers are registered

◆ getBoundarySpeciesAmountsNamedArray()

ls::DoubleMatrix rr::RoadRunner::getBoundarySpeciesAmountsNamedArray ( )

Returns the boundary species amounts as a named array.

Author
KC

◆ getBoundarySpeciesConcentrationIds()

std::vector<std::string> rr::RoadRunner::getBoundarySpeciesConcentrationIds ( )

Gets the ids for all boundary species concentrations.

Author
KC

◆ getBoundarySpeciesConcentrationsNamedArray()

ls::DoubleMatrix rr::RoadRunner::getBoundarySpeciesConcentrationsNamedArray ( )

Returns the boundary species concentrations as a named array.

Author
KC

◆ getCC()

double rr::RoadRunner::getCC ( const std::string &  variableName,
const std::string &  parameterName 
)

Get scaled control coefficient with respect to a global parameter

The variableName must be either a reaction id, or a floating species id.

The parameterName must be either a global parameter, boundary species, or conserved sum.

◆ getCompiler()

class Compiler* rr::RoadRunner::getCompiler ( )

The Compiler that the ModelGenerator is using to compile / interpret sbml code.

◆ getConservedMoietyAnalysis()

bool rr::RoadRunner::getConservedMoietyAnalysis ( )

is conservation analysis enabled. This is set

◆ getConservedMoietyValues()

std::vector<double> rr::RoadRunner::getConservedMoietyValues ( )

Returns the sum of each conserved cycle.

Author
MTK, JKM

◆ getCurrentSBML()

std::string rr::RoadRunner::getCurrentSBML ( int  level = 0,
int  version = 0 
)

Returns the SBML with the current model parameters. This is different than getSBML which returns the orginal SBML.

This may optionally up or downconvert the document to a different version, if the level and version arguments are non-zero.

If both arguments are zero, then the document is left alone and the original version is returned.

◆ getDependentFloatingSpeciesIds()

std::vector<std::string> rr::RoadRunner::getDependentFloatingSpeciesIds ( )

Gets the ids for all dependent floating species.

Author
JKM

See getIndependentFloatingSpeciesIds for an explanation of independent vs. dependent.

◆ getDependentRatesOfChange()

std::vector<double> rr::RoadRunner::getDependentRatesOfChange ( )

Returns the rate of change of the dependent floating species as an array.

Author
KC

◆ getDependentRatesOfChangeNamedArray()

ls::DoubleMatrix rr::RoadRunner::getDependentRatesOfChangeNamedArray ( )

Returns the rate of change of the dependent floating species as a named array.

Author
KC

◆ getDiffStepSize()

double rr::RoadRunner::getDiffStepSize ( ) const

Set the differential step size used in MCA routines like getCC.

Author
JKM

◆ getEE() [1/2]

double rr::RoadRunner::getEE ( const std::string &  reactionName,
const std::string &  parameterName 
)

Get scaled elasticity coefficient with respect to a global parameter or species

◆ getEE() [2/2]

double rr::RoadRunner::getEE ( const std::string &  reactionName,
const std::string &  parameterName,
bool  computeSteadyState 
)

Get scaled elasticity coefficient with respect to a global parameter or species. Optionally the model is brought to steady state after the computation.

◆ getEigenValueIds()

std::vector<std::string> rr::RoadRunner::getEigenValueIds ( )

returns the list of floating species, but with a "eigen(...)" string wrapped around them.

◆ getExtendedVersionInfo()

static std::string rr::RoadRunner::getExtendedVersionInfo ( )
static

getVersion plus info about dependent libs versions..

◆ getFloatingSpeciesAmountsNamedArray()

ls::DoubleMatrix rr::RoadRunner::getFloatingSpeciesAmountsNamedArray ( )

Returns the floating species amounts as a named array.

Author
KC

◆ getFloatingSpeciesConcentrationIds()

std::vector<std::string> rr::RoadRunner::getFloatingSpeciesConcentrationIds ( )

Gets the ids for all floating species concentrations.

Author
KC

◆ getFloatingSpeciesConcentrationsNamedArray()

ls::DoubleMatrix rr::RoadRunner::getFloatingSpeciesConcentrationsNamedArray ( )

Returns the floating species concentrations as a named array.

Author
KC

◆ getFloatingSpeciesInitialConcentrationIds()

std::vector<std::string> rr::RoadRunner::getFloatingSpeciesInitialConcentrationIds ( )

Gets the ids for all initial floating species concentrations.

See getIndependentFloatingSpeciesIds for an explanation of independent vs. dependent.

◆ getFullEigenValues()

std::vector<ls::Complex> rr::RoadRunner::getFullEigenValues ( )

Returns the eigenvalues of the full jacobian.

If the eigenvalues are all real, this returns a N x 1 matrix, if complex, returns an N x 2 matrix where the first column is the real values and the second is the imaginary part.

◆ getFullJacobian()

ls::DoubleMatrix rr::RoadRunner::getFullJacobian ( )

compute the full Jacobian at the current operating point

◆ getFullStoichiometryMatrix()

ls::DoubleMatrix rr::RoadRunner::getFullStoichiometryMatrix ( )

Get the stoichiometry matrix that coresponds to the full model, even it it was converted via conservation conversion.

◆ getGlobalParameterByName()

double rr::RoadRunner::getGlobalParameterByName ( const std::string &  param)

get the

Author
ciaran welsh
Parameters
valueof global parameter with id
param

◆ getIds()

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

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

◆ getIndependentFloatingSpeciesIds()

std::vector<std::string> rr::RoadRunner::getIndependentFloatingSpeciesIds ( )

Gets the ids for all independent floating species.

Author
JKM

Independent means (in this case) that the species is unique up to a conserved cycle, i.e. each conserved cycle counts for only one species. See Sauro, Systems Biology: Introduction to Pathway Modeling, 1st ed. pp. 60.

◆ getIndependentRatesOfChange()

std::vector<double> rr::RoadRunner::getIndependentRatesOfChange ( )

Returns the rate of change of the independent floating species as an array.

Author
KC

◆ getIndependentRatesOfChangeNamedArray()

ls::DoubleMatrix rr::RoadRunner::getIndependentRatesOfChangeNamedArray ( )

Returns the rate of change of the independent floating species as a named array.

Author
KC

◆ getInfo()

std::string rr::RoadRunner::getInfo ( )

information about the current state of this object.

◆ getInstanceCount()

int rr::RoadRunner::getInstanceCount ( )

Number of currently running RoadRunner instances.

◆ getInstanceID()

int rr::RoadRunner::getInstanceID ( )

When there are multiple instances of RoadRunner, this is the instance id.

◆ getIntegrator()

Integrator* rr::RoadRunner::getIntegrator ( )

get a pointer to the integrator which is currently being used to time evolve the system.

◆ getIntegratorByName()

Integrator* rr::RoadRunner::getIntegratorByName ( const std::string &  name)

Get an integrator by name without switching the current integrator

◆ getKineticLaw()

std::string rr::RoadRunner::getKineticLaw ( const std::string &  rid)

Get the kinetic law of an existing reaction in the current model.

Parameters
ridthe ID of reaction to be modified

◆ getKMatrix()

ls::DoubleMatrix rr::RoadRunner::getKMatrix ( )

Returns the K matrix (right nullspace of Nr) The K matrix has the structure, [I K0]'

◆ getModel()

ExecutableModel* rr::RoadRunner::getModel ( )

get a pointer to the ExecutableModel owned by the RoadRunner object.

◆ getModelName()

std::string rr::RoadRunner::getModelName ( )

returns the model name if a model is loaded, empty string otherwise.

◆ getNrMatrix()

ls::DoubleMatrix rr::RoadRunner::getNrMatrix ( )

get the reduced stochiometry matrix. If conservation conversion is enabled, this is the matrix that coresponds to the independent species.

A synonym for getReducedStoichiometryMatrix().

◆ getOptions()

RoadRunnerOptions& rr::RoadRunner::getOptions ( )

Get a reference to the options that determine how this class should behave.

These are general options. For options specific for loading or simulationg,

See also
getSimulateOptions.

◆ getParamPromotedSBML()

static std::string rr::RoadRunner::getParamPromotedSBML ( const std::string &  sArg)
static

Given an sbml document or path to an sbml document, this method moves all the local parameters to global parameters.

◆ getRatesOfChange()

std::vector<double> rr::RoadRunner::getRatesOfChange ( )

Returns the rate of change of the floating species as an array.

Author
KC

◆ getRatesOfChangeNamedArray()

ls::DoubleMatrix rr::RoadRunner::getRatesOfChangeNamedArray ( )

Returns the rate of change of the floating species as a named array.

Author
KC

◆ getReducedEigenValues()

std::vector<ls::Complex> rr::RoadRunner::getReducedEigenValues ( )

Returns the eigenvalues of the reduced jacobian.

If the eigenvalues are all real, this returns a N x 1 matrix, if complex, returns an N x 2 matrix where the first column is the real values and the second is the imaginary part.

◆ getReducedJacobian()

ls::DoubleMatrix rr::RoadRunner::getReducedJacobian ( double  h = -1.0)

Compute the reduced Jacobian at the current operating point.

Parameters
hThe step sized used for central difference method. If negative, the default value from the config file is used.

◆ getReducedStoichiometryMatrix()

ls::DoubleMatrix rr::RoadRunner::getReducedStoichiometryMatrix ( )

get the reduced stochiometry matrix. If conservation conversion is enabled, this is the matrix that coresponds to the independent species.

A synonym for getNrMatrix().

◆ getRegisteredIntegratorNames()

static std::vector<std::string> rr::RoadRunner::getRegisteredIntegratorNames ( )
static

Return a vector of the names of all registered integrators

◆ getRegisteredSteadyStateSolverNames()

static std::vector<std::string> rr::RoadRunner::getRegisteredSteadyStateSolverNames ( )
static

Return a vector of the names of all registered integrators

◆ getSBML()

std::string rr::RoadRunner::getSBML ( int  level = 0,
int  version = 0 
)

get the originally loaded sbml document as a string.

This may optionally up or downconvert the document to a different version, if the level and version arguments are non-zero.

If both arguments are zero, then the document is left alone and the

◆ getScaledElasticityMatrix()

ls::DoubleMatrix rr::RoadRunner::getScaledElasticityMatrix ( )

Compute the unscaled elasticity matrix at the current operating point

◆ getScaledFloatingSpeciesElasticity()

double rr::RoadRunner::getScaledFloatingSpeciesElasticity ( const std::string &  reactionName,
const std::string &  speciesName 
)

Compute the scaled elasticity for a given reaction and given species

◆ getSelectedValues()

std::vector<double> rr::RoadRunner::getSelectedValues ( )

returns the values selected with SimulateOptions for the current model time / timestep")

◆ getSelections()

std::vector<rr::SelectionRecord>& rr::RoadRunner::getSelections ( )

Returns the currently selected columns that will be returned by calls to simulate() or simulateEx(,,).

◆ getSimulateOptions()

SimulateOptions& rr::RoadRunner::getSimulateOptions ( )

get a reference to the SimulateOptions that were set either by setSimulateOptions or simulate.

◆ getSimulationData()

const ls::DoubleMatrix* rr::RoadRunner::getSimulationData ( ) const

RoadRunner keeps a copy of the simulation data around until the next call to simulate. This matrix can be obtained here.

◆ getSteadyStateSelections()

std::vector<rr::SelectionRecord>& rr::RoadRunner::getSteadyStateSelections ( )

returns the current set of steady state selections.

◆ getSteadyStateSelectionStrings()

std::vector<std::string> rr::RoadRunner::getSteadyStateSelectionStrings ( ) const

Returns a vector of the steady state selection strings

◆ getSteadyStateSolver()

SteadyStateSolver* rr::RoadRunner::getSteadyStateSolver ( )

get a pointer to the current steady state solver

◆ getSteadyStateThreshold()

double rr::RoadRunner::getSteadyStateThreshold ( ) const

Get the steady state threshold used in getCC.

Author
JKM

In the MCA routines, RoadRunner will keep trying to converge to a steady state until this threshold is met

◆ getSteadyStateValues()

std::vector<double> rr::RoadRunner::getSteadyStateValues ( )

Performs a steady state calculation (evolves the system to a steady state), then calculates and returns the set of values specifed by the steady state selections.

◆ getSteadyStateValuesNamedArray()

ls::DoubleMatrix rr::RoadRunner::getSteadyStateValuesNamedArray ( )

Like getSteadyStateValues but returns a named array

◆ getSupportedIdTypes()

int rr::RoadRunner::getSupportedIdTypes ( )

returns a bit field of the ids that this class supports.

◆ getuCC()

double rr::RoadRunner::getuCC ( const std::string &  variableName,
const std::string &  parameterName 
)

Get unscaled control coefficient with respect to a global parameter

variableName must be either a reaction or floating species.

parameterName must be eithe a global parameter, boundary species, or conserved sum.

◆ getuEE() [1/2]

double rr::RoadRunner::getuEE ( const std::string &  reactionName,
const std::string &  parameterName 
)

Get unscaled elasticity coefficient with respect to a global parameter or species

◆ getuEE() [2/2]

double rr::RoadRunner::getuEE ( const std::string &  reactionName,
const std::string &  parameterName,
bool  computeSteadystate 
)

Get unscaled elasticity coefficient with respect to a global parameter or species. Optionally the model is brought to steady state after the computation.

◆ getUnscaledElasticityMatrix()

ls::DoubleMatrix rr::RoadRunner::getUnscaledElasticityMatrix ( )

Compute the unscaled species elasticity matrix at the current operating point

◆ getUnscaledParameterElasticity()

double rr::RoadRunner::getUnscaledParameterElasticity ( const string &  reactionName,
const string &  parameterName 
)

Returns the unscaled elasticity for a named reaction with respect to a named parameter

◆ getUnscaledSpeciesElasticity()

double rr::RoadRunner::getUnscaledSpeciesElasticity ( int  reactionId,
int  speciesIndex 
)

Get a single species elasticity value IMPORTANT: Assumes that the reaction rates have been precomputed at the operating point !!

◆ getValue()

double rr::RoadRunner::getValue ( const std::string &  sel)

Creates a new selection based on the selection string, and returns the value it queries.

◆ internalOneStep()

double rr::RoadRunner::internalOneStep ( double  currentTime,
double  stepSize,
bool  reset = true 
)

Carry out a single internal solver integration step.

Parameters
t0starting time
tffinal time
optionsoverride current options.

◆ load()

void rr::RoadRunner::load ( const std::string &  uriOrSBML,
const Dictionary options = 0 
)

load an sbml document from anywhere.

If options is not null, then the RoadRunner::computeAndAssignConservationLaws flag is set to whatever value is specified in the options struct.

WARNING, will no longer return a value in next version.

Parameters
uriOrSBMLa URI, local path or sbml document contents.
optionsan options struct, if null, default values are used.

◆ makeIntegrator()

Integrator* rr::RoadRunner::makeIntegrator ( std::string  name)

Make an integrator for the given name

◆ oneStep()

double rr::RoadRunner::oneStep ( double  currentTime,
double  stepSize,
bool  reset = true 
)

Carry out a single integration step using a stepsize as indicated in the method call.

Parameters
t0starting time
tffinal time
optionsoverride current options.

◆ regenerateModel()

void rr::RoadRunner::regenerate ( bool  forceRegenerate = true,
bool  reset = false 
)

Regenerate this RoadRunner instance's ExecutableModel based on the model in its SBMLDocument

◆ removeCompartment()

void rr::RoadRunner::removeCompartment ( const std::string &  cid,
bool  forceRegenerate = true 
)

Remove a compartment from the current model

Parameters
cidthe ID of the compartment to be removed
forceRegeneratea boolean value to indicate if the model is regenerated after this function call default value is true to regenerate model after each call of editing function to save time for editing for multiple times, one could set this flag to true only in the last call of editing

◆ removeEvent()

void rr::RoadRunner::removeEvent ( const std::string &  eid,
bool  forceRegenerate = true 
)

Remove an event from the current model

Parameters
eidthe ID of the event to be removed
forceRegeneratea boolean value to indicate if the model is regenerated after this function call default value is true to regenerate model after each call of editing function to save time for editing for multiple times, one could set this flag to true only in the last call of editing

◆ removeEventAssignments()

void rr::RoadRunner::removeEventAssignments ( const std::string &  eid,
const std::string &  vid,
bool  forceRegenerate = true 
)

Remove event assignments for given variable from an existing event

Parameters
eidthe ID of the event
eidthe ID of the vairable of the event assignments
forceRegeneratea boolean value to indicate if the model is regenerated after this function call default value is true to regenerate model after each call of editing function to save time for editing for multiple times, one could set this flag to true only in the last call of editing

◆ removeInitialAssignment()

void rr::RoadRunner::removeInitialAssignment ( const std::string &  vid,
bool  forceRegenerate = true 
)

Remove initial assignment for a symbol from the current model

Parameters
vidID of the symbol
forceRegeneratea boolean value to indicate if the model is regenerated after this function call default value is true to regenerate model after each call of editing function to save time for editing for multiple times, one could set this flag to true only in the last call of editing

◆ removeParameter()

void rr::RoadRunner::removeParameter ( const std::string &  pid,
bool  forceRegenerate = true 
)

Remove a parameter from the current model

Parameters
pidthe ID of the parameter to be removed
forceRegeneratea boolean value to indicate if the model is regenerated after this function call default value is true to regenerate model after each call of editing function to save time for editing for multiple times, one could set this flag to true only in the last call of editing

◆ removeReaction()

void rr::RoadRunner::removeReaction ( const std::string &  rid,
bool  deleteUnusedParameters = false,
bool  forceRegenerate = true 
)

Remove a reaction from the current model

Parameters
ridthe ID of the reaction to be removed
forceRegeneratea boolean value to indicate if the model is regenerated after this function call default value is true to regenerate model after each call of editing function to save time for editing for multiple times, one could set this flag to true only in the last call of editing

◆ removeRules()

void rr::RoadRunner::removeRules ( const std::string &  vid,
bool  useInitialValue = false,
bool  forceRegenerate = true 
)

Remove rules related to given variable from the current model

Parameters
vidID of variable that rules assign formula to
useInitialValuea boolean value to indicate whether using initial value as current value when the assignment rule of a variable is removed otherwise, it will keep the value of assignment rule as current value
forceRegeneratea boolean value to indicate if the model is regenerated after this function call default value is true to regenerate model after each call of editing function to save time for editing for multiple times, one could set this flag to true only in the last call of editing

◆ reset() [1/2]

void rr::RoadRunner::reset ( )

Picks up default options from config.

The current default is SelectionRecord::TIME | SelectionRecord::RATE | SelectionRecord::FLOATING.

◆ reset() [2/2]

void rr::RoadRunner::reset ( int  options)

reset the model accordign to a bitfield specified by the SelectionRecord::SelectionType values.

Note, this would make more sense as an unsigned, however SWIG has issues mapping an enum to an unsigned, but seems to map enums just fine to an int.

For example, to reset the floating species, time and rate rule values:

@ RATE
Definition: rrSelectionRecord.h:40
@ FLOATING
Definition: rrSelectionRecord.h:51
@ TIME
Definition: rrSelectionRecord.h:23
Parameters
optionsa bitmask made from the SelectionRecord::SelectionTypes values.

◆ resetSelectionLists()

void rr::RoadRunner::resetSelectionLists ( )

resets time course and steady state selection lists to defaults

◆ setBoundary()

void rr::RoadRunner::setBoundary ( const std::string &  sid,
bool  boundaryCondition,
bool  forceRegenerate = true 
)

Set the boundary condition of an existing species. By default, the boundary condition for a species is false.

Parameters
sidthe ID of the species
boundaryConditionboundary condition to be set
forceRegeneratea boolean value to indicate if the model is regenerated after this function call default value is true to regenerate model after each call of editing function to save time for editing for multiple times, one could set this flag to true only in the last call of editing

◆ setCompiler()

void rr::RoadRunner::setCompiler ( const std::string &  compiler)

Set the name of the externa compiler to use. Some ModelGenerators may have no use for this value.

An exception is raised if the string is invalid.

◆ setConservedMoietyAnalysis()

void rr::RoadRunner::setConservedMoietyAnalysis ( bool  value)

This method turns on / off the computation and adherence to conservation laws.

◆ setConstant()

void rr::RoadRunner::setConstant ( const std::string &  sid,
bool  constant,
bool  forceRegenerate = true 
)

Set the constant attribute for an existing species/ parameter/ compartment By default, the constant attribute is false.

Parameters
sidthe ID of a species/ parameter/ compartment
constantthe constant attribute to be set
forceRegeneratea boolean value to indicate if the model is regenerated after this function call default value is true to regenerate model after each call of editing function to save time for editing for multiple times, one could set this flag to true only in the last call of editing

◆ setDiffStepSize()

void rr::RoadRunner::setDiffStepSize ( double  val)

Set the differential step size used in MCA routines like getCC.

Author
JKM

◆ setGlobalParameterByName()

void rr::RoadRunner::setGlobalParameterByName ( const std::string &  param,
double  value 
)

set the parameter with id

Author
ciaran welsh
Parameters
paramto
value

◆ setHasOnlySubstanceUnits()

void rr::RoadRunner::setHasOnlySubstanceUnits ( const std::string &  sid,
bool  hasOnlySubstanceUnits,
bool  forceRegenerate = true 
)

Set the hasOnlySubstanceUnits attribute for an existing species.

Parameters
sidthe ID of a species
hasOnlySubstanceUnitsthe value of hasOnlySubstanceUnits attribute to be set
forceRegeneratea boolean value to indicate if the model is regenerated after this function call default value is true to regenerate model after each call of editing function to save time for editing for multiple times, one could set this flag to true only in the last call of editing

◆ setInitAmount()

void rr::RoadRunner::setInitAmount ( const std::string &  sid,
double  initAmount,
bool  forceRegenerate = true 
)

Set initial amount for an existing species. Initial amount/concentration set before will be unset.

Parameters
sidthe ID of a species
initAmountthe initial amount to be set
forceRegeneratea boolean value to indicate if the model is regenerated after this function call default value is true to regenerate model after each call of editing function to save time for editing for multiple times, one could set this flag to true only in the last call of editing

◆ setInitConcentration()

void rr::RoadRunner::setInitConcentration ( const std::string &  sid,
double  initConcentration,
bool  forceRegenerate = true 
)

Set initial concentration for an existing species. Initial amount/concentration set before will be unset.

Parameters
sidthe ID of a species
initConcentrationthe initial concentration to be set
forceRegeneratea boolean value to indicate if the model is regenerated after this function call default value is true to regenerate model after each call of editing function to save time for editing for multiple times, one could set this flag to true only in the last call of editing

◆ setSteadyStateSelections() [1/2]

void rr::RoadRunner::setSteadyStateSelections ( const std::vector< rr::SelectionRecord > &  steadyStateSelections)

makes a copy of an existing list of selection records. These will be saved and used for selection values in getSteadyStateValues().

◆ setSteadyStateSelections() [2/2]

void rr::RoadRunner::setSteadyStateSelections ( const std::vector< std::string > &  steadyStateSelections)

parses the given list of strings and generates selections records which will be used for the steady state selections.

◆ setSteadyStateThreshold()

void rr::RoadRunner::setSteadyStateThreshold ( double  val)

Set the steady state threshold used in getCC.

Author
JKM

In the MCA routines, RoadRunner will keep trying to converge to a steady state until this threshold is met

◆ setValue()

void rr::RoadRunner::setValue ( const std::string &  id,
double  value 
)

sets the value coresponding to the given selection string

raises an exception in the selection string is invalid.

◆ simulate()

const ls::DoubleMatrix* rr::RoadRunner::simulate ( const Dictionary options = 0)

Simulate the current SBML model.

If options is null, then the current simulation settings (start time, end time, n steps) are used. If options is not null, then the current simulation settings are set to the values specified by options and they are used.

The options Dictionary may contain a large number of options, for a complete list of all available options for each integrator type,

See also
IntegratorFactory,
SimulateOptions.

For example, to perform a simulation from time 0 to 10 with 1000 steps, using a stiff integtator, you would:

RoadRunner r = RoadRunner("someFile.xml");
BasicDictionary opt;
opt.setItem("start", 0);
opt.setItem("duration", 10);
opt.setItem("steps", 1000);
opt.setItem("stiff", true);
const DoubleMatrix *result = r.simulate(&opt);
RoadRunner(unsigned int level=3, unsigned int version=2)

Similarly, if one wants to use a stochastic integrator, such as the Gillespie integrator, this is set via the "integrator" key, i.e.

RoadRunner r = RoadRunner("someFile.xml");
BasicDictionary opt;
opt.setItem("integrator", "gillespie");
opt.setItem("start", 0);
opt.setItem("duration", 10);
opt.setItem("steps", 1000);
opt.setItem("stiff", true);
opt.setItem("seed", 12345);
const DoubleMatrix *result = r.simulate(&opt);

Here, the "integrator" specifies the integrator to use. The "stiff" key is only used by the deterministic solvers, and it is safely ignored by the stochastic solvers. Also, the "seed" sets the random seed that the integrator uses. For more information about all of the avaialble options for each integrator,

If one wants to not store the result matrix in memory and instead write it to a file during simulation, one can set the output_file option. When output file is nonempty, simulate() will write to its path once every Config::K_ROWS_PER_WRITE rows are generated and clear the matrix. So an empty result matrix is returned, and the last simulation results are not stored.

See also
IntegratorFactory::getIntegratorOptions".
Exceptions
anstd::exception if any options are invalid.
Returns
a borrowed reference to a DoubleMatrix object if successful. The matrix will be empty if output_file is specified and nonempty.

◆ steadyState()

double rr::RoadRunner::steadyState ( const Dictionary dict = 0)

Compute the steady state of the model, returns the sum of squares of the solution

The steady state solver and whatever options it needs may be specified via the given dictionary. For a list of all available steady state solvers,

See also
SteadyStateSolverFactory.
Parameters
dicta pointer to a dictionary which has the steady state options. May be NULL, in this case the existing options are used.

◆ steadyStateApproximate()

double rr::RoadRunner::steadyStateApproximate ( const Dictionary dict = 0)

Appoximate the steady state of the model by checking the changes in time course simulation. Returns the sum of squares of the solution

Appoximation will use CVODE with variable step sizes.

Parameters
dicta pointer to a dictionary which has the steady state options. May be NULL, in this case the existing options are used.

◆ steadyStateNamedArray()

ls::DoubleMatrix rr::RoadRunner::steadyStateNamedArray ( const Dictionary dict = 0)

Like steadyState but returns a named array of the steady state values

◆ validateCurrentSBML()

void rr::RoadRunner::validateCurrentSBML ( )

Validate the current SBML


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