COPASI API  4.40.278
CModel Class Reference

#include <CModel.h>

Inheritance diagram for CModel:
[legend]

Public Types

enum  DependencyType { initial = 0 , transient , physical }
 
enum class  ModelType { deterministic , stochastic , __SIZE }
 
enum  UnitType {
  volume = 0 , area , length , time ,
  quantity
}
 
- Public Types inherited from CModelEntity
enum class  Status {
  FIXED = 0 , ASSIGNMENT , REACTIONS , ODE ,
  TIME , __SIZE
}
 
- Public Types inherited from CDataContainer
typedef CDataObjectMap objectMap
 
- Public Types inherited from CDataObject
typedef std::set< const CDataObject * > DataObjectSet
 
enum  Flag {
  Container , Vector , Matrix , NameVector ,
  Reference , ValueBool , ValueInt , ValueInt64 ,
  ValueDbl , NonUniqueName , StaticString , ValueString ,
  Separator , DisplayName , ModelEntity , Array ,
  DataModel , Root , Gui , __SIZE
}
 
- Public Types inherited from CObjectInterface
typedef std::vector< const CDataContainer * > ContainerList
 
typedef std::set< const CObjectInterface * > ObjectSet
 
- Public Types inherited from CAnnotation
typedef std::map< std::string, std::string > UnsupportedAnnotation
 

Public Member Functions

void addModelEntity (const CModelEntity *pModelEntity)
 
bool appendAllDependents (const CDataContainer &container, DataObjectSet &dependentReactions, DataObjectSet &dependentMetabolites, DataObjectSet &dependentCompartments, DataObjectSet &dependentModelValues, DataObjectSet &dependentEvents, DataObjectSet &dependentEventAssignments, const bool &onlyStructural=false) const
 
bool appendAllDependents (const ObjectSet &objects, DataObjectSet &dependentReactions, DataObjectSet &dependentMetabolites, DataObjectSet &dependentCompartments, DataObjectSet &dependentModelValues, DataObjectSet &dependentEvents, DataObjectSet &dependentEventAssignments, const bool &onlyStructural=false) const
 
bool appendDirectDependents (const CDataContainer &container, DataObjectSet &dependentReactions, DataObjectSet &dependentMetabolites, DataObjectSet &dependentCompartments, DataObjectSet &dependentModelValues, DataObjectSet &dependentEvents, DataObjectSet &dependentEventAssignments, const bool &onlyStructural=false) const
 
bool appendDirectDependents (const ObjectSet &objects, DataObjectSet &dependentReactions, DataObjectSet &dependentMetabolites, DataObjectSet &dependentCompartments, DataObjectSet &dependentModelValues, DataObjectSet &dependentEvents, DataObjectSet &dependentEventAssignments, const bool &onlyStructural=false) const
 
void applyActiveParameterSet ()
 
virtual bool applyData (const CData &data, CUndoData::CChangeSet &changes)
 
void applyInitialValues ()
 
bool buildDependencyGraphs ()
 
CCore::CUpdateSequence buildInitialRefreshSequence (std::set< const CDataObject * > &changedObjects)
 
void buildLinkZero ()
 
void buildMoieties ()
 
void buildRedStoi ()
 
void buildStoi ()
 
void changeUnitExpressionSymbols (std::string oldSymbol, std::string newSymbol)
 
void clearSbmlIds ()
 
 CModel (CDataContainer *pParent)
 
bool compileIfNecessary (CProcessReport *pProcessReport)
 
bool convert2NonReversible ()
 
CCompartmentcreateCompartment (const std::string &name, const C_FLOAT64 &volume=1.0)
 
CEventcreateEvent (const std::string &name)
 
bool createEventsForTimeseries (CExperiment *experiment=NULL)
 
CMetabcreateMetabolite (const std::string &name, const std::string &compartment, const C_FLOAT64 &iconc=1.0, const CModelEntity::Status &status=CModelEntity::Status::REACTIONS)
 
CModelValuecreateModelValue (const std::string &name, const C_FLOAT64 &value=0.0)
 
CReactioncreateReaction (const std::string &name)
 
virtual void createUndoData (CUndoData &undoData, const CUndoData::Type &type, const CData &oldData=CData(), const CCore::Framework &framework=CCore::Framework::ParticleNumbers) const
 
CMetabfindMetabByName (const std::string &name) const
 
size_t findMoiety (const std::string &Target) const
 
bool forceCompile (CProcessReport *pProcessReport)
 
void functionDefinitionChanged (const CFunction *pFunction)
 
CModelParameterSetgetActiveModelParameterSet ()
 
const CModelParameterSetgetActiveModelParameterSet () const
 
const std::string & getAreaUnit () const
 
std::string getAreaUnitName () const
 
const C_FLOAT64getAvogadro () const
 
virtual std::string getChildObjectUnits (const CDataObject *pObject) const
 
CDataVectorNS< CCompartment > & getCompartments ()
 
const CDataVectorNS< CCompartment > & getCompartments () const
 
CDataObjectgetCorrespondingTransientObject (const CDataObject *pObject) const
 
CDataVectorN< CEvent > & getEvents ()
 
const CDataVectorN< CEvent > & getEvents () const
 
const C_FLOAT64getInitialTime () const
 
const std::string & getKey () const
 
const CLinkMatrixViewgetL () const
 
const CLinkMatrixgetL0 () const
 
const CDataArraygetLAnnotation () const
 
const std::string & getLengthUnit () const
 
std::string getLengthUnitName () const
 
CMathContainergetMathContainer ()
 
const CMathContainergetMathContainer () const
 
CDataVector< CMetab > & getMetabolites ()
 
const CDataVector< CMetab > & getMetabolites () const
 
CDataVector< CMetab > & getMetabolitesX ()
 
const CDataVector< CMetab > & getMetabolitesX () const
 
CDataVectorN< CModelParameterSet > & getModelParameterSets ()
 
const CDataVectorN< CModelParameterSet > & getModelParameterSets () const
 
const ModelTypegetModelType () const
 
CDataVectorN< CModelValue > & getModelValues ()
 
const CDataVectorN< CModelValue > & getModelValues () const
 
const CDataVector< CMoiety > & getMoieties () const
 
size_t getNumAssignmentMetabs () const
 
const C_FLOAT64getNumber2QuantityFactor () const
 
size_t getNumDependentReactionMetabs () const
 
size_t getNumIndependentReactionMetabs () const
 
size_t getNumMetabs () const
 
size_t getNumModelValues () const
 
size_t getNumODEMetabs () const
 
size_t getNumVariableMetabs () const
 
const CVector< C_FLOAT64 > & getParticleFlux () const
 
const C_FLOAT64getQuantity2NumberFactor () const
 
const std::string getQuantityUnit () const
 
std::string getQuantityUnitName () const
 
CDataVectorNS< CReaction > & getReactions ()
 
const CDataVectorNS< CReaction > & getReactions () const
 
const std::set< std::pair< const CReaction *, C_FLOAT64 > > & getReactionsPerSpecies (const CMetab *) const
 
const CMatrix< C_FLOAT64 > & getRedStoi () const
 
const CDataArraygetRedStoiAnnotation () const
 
const CStateTemplategetStateTemplate () const
 
const CMatrix< C_FLOAT64 > & getStoi () const
 
const CDataArraygetStoiAnnotation () const
 
const C_FLOAT64getTime () const
 
const std::string & getTimeUnit () const
 
std::string getTimeUnitName () const
 
size_t getTotSteps () const
 
std::vector< const CEvaluationTree * > getTreesWithDiscontinuities () const
 
virtual const std::string getUnits () const
 
CDataObject::DataObjectSet getUnitSymbolUsage (std::string symbol) const
 
std::map< std::string, CUnitgetUsedUnits () const
 
const std::string & getVolumeUnit () const
 
std::string getVolumeUnitName () const
 
bool hasReversibleReaction () const
 
CVector< C_FLOAT64initializeAtolVector (const C_FLOAT64 &baseTolerance, const bool &reducedModel) const
 
void initializeMetabolites ()
 
const bool & isAutonomous () const
 
const bool & isCompileNecessary () const
 
bool isStateVariable (const CDataObject *pObject) const
 
C_INT32 load (CReadConfig &configBuffer)
 
CEvaluationNodeprepareElasticity (const CReaction *pReaction, const CModelEntity *pVar, bool simplify)
 
void refreshActiveParameterSet ()
 
bool removeCompartment (const CCompartment *pCompartment, const bool &recursive=true)
 
bool removeCompartment (const size_t index, const bool &recursive=true)
 
bool removeCompartment (const std::string &key, const bool &recursive=true)
 
void removeDependentModelObjects (const ObjectSet &deletedObjects, const bool &onlyStructural=false)
 
bool removeEvent (const CEvent *pEvent, const bool &recursive=true)
 
bool removeEvent (const size_t index, const bool &recursive=true)
 
bool removeEvent (const std::string &key, const bool &recursive=true)
 
bool removeFunction (const CFunction *pFunction, const bool &recursive=true)
 
bool removeLocalReactionParameter (const std::string &key, const bool &recursive=true)
 
bool removeMetabolite (const CMetab *pMetabolite, const bool &recursive=true)
 
bool removeMetabolite (const size_t index, const bool &recursive=true)
 
bool removeMetabolite (const std::string &key, const bool &recursive=true)
 
void removeModelEntity (const CModelEntity *pModelEntity)
 
bool removeModelValue (const CModelValue *pModelValue, const bool &recursive=true)
 
bool removeModelValue (const size_t index, const bool &recursive=true)
 
bool removeModelValue (const std::string &key, const bool &recursive=true)
 
bool removeReaction (const CReaction *pReaction, const bool &recursive=true)
 
bool removeReaction (const size_t index, const bool &recursive=true)
 
bool removeReaction (const std::string &key, const bool &recursive=true)
 
bool setAreaUnit (const std::string &name)
 
void setAvogadro (const C_FLOAT64 &avogadro, const CCore::Framework &frameWork)
 
void setCompileFlag (bool flag=true)
 
void setInitialTime (const C_FLOAT64 &time)
 
bool setLengthUnit (const std::string &name)
 
void setModelType (const ModelType &modelType)
 
virtual bool setObjectParent (const CDataContainer *pParent)
 
bool setQuantityUnit (const std::string &name, const CCore::Framework &frameWork)
 
void setTime (const C_FLOAT64 &time)
 
bool setTimeUnit (const std::string &name)
 
bool setVolumeUnit (const std::string &name)
 
void stateToIntialState ()
 
std::string suitableForStochasticSimulation () const
 
virtual CData toData () const
 
bool updateInitialValues (const CCore::Framework &framework)
 
void updateInitialValues (const CDataObject *changedObject)
 
void updateInitialValues (std::set< const CDataObject * > &changedObjects)
 
 ~CModel ()
 
- Public Member Functions inherited from CModelEntity
virtual void calculate ()
 
 CModelEntity (const CModelEntity &src, const CDataContainer *pParent)
 
 CModelEntity (const std::string &name="NoName", const CDataContainer *pParent=NO_PARENT, const std::string &type="ModelEntity", const CFlags< Flag > &flag=CFlags< Flag >::None)
 
std::string getDefaultNoiseExpression () const
 
std::string getExpression () const
 
CExpressiongetExpressionPtr ()
 
const CExpressiongetExpressionPtr () const
 
std::string getInitialExpression () const
 
CExpressiongetInitialExpressionPtr ()
 
const CExpressiongetInitialExpressionPtr () const
 
const C_FLOAT64getInitialValue () const
 
CDataObjectgetInitialValueReference () const
 
CModelgetModel () const
 
std::string getNoiseExpression () const
 
CExpressiongetNoiseExpressionPtr ()
 
const CExpressiongetNoiseExpressionPtr () const
 
CDataObjectgetNoiseReference () const
 
const C_FLOAT64getRate () const
 
CDataObjectgetRateReference () const
 
const std::string & getSBMLId () const
 
const CModelEntity::StatusgetStatus () const
 
virtual const std::string & getUnitExpression () const
 
const C_FLOAT64getValue () const
 
virtual const CDataObjectgetValueObject () const override
 
virtual void * getValuePointer () const override
 
CDataObjectgetValueReference () const
 
const bool & hasNoise () const
 
bool isFixed () const
 
const bool & isUsed () const
 
CIssue setExpression (const std::string &expression)
 
bool setExpressionPtr (CExpression *pExpression)
 
void setHasNoise (const bool &hasNoise)
 
CIssue setInitialExpression (const std::string &expression)
 
bool setInitialExpressionPtr (CExpression *pExpression)
 
virtual void setInitialValue (const C_FLOAT64 &initialValue)
 
bool setNoiseExpression (const std::string &expression)
 
bool setNoiseExpressionPtr (CExpression *pExpression)
 
void setRate (const C_FLOAT64 &rate)
 
void setSBMLId (const std::string &id) const
 
bool setStatus (const CModelEntity::Status &status)
 
virtual CIssue setUnitExpression (std::string unitExpression)
 
void setUsed (const bool &used)
 
virtual void setValue (const C_FLOAT64 &value)
 
 ~CModelEntity ()
 
- Public Member Functions inherited from CDataContainer
virtual bool add (CDataObject *pObject, const bool &adopt=true)
 
virtual bool appendDeletedDependentData (CUndoData &undoData) const
 
 CDataContainer (const CDataContainer &src, const CDataContainer *pParent)
 
 CDataContainer (const std::string &name, const CDataContainer *pParent=NO_PARENT, const std::string &type="CN", const CFlags< Flag > &flag=CFlags< Flag >::None)
 
void getDescendants (CDataObject::DataObjectSet &descendants, const bool &recursive=false) const
 
virtual size_t getIndex (const CDataObject *pObject) const
 
virtual const CObjectInterfacegetObject (const CCommonName &cn) const override
 
virtual objectMapgetObjects ()
 
virtual const objectMapgetObjects () const
 
virtual CUndoObjectInterfaceinsert (const CData &data) override
 
void objectRenamed (CDataObject *pObject, const std::string &oldName)
 
virtual bool remove (CDataObject *pObject)
 
virtual ~CDataContainer ()
 
- Public Member Functions inherited from CDataObject
void addIssue (const CIssue &issue)
 
void addReference (const CDataContainer *pReference)
 
virtual void calculateValue () override
 
 CDataObject (const CDataObject &src, const CDataContainer *pParent=NULL)
 
virtual void destruct () override
 
virtual CCommonName getCN () const override
 
virtual const CDataObjectgetDataObject () const override
 
CDataContainergetObjectAncestor (const std::string &type) const
 
CDataModelgetObjectDataModel () const
 
virtual std::string getObjectDisplayName () const override
 
const CObjectInterfacegetObjectFromCN (const CCommonName &cn) const
 
const std::string & getObjectName () const
 
CDataContainergetObjectParent () const
 
const std::string & getObjectType () const
 
virtual const CObjectInterface::ObjectSetgetPrerequisites () const override
 
virtual const CValiditygetValidity () const override
 
bool hasFlag (const Flag &flag) const
 
virtual bool isPrerequisiteForContext (const CObjectInterface *pObject, const CCore::SimulationContextFlag &context, const CObjectInterface::ObjectSet &changedObjects) const override
 
bool prerequisitsContains (const DataObjectSet &objects) const
 
virtual void print (std::ostream *ostream) const override
 
void removeIssue (const CIssue &issue)
 
void removeReference (const CDataContainer *pReference)
 
bool setObjectName (const std::string &name)
 
void validityChanged (const CValidity &changedValidity) override
 
void validityRemoved (const CValidity &changedValidity)
 
virtual ~CDataObject ()
 
- Public Member Functions inherited from CObjectInterface
 CObjectInterface ()
 
 CObjectInterface (const CObjectInterface &src)
 
virtual ~CObjectInterface ()
 
- Public Member Functions inherited from CUndoObjectInterface
 CUndoObjectInterface ()
 
 CUndoObjectInterface (const CUndoObjectInterface &src)
 
bool generateUuid ()
 
const xg::Guid & getUuid () const
 
bool setUuid (const std::string &uuid)
 
bool setUuid (const xg::Guid &uuid)
 
virtual void updateIndex (const size_t &index, const CUndoObjectInterface *pUndoObject)
 
virtual ~CUndoObjectInterface ()
 
- Public Member Functions inherited from CAnnotation
bool addUnsupportedAnnotation (const std::string &name, const std::string &xml)
 
bool applyData (const CData &data, CUndoData::CChangeSet &changes)
 
 CAnnotation ()
 
 CAnnotation (const CAnnotation &src)
 
void createUndoData (CUndoData &undoData, const CUndoData::Type &type, const CData &oldData=CData(), const CCore::Framework &framework=CCore::Framework::ParticleNumbers) const
 
const std::string & getMiriamAnnotation () const
 
const std::string & getNotes () const
 
UnsupportedAnnotationgetUnsupportedAnnotations ()
 
const UnsupportedAnnotationgetUnsupportedAnnotations () const
 
void initMiriamAnnotation (const std::string &newId)
 
bool operator== (const CAnnotation &rhs) const
 
bool removeUnsupportedAnnotation (const std::string &name)
 
bool replaceUnsupportedAnnotation (const std::string &name, const std::string &xml)
 
void setMiriamAnnotation (const std::string &miriamAnnotation, const std::string &newId, const std::string &oldId)
 
void setNotes (const std::string &notes)
 
CData toData () const
 
virtual ~CAnnotation ()
 

Static Public Member Functions

static CModelfromData (const CData &data, CUndoObjectInterface *pParent)
 
- Static Public Member Functions inherited from CModelEntity
static CModelEntityfromData (const CData &data, CUndoObjectInterface *pParent)
 
- Static Public Member Functions inherited from CDataContainer
static CDataContainerfromData (const CData &data, CUndoObjectInterface *pParent)
 
- Static Public Member Functions inherited from CDataObject
static CDataObjectfromData (const CData &data, CUndoObjectInterface *pParent)
 
static void sanitizeObjectName (std::string &name)
 
- Static Public Member Functions inherited from CObjectInterface
static const CDataObjectDataObject (const CObjectInterface *pInterface)
 
static CObjectInterfaceGetObjectFromCN (const ContainerList &listOfContainer, const CCommonName &objName)
 
- Static Public Member Functions inherited from CUndoObjectInterface
template<class CType >
static CType * fromData (const CData &, CUndoObjectInterface *)
 
- Static Public Member Functions inherited from CAnnotation
static CMIRIAMInfoallocateMiriamInfo (CDataContainer *pParent)
 
static CAnnotationcastObject (CDataObject *pObject)
 
static const CAnnotationcastObject (const CDataObject *pObject)
 
static void freeMiriamInfo (CDataContainer *pParent)
 

Static Public Attributes

static const CEnumAnnotation< std::string, ModelTypeModelTypeNames
 
- Static Public Attributes inherited from CModelEntity
static const CEnumAnnotation< std::string, StatusStatusName
 
static const CEnumAnnotation< std::string, StatusXMLStatus
 
- Static Public Attributes inherited from CDataContainer
static const CObjectInterface::ContainerList EmptyList
 

Private Member Functions

bool buildStateTemplate ()
 
bool buildUserOrder ()
 
void clearMoieties ()
 
 CModel (const CModel &src)
 
CIssue compile ()
 
CIssue compileEvents ()
 
bool handleUnusedMetabolites ()
 
void initObjects ()
 
CModeloperator= (const CModel &src)
 
void removeDataObject (const CDataObject *pObject)
 
void replaceInExpressions (const std::string &oldStr, const std::string &newStr)
 
void updateMatrixAnnotations ()
 
void updateMoietyValues ()
 

Private Attributes

std::string mActiveParameterSetKey
 
std::string mAreaUnit
 
C_FLOAT64 mAvogadro
 
bool mBuildInitialSequence
 
CDataVectorNS< CCompartmentmCompartments
 
bool mCompileIsNecessary
 
CMatrix< C_FLOAT64mElasticities
 
CDataVectorN< CEventmEvents
 
bool mIsAutonomous
 
CVector< size_t > mJacobianPivot
 
CLinkMatrix mL
 
std::string mLengthUnit
 
CLinkMatrixView mLView
 
CDataVector< CMetabmMetabolites
 
CDataVector< CMetabmMetabolitesX
 
CDataVector< CMoietymMoieties
 
C_FLOAT64 mNumber2QuantityFactor
 
size_t mNumMetabolitesAssignment
 
size_t mNumMetabolitesODE
 
size_t mNumMetabolitesReaction
 
size_t mNumMetabolitesReactionIndependent
 
size_t mNumMetabolitesUnused
 
CModelParameterSet mParameterSet
 
CDataVectorN< CModelParameterSetmParameterSets
 
CVector< C_FLOAT64mParticleFluxes
 
CDataObjectmpAvogadroReference
 
CDataArraympLinkMatrixAnnotation
 
CMathContainermpMathContainer
 
CProcessReportmpProcessReport
 
CDataObjectmpQuantity2NumberFactorReference
 
CDataArraympRedStoiAnnotation
 
CDataArraympStoiAnnotation
 
C_FLOAT64 mQuantity2NumberFactor
 
std::string mQuantityUnit
 
std::map< const CMetab *, std::set< std::pair< const CReaction *, C_FLOAT64 > > > mReactionsPerSpecies
 
CMatrix< C_FLOAT64mRedStoi
 
bool mReorderNeeded
 
CStateTemplate mStateTemplate
 
CDataVectorNS< CReactionmSteps
 
CMatrix< C_FLOAT64mStoi
 
CMathDependencyGraph mStructuralDependencies
 
std::string mTimeUnit
 
ModelType mType
 
CDataVectorN< CModelValuemValues
 
std::string mVolumeUnit
 

Friends

class CFunctionDB
 

Additional Inherited Members

- Protected Member Functions inherited from CModelEntity
 CModelEntity (const CModelEntity &src)
 
- Protected Member Functions inherited from CDataContainer
template<class CType >
CDataMatrixReference< CType > * addMatrixReference (const std::string &name, CType &reference, const CFlags< Flag > &flag=CFlags< Flag >::None)
 
template<class CType >
CDataObjectReference< CType > * addObjectReference (const std::string &name, CType &reference, const CFlags< Flag > &flag=CFlags< Flag >::None)
 
template<class CType >
CDataVectorReference< CType > * addVectorReference (const std::string &name, CType &reference, const CFlags< Flag > &flag=CFlags< Flag >::None)
 
 CDataContainer (const CDataContainer &src)
 
void initObjects ()
 
- Protected Member Functions inherited from CDataObject
 CDataObject ()
 
 CDataObject (const std::string &name, const CDataContainer *pParent=static_cast< CDataContainer * >((void *) 0), const std::string &type="CN", const CFlags< Flag > &flag=CFlags< Flag >::None)
 
- Protected Attributes inherited from CModelEntity
bool mHasNoise
 
C_FLOAT64 mIValue
 
C_FLOAT64 mNoise
 
CExpressionmpExpression
 
CExpressionmpInitialExpression
 
CDataObjectReference< C_FLOAT64 > * mpIValueReference
 
CModelmpModel
 
CExpressionmpNoiseExpression
 
CDataObjectReference< C_FLOAT64 > * mpNoiseReference
 
CDataObjectReference< C_FLOAT64 > * mpRateReference
 
CDataObjectReference< C_FLOAT64 > * mpValueReference
 
C_FLOAT64 mRate
 
std::string mSBMLId
 
std::string mUnitExpression
 
C_FLOAT64 mValue
 
- Protected Attributes inherited from CDataContainer
objectMap mObjects
 
- Protected Attributes inherited from CDataObject
ObjectSet mPrerequisits
 
std::set< CDataContainer * > mReferences
 
- Protected Attributes inherited from CObjectInterface
CValidity mValidity
 
- Protected Attributes inherited from CAnnotation
std::string mKey
 

Member Enumeration Documentation

◆ DependencyType

Enumerator
initial 
transient 
physical 

◆ ModelType

enum CModel::ModelType
strong

Enum of valid model types.

Enumerator
deterministic 
stochastic 
__SIZE 

◆ UnitType

Enumerator
volume 
area 
length 
time 
quantity 

Constructor & Destructor Documentation

◆ CModel() [1/2]

CModel::CModel ( const CModel src)
private

Copy constructor

Parameters
const CModel &src

Referenced by fromData().

◆ CModel() [2/2]

◆ ~CModel()

Member Function Documentation

◆ addModelEntity()

void CModel::addModelEntity ( const CModelEntity pModelEntity)

Add a model entity to the model

Parameters
constCModelEntity * pModelEntity

References CStateTemplate::add(), and mStateTemplate.

Referenced by CModelEntity::initObjects(), and CModelEntity::setObjectParent().

◆ appendAllDependents() [1/2]

bool CModel::appendAllDependents ( const CDataContainer container,
DataObjectSet dependentReactions,
DataObjectSet dependentMetabolites,
DataObjectSet dependentCompartments,
DataObjectSet dependentModelValues,
DataObjectSet dependentEvents,
DataObjectSet dependentEventAssignments,
const bool &  onlyStructural = false 
) const

Appends pointers to compartments, species, model values, reactions, events, and event assignments which dependent on the container. list.

Parameters
constCDataContainer & container
CDataObject::DataObjectSet& dependentReactions
CDataObject::DataObjectSet& dependentMetabolites
CDataObject::DataObjectSet& dependentCompartments
CDataObject::DataObjectSet& dependentModelValues
CDataObject::DataObjectSet& dependentEvents
CDataObject::DataObjectSet& dependentEventAssignments
constbool & onlyStructural (default: false)
Returns
bool objectsAppended

Referenced by CDataContainer::appendDeletedDependentData(), SBMLImporter::createCModelFromSBMLDocument(), CModelExpansion::SetOfModelElements::fillDependencies(), CFunctionDB::getUsedFunctions(), and removeDependentModelObjects().

◆ appendAllDependents() [2/2]

bool CModel::appendAllDependents ( const ObjectSet objects,
DataObjectSet dependentReactions,
DataObjectSet dependentMetabolites,
DataObjectSet dependentCompartments,
DataObjectSet dependentModelValues,
DataObjectSet dependentEvents,
DataObjectSet dependentEventAssignments,
const bool &  onlyStructural = false 
) const

◆ appendDirectDependents() [1/2]

bool CModel::appendDirectDependents ( const CDataContainer container,
CDataObject::DataObjectSet dependentReactions,
CDataObject::DataObjectSet dependentMetabolites,
CDataObject::DataObjectSet dependentCompartments,
CDataObject::DataObjectSet dependentModelValues,
CDataObject::DataObjectSet dependentEvents,
CDataObject::DataObjectSet dependentEventAssignments,
const bool &  onlyStructural = false 
) const

Appends pointers to compartments, species, model values, reactions, events, and event assignments which directly dependent on the container. list.

Parameters
constCDataContainer & container
CDataObject::DataObjectSet& dependentReactions
CDataObject::DataObjectSet& dependentMetabolites
CDataObject::DataObjectSet& dependentCompartments
CDataObject::DataObjectSet& dependentModelValues
CDataObject::DataObjectSet& dependentEvents
CDataObject::DataObjectSet& dependentEventAssignments
constbool & onlyStructural (default: false)
Returns
bool objectsAppended

Referenced by CMetab::getCountOfDependentReactions().

◆ appendDirectDependents() [2/2]

bool CModel::appendDirectDependents ( const ObjectSet objects,
CDataObject::DataObjectSet dependentReactions,
CDataObject::DataObjectSet dependentMetabolites,
CDataObject::DataObjectSet dependentCompartments,
CDataObject::DataObjectSet dependentModelValues,
CDataObject::DataObjectSet dependentEvents,
CDataObject::DataObjectSet dependentEventAssignments,
const bool &  onlyStructural = false 
) const

Appends pointers to compartments, species, model values, reactions, events, and event assignments which directly dependent on any of the objets. list.

Parameters
constObjectSet & objects
CDataObject::DataObjectSet& dependentReactions
CDataObject::DataObjectSet& dependentMetabolites
CDataObject::DataObjectSet& dependentCompartments
CDataObject::DataObjectSet& dependentModelValues
CDataObject::DataObjectSet& dependentEvents
CDataObject::DataObjectSet& dependentEventAssignments
constbool & onlyStructural (default: false)
Returns
bool objectsAppended

References CMathDependencyGraph::appendDirectDependents(), CDataVector< CType >::begin(), CDataVector< CType >::end(), CEvent::getAssignments(), CDataObject::getDataObject(), CDataContainer::getDescendants(), CMathContainer::getInitialDependencies(), CMathContainer::getMathObject(), CDataObject::getObjectAncestor(), CMathContainer::getTransientDependencies(), CUndoObjectInterface::insert(), CDataContainer::insert(), mpMathContainer, and mStructuralDependencies.

◆ applyActiveParameterSet()

void CModel::applyActiveParameterSet ( )

◆ applyData()

◆ applyInitialValues()

◆ buildDependencyGraphs()

◆ buildInitialRefreshSequence()

CCore::CUpdateSequence CModel::buildInitialRefreshSequence ( std::set< const CDataObject * > &  changedObjects)

Build the update sequence used to calculate all initial values depending on the changed objects. For metabolites the initial particle number is updated by default unless itself is in the list of changed objects. In that case the initial concentration is updated.

Parameters
std::set<const CDataObject * > & changedObjects
Returns
CCore::CUpdateSequence initialRefreshSequence

References CMathUpdateSequence::begin(), CMathContainer::getInitialDependencies(), CMathContainer::getInitialStateObjects(), CMathContainer::getMathObject(), CMathDependencyGraph::getUpdateSequence(), mpMathContainer, and CCore::UpdateMoieties.

Referenced by CSlider::setSliderObject(), and updateInitialValues().

◆ buildLinkZero()

void CModel::buildLinkZero ( )

Build the core of the link matrix L

Parameters
constCMatrix< C_FLOAT64 > & LU

References CLinkMatrix::build(), CLinkMatrix::doRowPivot(), CLinkMatrix::getNumIndependent(), mL, mNumMetabolitesReactionIndependent, and mStoi.

Referenced by compile().

◆ buildMoieties()

◆ buildRedStoi()

◆ buildStateTemplate()

◆ buildStoi()

◆ buildUserOrder()

◆ changeUnitExpressionSymbols()

void CModel::changeUnitExpressionSymbols ( std::string  oldSymbol,
std::string  newSymbol 
)

◆ clearMoieties()

void CModel::clearMoieties ( )
private

Clear all references to moieties

References CDataVector< CType >::clear(), and mMoieties.

Referenced by removeEvent(), removeMetabolite(), and removeReaction().

◆ clearSbmlIds()

void CModel::clearSbmlIds ( )

clears all SBML ids in the model

References getCompartments(), getEvents(), getMetabolites(), getModelValues(), and getReactions().

◆ compile()

◆ compileEvents()

CIssue CModel::compileEvents ( )
private

Compile the events

Returns
CIssue issue

References CDataVector< CType >::begin(), CDataVector< CType >::end(), and mEvents.

Referenced by compile().

◆ compileIfNecessary()

◆ convert2NonReversible()

◆ createCompartment()

CCompartment * CModel::createCompartment ( const std::string &  name,
const C_FLOAT64 volume = 1.0 
)

◆ createEvent()

CEvent * CModel::createEvent ( const std::string &  name)

Add a new event to the model

Parameters
conststd::string &name
Returns
bool success (false if failed)

References CDataVectorN< CType >::add(), C_INVALID_INDEX, CDataVectorN< CType >::getIndex(), mCompileIsNecessary, and mEvents.

Referenced by CModelAdd::addEvents(), createEventsForTimeseries(), CModelExpansion::duplicateEvent(), and SBMLImporter::importEvent().

◆ createEventsForTimeseries()

◆ createMetabolite()

CMetab * CModel::createMetabolite ( const std::string &  name,
const std::string &  compartment,
const C_FLOAT64 iconc = 1.0,
const CModelEntity::Status status = CModelEntity::Status::REACTIONS 
)

◆ createModelValue()

◆ createReaction()

CReaction * CModel::createReaction ( const std::string &  name)

◆ createUndoData()

void CModel::createUndoData ( CUndoData undoData,
const CUndoData::Type type,
const CData oldData = CData(),
const CCore::Framework framework = CCore::Framework::ParticleNumbers 
) const
virtual

Create the undo data which represents the changes recording the differences between the provided oldData and the current data.

Parameters
CUndoData& undoData
constCUndoData::Type & type
constCData & oldData (default: empty data)
constCCore::Framework & framework (default: CCore::Framework::ParticleNumbers)
Returns
CUndoData undoData

Reimplemented from CModelEntity.

References CUndoData::addProperty(), CData::addProperty(), CData::AREA_UNIT, CData::AVOGADRO_NUMBER, CUndoData::CHANGE, CModelEntity::createUndoData(), CData::FRAMEWORK, CCore::FrameworkNames, CData::getProperty(), CData::LENGTH_UNIT, mAreaUnit, mAvogadro, mLengthUnit, CData::MODEL_TYPE, ModelTypeNames, mQuantityUnit, mTimeUnit, mVolumeUnit, CData::QUANTITY_UNIT, CData::TIME_UNIT, CDataValue::toData(), CData::VALUE, and CData::VOLUME_UNIT.

◆ findMetabByName()

CMetab * CModel::findMetabByName ( const std::string &  name) const

Returns the pointer to the species with the given name

Parameters
conststd::string & name
Returns
CMetab * pSpecies

Returns the index of the metab

References CDataObjectMap::equal_range(), CDataContainer::getObjects(), mMetabolites, and unQuote().

Referenced by CMetabNameInterface::getMetabolite(), and CReaction::loadOneRole().

◆ findMoiety()

size_t CModel::findMoiety ( const std::string &  Target) const

Returns the index of the moiety

Parameters
conststd::string & Target
Returns
index

Returns the index of the Moiety

References C_INVALID_INDEX, CDataObject::getObjectName(), mMoieties, and CDataVector< CType >::size().

◆ forceCompile()

bool CModel::forceCompile ( CProcessReport pProcessReport)

Force a compile the model.

Parameters
CProcessReport* pProcessReport
Returns
bool success

References compileIfNecessary(), and setCompileFlag().

Referenced by CModel(), and CModelExpansion::replaceInModel().

◆ fromData()

CModel * CModel::fromData ( const CData data,
CUndoObjectInterface pParent 
)
static

Static method to create a CDataObject based on the provided data

Parameters
constCData & data
Returns
CModel * pDataObject

References CModel(), CData::getProperty(), NO_PARENT, CData::OBJECT_NAME, CDataObject::setObjectName(), and CDataValue::toString().

◆ functionDefinitionChanged()

void CModel::functionDefinitionChanged ( const CFunction pFunction)

Trigger a model compile in the case the function is used in the model

References CMathDependencyGraph::appendDirectDependents(), mStructuralDependencies, and setCompileFlag().

◆ getActiveModelParameterSet() [1/2]

CModelParameterSet & CModel::getActiveModelParameterSet ( )

References mParameterSet.

◆ getActiveModelParameterSet() [2/2]

◆ getAreaUnit()

const std::string & CModel::getAreaUnit ( ) const

Get the current area unit of the model

Returns
const CUnit & areaunit

References mAreaUnit.

Referenced by CSBMLExporter::createAreaUnit(), and CCompartment::getUnits().

◆ getAreaUnitName()

std::string CModel::getAreaUnitName ( ) const

Get the unit for areas

Returns
std::string areaUnit

References mAreaUnit.

Referenced by CCopasiXML::saveModel(), and CCopasiXML::saveModelParameterSets().

◆ getAvogadro()

const C_FLOAT64 & CModel::getAvogadro ( ) const

Retrieve the Avogadro number.

References mAvogadro.

Referenced by CCopasiXML::saveModel(), and CCopasiXML::saveModelParameterSets().

◆ getChildObjectUnits()

std::string CModel::getChildObjectUnits ( const CDataObject pObject) const
virtual

Retrieve the units of the child object.

Returns
std::string units

Reimplemented from CModelEntity.

References CModelEntity::getChildObjectUnits(), mpAvogadroReference, mpQuantity2NumberFactorReference, and mQuantityUnit.

◆ getCompartments() [1/2]

CDataVectorNS< CCompartment > & CModel::getCompartments ( )

Return the compartments of this model

Returns
CDataVectorNS < CCompartment > *

References mCompartments.

Referenced by CModelAdd::addCompartments(), CModelAdd::addCompartmentsExpressions(), CModelAdd::addReactions(), CSBMLExporter::checkForInitialAssignments(), CSBMLExporter::checkForPiecewiseFunctions(), CModelAnalyzer::checkReaction(), clearSbmlIds(), CSBMLExporter::collectIds(), CChemEqInterface::completeCompartments(), SBMLImporter::createCCompartmentFromCompartment(), CSBMLExporter::createCompartments(), CModelParameterSet::createFromModel(), CChemEqInterface::createNonExistingMetabs(), CSBMLExporter::createSBMLDocument(), CReactionInterface::createUndoData(), CMathContainer::createValueChangeProhibited(), CODEExporter::exportCompartments(), CODEExporter::exportModelValuesExpressions(), CODEExporterC::exportTitleData(), CModelExpansion::SetOfModelElements::fillComplete(), CDataModel::findObjectByDisplayName(), CReactionInterface::getConcentrationRateUnit(), CMetabNameInterface::getDisplayName(), CObjectLists::getListOfConstObjects(), CMetabNameInterface::getMetabolite(), SEDMLUtils::getObjectForSbmlId(), CExpressionGenerator::getObjectsForSelection(), CReactionInterface::getUnit(), CReactionInterface::getUnitVector(), CSBMLExporter::hasVolumeAssignment(), CLsodaMethod::initializeParameter(), CReactionInterface::isLocked(), CSBMLExporter::isModelSBMLCompatible(), CLNAMethod::isValidProblem(), CMCAMethod::isValidProblem(), CTSSAMethod::isValidProblem(), CModelMerging::mergeMetabolites(), CODEExporter::preprocess(), CODEExporterC::preprocess(), CompartmentHandler::processStart(), removeCompartment(), SBMLImporter::removeUnusedFunctions(), CModelExpansion::replaceInModel(), CCopasiXML::saveModel(), CMetab::setCompartment(), SBMLImporter::setInitialValues(), CTSSAMethod::start(), CReactionInterface::writeBackToReaction(), and CMMLOutput::writeDifferentialEquations().

◆ getCompartments() [2/2]

const CDataVectorNS< CCompartment > & CModel::getCompartments ( ) const

Return the compartments of this model

Returns
const CDataVectorNS < CCompartment > *

References mCompartments.

◆ getCorrespondingTransientObject()

CDataObject * CModel::getCorrespondingTransientObject ( const CDataObject pObject) const

Retrieve the corresponding transient state object of the given object

Parameters
constCDataObject * pObject
Returns
CDataObject * correspondingTransientObject

References CMetab::getConcentrationReference(), CMetab::getInitialConcentrationReference(), CDataObject::getObjectParent(), and CModelEntity::getValueReference().

◆ getEvents() [1/2]

◆ getEvents() [2/2]

const CDataVectorN< CEvent > & CModel::getEvents ( ) const

Return the vector of events

References mEvents.

◆ getInitialTime()

const C_FLOAT64 & CModel::getInitialTime ( ) const

Retrieve the initial time

Returns
const C_FLOAT64 & time

References CModelEntity::mIValue.

Referenced by CModelParameterSet::createFromModel(), CSEDMLExporter::createTimeCourseTask(), and CEvaluationNodeObject::toAST().

◆ getKey()

const std::string & CModel::getKey ( ) const
virtual

Return the key of this model

Returns
string key

Reimplemented from CModelEntity.

References CAnnotation::mKey.

Referenced by ModelHandler::processEnd(), CCopasiXML::saveModel(), CCopasiXML::saveModelParameterSets(), and CModelAdd::simpleCall().

◆ getL()

const CLinkMatrixView & CModel::getL ( ) const

Get the LU decomposition matrix of this model

Returns
const TNT::Matrix < C_FLOAT64 > & LU Get the link matrix L of the relation: Stoi = L * RedStoi
const CLinkMatrixView L

References mLView.

Referenced by CODEExporter::exportMetabolites().

◆ getL0()

const CLinkMatrix & CModel::getL0 ( ) const

Get the relevant portion of the link matrix L.

Returns
const CLinkMatrix & L0

References mL.

Referenced by CLNAMethod::calculateCovarianceMatrixFull(), and CMCAMethod::createLinkMatrix().

◆ getLAnnotation()

const CDataArray * CModel::getLAnnotation ( ) const
Returns
get the annotated link matrix

References mpLinkMatrixAnnotation.

◆ getLengthUnit()

const std::string & CModel::getLengthUnit ( ) const

Get the current length unit of the model

Returns
const CUnit & lengthunit

References mLengthUnit.

Referenced by CSBMLExporter::createLengthUnit(), and CCompartment::getUnits().

◆ getLengthUnitName()

std::string CModel::getLengthUnitName ( ) const

Get the unit for lengths

Returns
std::string lengthUnit

References mLengthUnit.

Referenced by CCopasiXML::saveModel(), and CCopasiXML::saveModelParameterSets().

◆ getMathContainer() [1/2]

CMathContainer & CModel::getMathContainer ( )

Retrieve the container of all mathematical objects

Returns
CMathContainer & mathContainer

References mpMathContainer.

◆ getMathContainer() [2/2]

◆ getMetabolites() [1/2]

CDataVector< CMetab > & CModel::getMetabolites ( )

References mMetabolites.

◆ getMetabolites() [2/2]

◆ getMetabolitesX() [1/2]

CDataVector< CMetab > & CModel::getMetabolitesX ( )

References mMetabolitesX.

◆ getMetabolitesX() [2/2]

◆ getModelParameterSets() [1/2]

CDataVectorN< CModelParameterSet > & CModel::getModelParameterSets ( )

References mParameterSets.

◆ getModelParameterSets() [2/2]

◆ getModelType()

const CModel::ModelType & CModel::getModelType ( ) const

Retrieve the type of the model.

Returns
const ModelType & modelType

References mType.

Referenced by CMathObject::compilePropensity(), CCopasiXML::saveModel(), and CCopasiXML::saveModelParameterSets().

◆ getModelValues() [1/2]

CDataVectorN< CModelValue > & CModel::getModelValues ( )

References mValues.

◆ getModelValues() [2/2]

const CDataVectorN< CModelValue > & CModel::getModelValues ( ) const

Return the non concentration values of this model

Returns
CDataVectorN< CModelValue > & values

References mValues.

Referenced by CModelAdd::addModelValues(), CModelAdd::addModelValuesExpressions(), changeUnitExpressionSymbols(), CSBMLExporter::checkForInitialAssignments(), CSBMLExporter::checkForPiecewiseFunctions(), CModelAnalyzer::checkReaction(), clearSbmlIds(), CSBMLExporter::collectIds(), CReactionInterface::connectNonMetabolites(), SEDMLUtils::createAmountMV(), SBMLImporter::createCModelFromSBMLDocument(), SBMLImporter::createCModelValueFromParameter(), CModelParameterSet::createFromModel(), CSBMLExporter::createParameters(), CSBMLExporter::createSBMLDocument(), CReactionInterface::createUndoData(), CDataModel::exportMathModel(), CDataModel::exportMathModelToString(), CODEExporter::exportModelValues(), CODEExporter::exportModelValuesExpressions(), CODEExporterC::exportTitleData(), CModelExpansion::SetOfModelElements::fillComplete(), CSBMLExporter::findAvogadro(), CDataModel::findObjectByDisplayName(), CObjectLists::getListOfConstObjects(), SEDMLUtils::getObjectForSbmlId(), CExpressionGenerator::getObjectsForSelection(), getQuantityParameterOrValue(), CReactionInterface::getUnit(), getUnitSymbolUsage(), getUsedUnits(), CReactionInterface::isLocked(), CSBMLExporter::isModelSBMLCompatible(), CTSSAMethod::isValidProblem(), CModelMerging::mergeMetabolites(), CODEExporter::preprocess(), CODEExporterC::preprocess(), ModelValueHandler::processStart(), removeModelValue(), SBMLImporter::removeUnusedFunctions(), CModelExpansion::replaceInModel(), CCopasiXML::saveModel(), SBMLImporter::setInitialValues(), CReactionInterface::writeBackToReaction(), and CMMLOutput::writeDifferentialEquations().

◆ getMoieties()

const CDataVector< CMoiety > & CModel::getMoieties ( ) const

Return the mMoieties of this model

Returns
CDataVectorN < CMoiety > &

References mMoieties.

Referenced by CMathContainer::allocate(), CMathContainer::initializeObjects(), and CMoietiesProblem::printResult().

◆ getNumAssignmentMetabs()

size_t CModel::getNumAssignmentMetabs ( ) const

Get the number of metabolites determined by assignments

Returns
size_t dimension

References mNumMetabolitesAssignment.

Referenced by CLNAMethod::isValidProblem(), and CTSSAMethod::isValidProblem().

◆ getNumber2QuantityFactor()

◆ getNumDependentReactionMetabs()

size_t CModel::getNumDependentReactionMetabs ( ) const

Get the number of dependent metabolites determined by reactions

Returns
size_t dimension

References mNumMetabolitesReaction, and mNumMetabolitesReactionIndependent.

Referenced by CMathContainer::allocate(), initializeAtolVector(), CCSPMethod::initializeOutput(), and CCSPMethod::setAnnotationM().

◆ getNumIndependentReactionMetabs()

◆ getNumMetabs()

size_t CModel::getNumMetabs ( ) const

Get the number of total metabolites

Returns
C_INT32 totMetab

References mMetabolitesX, and CDataVector< CType >::size().

Referenced by CMathContainer::allocate(), and CODEExporter::exportModelValuesExpressions().

◆ getNumModelValues()

size_t CModel::getNumModelValues ( ) const

Get the number of non concentration values

Returns
C_INT32

References mValues, and CDataVector< CType >::size().

Referenced by CODEExporter::exportModelValuesExpressions().

◆ getNumODEMetabs()

◆ getNumVariableMetabs()

size_t CModel::getNumVariableMetabs ( ) const

Get the number of variable metabolites

Returns
size_t totMetab

References mNumMetabolitesAssignment, mNumMetabolitesODE, and mNumMetabolitesReaction.

◆ getParticleFlux()

const CVector< C_FLOAT64 > & CModel::getParticleFlux ( ) const

Retrieve the vector of particle fluxes from the model

Returns
const CVector< C_FLOAT64 > & particleFlux

References mParticleFluxes.

◆ getQuantity2NumberFactor()

◆ getQuantityUnit()

◆ getQuantityUnitName()

std::string CModel::getQuantityUnitName ( ) const

Get the unit for quantities

Returns
std::string quantityUnit

References mQuantityUnit.

Referenced by CCopasiXML::saveModel(), and CCopasiXML::saveModelParameterSets().

◆ getReactions() [1/2]

CDataVectorNS< CReaction > & CModel::getReactions ( )

Return the vector of reactions

Returns
CDataVectorNS <CReaction> & reactions

References mSteps.

Referenced by CModelAdd::addReactions(), CMathContainer::allocate(), CSBMLExporter::assignSBMLIdsToReactions(), CBitPatternMethod::buildKernelMatrix(), CBitPatternTreeMethod::buildKernelMatrix(), CSBMLExporter::checkForPiecewiseFunctions(), CFixLocalReactionParameters::checkModel(), CHybridMethod::checkModel(), CHybridMethodODE45::checkModel(), CModelAnalyzer::checkModel(), clearSbmlIds(), CSBMLExporter::collectIds(), CMathContainer::compile(), convert2NonReversible(), SBMLImporter::createCModelFromSBMLDocument(), SBMLImporter::createCReactionFromReaction(), CModelParameterSet::createFromModel(), CSBMLExporter::createReactions(), CSBMLExporter::createSBMLDocument(), CCSPMethod::CSPOutput(), CODEExporter::exportExpression(), CODEExporterC::exportKineticFunctionGroup(), CODEExporter::exportReacParamsAndFuncs(), CODEExporterC::exportTitleData(), CModelExpansion::SetOfModelElements::fillComplete(), CDataModel::findObjectByDisplayName(), CCopasiXML::fixBuild113(), CObjectLists::getListOfConstObjects(), SEDMLUtils::getObjectForSbmlId(), CExpressionGenerator::getObjectsForSelection(), CEFMAlgorithm::initialize(), CSSAMethod::initialize(), CMathContainer::initializeObjects(), CCSPMethod::initializeOutput(), CEFMMethod::isValidProblem(), CLNAMethod::isValidProblem(), CMMLOutput::listReactionsForMetab(), CModelMerging::mergeMetabolites(), CODEExporter::preprocess(), CODEExporterC::preprocess(), CCSPMethod::printResult(), CILDMMethod::printResult(), ReactionHandler::processStart(), removeReaction(), SBMLImporter::removeUnusedFunctions(), CModelExpansion::replaceInModel(), CMCAMethod::resizeAllMatrices(), CCopasiXML::saveModel(), CCSPMethod::setAnnotationM(), CILDMMethod::setAnnotationM(), CLLayoutRenderer::setDeduceSpeciesReferenceRoles(), and CLLayoutRenderer::update_associations().

◆ getReactions() [2/2]

const CDataVectorNS< CReaction > & CModel::getReactions ( ) const

Return the vector of reactions

Returns
const CDataVectorS <CReaction> & reactions

References mSteps.

◆ getReactionsPerSpecies()

const std::set< std::pair< const CReaction *, C_FLOAT64 > > & CModel::getReactionsPerSpecies ( const CMetab pSpecies) const

Return the vector of reaction indices for a species

Returns
const std::vector <size_t> mReactionsPerSpecies

References mReactionsPerSpecies.

Referenced by CMathObject::compileTransitionTime(), CMathObject::createExtensiveReactionNoiseExpression(), and CMathObject::createExtensiveReactionRateExpression().

◆ getRedStoi()

◆ getRedStoiAnnotation()

const CDataArray * CModel::getRedStoiAnnotation ( ) const
Returns
Get the matrix annotation to the reduced stoichiometry matrix.

References mpRedStoiAnnotation.

◆ getStateTemplate()

◆ getStoi()

const CMatrix< C_FLOAT64 > & CModel::getStoi ( ) const

Get the stoichiometry matrix of this model

Get the reordered stoichiometry matrix of this model

References mStoi.

Referenced by CHybridMethod::checkModel(), CHybridMethodODE45::checkModel(), CMCAMethod::createLinkMatrix(), CMathContainer::getStoichiometry(), and CEFMAlgorithm::initialize().

◆ getStoiAnnotation()

const CDataArray * CModel::getStoiAnnotation ( ) const
Returns
Get the matrix annotation to the stoichiometry matrix.

References mpStoiAnnotation.

◆ getTime()

const C_FLOAT64 & CModel::getTime ( ) const

Retrieve the actual model time

Returns
const C_FLOAT64 & time

References CModelEntity::mValue.

Referenced by CExperiment::calculateStatistics().

◆ getTimeUnit()

◆ getTimeUnitName()

std::string CModel::getTimeUnitName ( ) const

◆ getTotSteps()

size_t CModel::getTotSteps ( ) const

Get the total steps

Returns
size_t total steps;

References mSteps, and CDataVector< CType >::size().

Referenced by CModelAnalyzer::checkModel().

◆ getTreesWithDiscontinuities()

std::vector< const CEvaluationTree * > CModel::getTreesWithDiscontinuities ( ) const

generates a string that contains a text description of all model parameters (initial values and reaction parameters) List all trees which introduce discrete changes.

Returns
std::vector< const CEvaluationTree * > treesWithDiscontinuities

References CVectorCore< CType >::array(), CModelEntity::ASSIGNMENT, CDataVector< CType >::begin(), CDataVector< CType >::end(), CStateTemplate::getEntities(), mEvents, mStateTemplate, mSteps, CModelEntity::ODE, and CStateTemplate::size().

Referenced by CMathContainer::createDiscontinuityEvents().

◆ getUnits()

const std::string CModel::getUnits ( ) const
virtual

Retrieve the units of the object.

Returns
std::string units

Reimplemented from CDataContainer.

References mTimeUnit.

Referenced by CReactionInterface::getUnit().

◆ getUnitSymbolUsage()

◆ getUsedUnits()

std::map< std::string, CUnit > CModel::getUsedUnits ( ) const

◆ getVolumeUnit()

const std::string & CModel::getVolumeUnit ( ) const

◆ getVolumeUnitName()

std::string CModel::getVolumeUnitName ( ) const

Get the unit for volumes

Returns
std::string volumeUnit

References mVolumeUnit.

Referenced by CCopasiXML::saveModel(), and CCopasiXML::saveModelParameterSets().

◆ handleUnusedMetabolites()

bool CModel::handleUnusedMetabolites ( )
private

Handles unused metabolites and moves them to the end of mMetabolites. Rows of the stoichiometry matrix dealing with unused metabolites are removed.

Returns
bool found

References CMatrix< CType >::array(), CDataVector< CType >::begin(), C_FLOAT64, min, mMetabolitesX, mNumMetabolitesAssignment, mNumMetabolitesODE, mNumMetabolitesReaction, mNumMetabolitesUnused, mStoi, CMatrix< CType >::numCols(), and CMatrix< CType >::numRows().

Referenced by buildStoi().

◆ hasReversibleReaction()

bool CModel::hasReversibleReaction ( ) const

Check whether the model contains reversible reactions

Returns
bool hasReversibleReaction

References mSteps, and CDataVector< CType >::size().

◆ initializeAtolVector()

CVector< C_FLOAT64 > CModel::initializeAtolVector ( const C_FLOAT64 baseTolerance,
const bool &  reducedModel 
) const

◆ initializeMetabolites()

◆ initObjects()

◆ isAutonomous()

const bool & CModel::isAutonomous ( ) const

Check whether the model is autonomous

Returns
const bool &isAutonomous

References mIsAutonomous.

◆ isCompileNecessary()

const bool & CModel::isCompileNecessary ( ) const

Check whether a model compile is necessary.

Returns
const bool & isCompileNecessary

References mCompileIsNecessary.

◆ isStateVariable()

bool CModel::isStateVariable ( const CDataObject pObject) const

Check whether the given object is a part of state variable

Parameters
constCDataObject * pObject
Returns
bool isStateVariable

References CStateTemplate::beginIndependent(), CStateTemplate::endDependent(), CObjectLists::getEventTargets(), CDataObject::getObjectParent(), and mStateTemplate.

◆ load()

◆ operator=()

CModel& CModel::operator= ( const CModel src)
private

◆ prepareElasticity()

◆ refreshActiveParameterSet()

void CModel::refreshActiveParameterSet ( )

refresh the active parameter set from the model initial values

References mParameterSet, and CModelParameterSet::refreshFromModel().

Referenced by stateToIntialState(), and updateInitialValues().

◆ removeCompartment() [1/3]

bool CModel::removeCompartment ( const CCompartment pCompartment,
const bool &  recursive = true 
)

◆ removeCompartment() [2/3]

bool CModel::removeCompartment ( const size_t  index,
const bool &  recursive = true 
)

Remove a Compartment from the model

References getCompartments().

Referenced by removeCompartment(), removeDependentModelObjects(), and CModelExpansion::replaceInModel().

◆ removeCompartment() [3/3]

bool CModel::removeCompartment ( const std::string &  key,
const bool &  recursive = true 
)

Remove a Compartment from the model

References CKeyFactory::get(), CRootContainer::getKeyFactory(), and removeCompartment().

◆ removeDataObject()

void CModel::removeDataObject ( const CDataObject pObject)
private

◆ removeDependentModelObjects()

void CModel::removeDependentModelObjects ( const ObjectSet deletedObjects,
const bool &  onlyStructural = false 
)

Remove all model objects which depend on the deleted objects

Parameters
constCDataObject::ObjectSet & deletedObjects
constbool & onlyStructural (default: false)

References appendAllDependents(), removeCompartment(), removeDataObject(), removeEvent(), removeMetabolite(), removeModelValue(), and removeReaction().

Referenced by removeCompartment(), removeFunction(), removeLocalReactionParameter(), removeMetabolite(), removeModelValue(), and removeReaction().

◆ removeEvent() [1/3]

bool CModel::removeEvent ( const CEvent pEvent,
const bool &  recursive = true 
)

Remove an event from the model

Parameters
constCEvent * pEvent
constbool & recursive (default: true)
Returns
bool success

References C_INVALID_INDEX, clearMoieties(), mCompileIsNecessary, mEvents, and removeDataObject().

◆ removeEvent() [2/3]

bool CModel::removeEvent ( const size_t  index,
const bool &  recursive = true 
)

Remove an event from the model

Parameters
constsize_t index
constbool & recursive (default: true)
Returns
bool success

References mEvents.

Referenced by removeDependentModelObjects(), removeEvent(), and CModelExpansion::replaceInModel().

◆ removeEvent() [3/3]

bool CModel::removeEvent ( const std::string &  key,
const bool &  recursive = true 
)

Remove an event from the model

Parameters
conststd::string & key
constbool & recursive (default: true)
Returns
bool success

References CKeyFactory::get(), CRootContainer::getKeyFactory(), and removeEvent().

◆ removeFunction()

bool CModel::removeFunction ( const CFunction pFunction,
const bool &  recursive = true 
)

◆ removeLocalReactionParameter()

bool CModel::removeLocalReactionParameter ( const std::string &  key,
const bool &  recursive = true 
)

Remove a local reaction parameter from the model

References CKeyFactory::get(), CRootContainer::getKeyFactory(), CDataContainer::insert(), and removeDependentModelObjects().

◆ removeMetabolite() [1/3]

◆ removeMetabolite() [2/3]

bool CModel::removeMetabolite ( const size_t  index,
const bool &  recursive = true 
)

◆ removeMetabolite() [3/3]

bool CModel::removeMetabolite ( const std::string &  key,
const bool &  recursive = true 
)

◆ removeModelEntity()

void CModel::removeModelEntity ( const CModelEntity pModelEntity)

Remove a model entity to the model

Parameters
constCModelEntity * pModelEntity

References mStateTemplate, and CStateTemplate::remove().

Referenced by CModelEntity::setObjectParent(), and CModelEntity::~CModelEntity().

◆ removeModelValue() [1/3]

◆ removeModelValue() [2/3]

bool CModel::removeModelValue ( const size_t  index,
const bool &  recursive = true 
)

◆ removeModelValue() [3/3]

bool CModel::removeModelValue ( const std::string &  key,
const bool &  recursive = true 
)

◆ removeReaction() [1/3]

bool CModel::removeReaction ( const CReaction pReaction,
const bool &  recursive = true 
)

◆ removeReaction() [2/3]

bool CModel::removeReaction ( const size_t  index,
const bool &  recursive = true 
)

Remove a reaction from the model using its index

References getReactions(), and removeReaction().

◆ removeReaction() [3/3]

bool CModel::removeReaction ( const std::string &  key,
const bool &  recursive = true 
)

Remove a reaction from the model using its key

References CKeyFactory::get(), CRootContainer::getKeyFactory(), and removeReaction().

◆ replaceInExpressions()

void CModel::replaceInExpressions ( const std::string &  oldStr,
const std::string &  newStr 
)
private

Replace the old string with the new string in all expressions in the model

Parameters
conststd::string & oldStr
conststd::string & newStr

References CDataVector< CType >::begin(), CDataVector< CType >::end(), mCompartments, mEvents, mMetabolitesX, mValues, and stringReplace().

Referenced by convert2NonReversible().

◆ setAreaUnit()

bool CModel::setAreaUnit ( const std::string &  name)

◆ setAvogadro()

void CModel::setAvogadro ( const C_FLOAT64 avogadro,
const CCore::Framework frameWork 
)

Set the Avogadro number used for the model.

Parameters
constC_FLOAT64 & avogadro

References mAvogadro, mQuantityUnit, and setQuantityUnit().

Referenced by applyData(), SBMLUnitSupport::importUnitsFromSBMLDocument(), and ModelHandler::processStart().

◆ setCompileFlag()

void CModel::setCompileFlag ( bool  flag = true)

This must be called whenever something is changed in the model that would make it necessary to recalculate the matrix decomposition

References mCompileIsNecessary.

Referenced by CStateTemplate::add(), CReaction::addParameterObject(), CEventAssignment::applyData(), CEvent::applyData(), CReaction::applyData(), CModelEntity::applyData(), CEventAssignment::CEventAssignment(), convert2NonReversible(), forceCompile(), functionDefinitionChanged(), CEvent::initObjects(), load(), ModelHandler::processEnd(), CStateTemplate::remove(), CDataModel::reparameterizeFromIniFile(), CModelExpansion::replaceInMetab(), CMetab::setCompartment(), CEvent::setDelayAssignment(), CEvent::setDelayExpression(), CEvent::setDelayExpressionPtr(), CEventAssignment::setExpression(), CModelEntity::setExpression(), CEventAssignment::setExpressionPtr(), CModelEntity::setExpressionPtr(), CEvent::setFireAtInitialTime(), CModelEntity::setHasNoise(), CReaction::setHasNoise(), CModelEntity::setInitialExpression(), CModelEntity::setInitialExpressionPtr(), CModelEntity::setNoiseExpression(), CReaction::setNoiseExpression(), CModelEntity::setNoiseExpressionPtr(), CReaction::setNoiseExpressionPtr(), CEventAssignment::setObjectParent(), CEvent::setObjectParent(), CReaction::setParameterObjects(), CEvent::setPersistentTrigger(), CEvent::setPriorityExpression(), CEvent::setPriorityExpressionPtr(), CModelEntity::setStatus(), CEventAssignment::setTargetCN(), CEvent::setTriggerExpression(), CEvent::setTriggerExpressionPtr(), CEvent::~CEvent(), CEventAssignment::~CEventAssignment(), and CReaction::~CReaction().

◆ setInitialTime()

void CModel::setInitialTime ( const C_FLOAT64 time)

Return a pointer to the current time Set the start time for modeling

Parameters
constC_FLOAT64 & time

References CModelEntity::mIValue, and time.

Referenced by SEDMLImporter::updateCopasiTaskForSimulation().

◆ setLengthUnit()

bool CModel::setLengthUnit ( const std::string &  name)

◆ setModelType()

void CModel::setModelType ( const ModelType modelType)

Get the unit for quantities

Returns
CModel::QuantityUnit quantityUnit Set the type of the model
Parameters
constModelType & modelType

References mType.

Referenced by applyData(), SBMLImporter::createCModelFromSBMLDocument(), and ModelHandler::processStart().

◆ setObjectParent()

bool CModel::setObjectParent ( const CDataContainer pParent)
virtual

Set the object parent

Parameters
constCDataContainer * pParent
Returns
bool success

Reimplemented from CModelEntity.

References CDataObject::setObjectParent().

Referenced by CDataModel::commonAfterLoad().

◆ setQuantityUnit()

bool CModel::setQuantityUnit ( const std::string &  name,
const CCore::Framework frameWork 
)

◆ setTime()

void CModel::setTime ( const C_FLOAT64 time)

Set the actual model time

Parameters
constC_FLOAT64 & time

References CModelEntity::mValue, and time.

◆ setTimeUnit()

bool CModel::setTimeUnit ( const std::string &  name)

Set the unit for time. If COPASI recognizes the unit the conversion factors are set accordingly and true is returned.

Parameters
conststd::string & name
Returns
bool success

References mTimeUnit, and CUnit::prettyPrint().

Referenced by applyData(), SBMLUnitSupport::checkElementUnits(), SBMLImporter::createCModelFromSBMLDocument(), CCopasiXML::fixBuildBefore104(), SBMLUnitSupport::importUnitsFromSBMLDocument(), load(), and ModelHandler::processStart().

◆ setVolumeUnit()

bool CModel::setVolumeUnit ( const std::string &  name)

Set the unit for volumes. If COPASI recognizes the unit the conversion factors are set accordingly and true is returned.

Parameters
conststd::string & name
Returns
bool success

References mVolumeUnit, and CUnit::prettyPrint().

Referenced by applyData(), SBMLUnitSupport::checkElementUnits(), SBMLImporter::createCModelFromSBMLDocument(), SBMLUnitSupport::importUnitsFromSBMLDocument(), load(), and ModelHandler::processStart().

◆ stateToIntialState()

◆ suitableForStochasticSimulation()

◆ toData()

◆ updateInitialValues() [1/3]

◆ updateInitialValues() [2/3]

void CModel::updateInitialValues ( const CDataObject changedObject)

Builds and executes the the update sequence used to calculate all initial values depending on the changed objects For metabolites the initial particle number is updated by default unless itself is in the list of changed objects. In that case the initial concentration is updated.

Parameters
std::set<const CDataObject * > & changedObjects
See also
updateInitialValues(std::set< const CDataObject * > & changedObjects)

References updateInitialValues().

◆ updateInitialValues() [3/3]

void CModel::updateInitialValues ( std::set< const CDataObject * > &  changedObjects)

Builds and executes the the update sequence used to calculate all initial values depending on the changed objects. For metabolites the initial particle number is updated by default unless itself is in the list of changed objects. In that case the initial concentration is updated.

Parameters
std::set<const CDataObject * > & changedObjects
See also
buildInitialRefreshSequence(std::set< const CDataObject * > & changedObjects)

References CMathContainer::applyUpdateSequence(), buildInitialRefreshSequence(), compileIfNecessary(), CMathContainer::fetchInitialState(), mpMathContainer, CMathContainer::pushInitialState(), and refreshActiveParameterSet().

◆ updateMatrixAnnotations()

◆ updateMoietyValues()

void CModel::updateMoietyValues ( )
private

compute the actual initial value of all moieties (from the initial values of the metabolites).

References CDataVector< CType >::begin(), CDataVector< CType >::end(), and mMoieties.

Referenced by buildMoieties().

Friends And Related Function Documentation

◆ CFunctionDB

friend class CFunctionDB
friend

Member Data Documentation

◆ mActiveParameterSetKey

std::string CModel::mActiveParameterSetKey
private

The key of the currently active parameter set.

Referenced by applyActiveParameterSet().

◆ mAreaUnit

std::string CModel::mAreaUnit
private

◆ mAvogadro

C_FLOAT64 CModel::mAvogadro
private

The Avogadro number used for this model.

Referenced by createUndoData(), getAvogadro(), setAvogadro(), setQuantityUnit(), and toData().

◆ mBuildInitialSequence

bool CModel::mBuildInitialSequence
private

A Boolean value indicating whether we need to rebuild the initial value refresh sequence

◆ mCompartments

◆ mCompileIsNecessary

bool CModel::mCompileIsNecessary
private

◆ mElasticities

CMatrix< C_FLOAT64 > CModel::mElasticities
private

The elasticity matrix d(Flux_i)/dx_j

◆ mEvents

◆ mIsAutonomous

bool CModel::mIsAutonomous
private

A flag indicating whether the model is autonomous.

Referenced by compile(), and isAutonomous().

◆ mJacobianPivot

CVector< size_t > CModel::mJacobianPivot
private

Vector for storing the row interchanges during LU-Decomposition Vector for storing the row and column interchanges needed to calculate the full Jacobian in user order.

Referenced by buildUserOrder().

◆ mL

CLinkMatrix CModel::mL
private

This matrix stores L

Referenced by buildLinkZero(), buildMoieties(), buildRedStoi(), compile(), and getL0().

◆ mLengthUnit

std::string CModel::mLengthUnit
private

◆ mLView

CLinkMatrixView CModel::mLView
private

This is used to return a view to L

Referenced by getL(), and initObjects().

◆ mMetabolites

◆ mMetabolitesX

◆ mMoieties

CDataVector< CMoiety > CModel::mMoieties
private

for array of conserved moieties

Referenced by buildMoieties(), clearMoieties(), findMoiety(), getMoieties(), and updateMoietyValues().

◆ mNumber2QuantityFactor

C_FLOAT64 CModel::mNumber2QuantityFactor
private

Factor to convert from particle number to quantity taking into account the unit for substance quantities

Referenced by getNumber2QuantityFactor(), and setQuantityUnit().

◆ mNumMetabolitesAssignment

size_t CModel::mNumMetabolitesAssignment
private

The number of metabs determined by assignments in the model

Referenced by getNumAssignmentMetabs(), getNumVariableMetabs(), handleUnusedMetabolites(), and initializeMetabolites().

◆ mNumMetabolitesODE

size_t CModel::mNumMetabolitesODE
private

◆ mNumMetabolitesReaction

size_t CModel::mNumMetabolitesReaction
private

The number of metabs determined by reactions in the model

Referenced by buildRedStoi(), buildStoi(), getNumDependentReactionMetabs(), getNumVariableMetabs(), handleUnusedMetabolites(), and initializeMetabolites().

◆ mNumMetabolitesReactionIndependent

size_t CModel::mNumMetabolitesReactionIndependent
private

The number of metabs determined by reactions which can be calculated through moieties

Referenced by buildLinkZero(), buildMoieties(), buildRedStoi(), getNumDependentReactionMetabs(), getNumIndependentReactionMetabs(), and updateMatrixAnnotations().

◆ mNumMetabolitesUnused

size_t CModel::mNumMetabolitesUnused
private

The number of unused metabs in the model

Referenced by handleUnusedMetabolites(), and initializeMetabolites().

◆ ModelTypeNames

const CEnumAnnotation< std::string, CModel::ModelType > CModel::ModelTypeNames
static

◆ mParameterSet

CModelParameterSet CModel::mParameterSet
private

The parameter set of the model itself

Referenced by applyActiveParameterSet(), compile(), getActiveModelParameterSet(), and refreshActiveParameterSet().

◆ mParameterSets

CDataVectorN< CModelParameterSet > CModel::mParameterSets
private

Vector of parameter sets

Referenced by getModelParameterSets().

◆ mParticleFluxes

CVector< C_FLOAT64 > CModel::mParticleFluxes
private

Vectors of fluxes of the reactions.

Referenced by buildStoi(), and getParticleFlux().

◆ mpAvogadroReference

CDataObject* CModel::mpAvogadroReference
private

Referenced by getChildObjectUnits().

◆ mpLinkMatrixAnnotation

CDataArray* CModel::mpLinkMatrixAnnotation
private

Column and Row Annotation for the Link Matrix

Referenced by getLAnnotation(), initObjects(), updateMatrixAnnotations(), and ~CModel().

◆ mpMathContainer

◆ mpProcessReport

CProcessReport* CModel::mpProcessReport
private

A pointer to the process report. If not NULL the compile progress is reported to it.

Referenced by buildStoi(), compile(), and compileIfNecessary().

◆ mpQuantity2NumberFactorReference

CDataObject* CModel::mpQuantity2NumberFactorReference
private

Referenced by getChildObjectUnits().

◆ mpRedStoiAnnotation

CDataArray* CModel::mpRedStoiAnnotation
private

Column and Row Annotation for the reduced Stoichiometry Matrix

Referenced by getRedStoiAnnotation(), initObjects(), updateMatrixAnnotations(), and ~CModel().

◆ mpStoiAnnotation

CDataArray* CModel::mpStoiAnnotation
private

Column and Row Annotation for the reduced Stoichiometry Matrix

Referenced by getStoiAnnotation(), initObjects(), updateMatrixAnnotations(), and ~CModel().

◆ mQuantity2NumberFactor

C_FLOAT64 CModel::mQuantity2NumberFactor
private

Factor to convert from quantity to particle number taking into account the unit for substance quantities

Referenced by getQuantity2NumberFactor(), initializeAtolVector(), and setQuantityUnit().

◆ mQuantityUnit

◆ mReactionsPerSpecies

std::map< const CMetab *, std::set< std::pair< const CReaction *, C_FLOAT64 > > > CModel::mReactionsPerSpecies
private

Vector of species that contains associated reactions

Referenced by buildStoi(), and getReactionsPerSpecies().

◆ mRedStoi

CMatrix< C_FLOAT64 > CModel::mRedStoi
private

Reduced Stoichiometry Matrix

Referenced by buildRedStoi(), getRedStoi(), and initObjects().

◆ mReorderNeeded

bool CModel::mReorderNeeded
private

A flag indicating whether the state template has to be reordered

Referenced by buildStateTemplate().

◆ mStateTemplate

◆ mSteps

◆ mStoi

◆ mStructuralDependencies

CMathDependencyGraph CModel::mStructuralDependencies
private

◆ mTimeUnit

std::string CModel::mTimeUnit
private

◆ mType

ModelType CModel::mType
private

The type of the model

Referenced by getModelType(), setModelType(), and toData().

◆ mValues

◆ mVolumeUnit

std::string CModel::mVolumeUnit
private

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