COPASI API  4.40.278
CReaction Class Reference

#include <CReaction.h>

Inheritance diagram for CReaction:
[legend]

Public Types

enum class  KineticLawUnit { Default , AmountPerTime , ConcentrationPerTime , __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

bool addModifier (const std::string &metabKey, const C_FLOAT64 &multiplicity=1.0)
 
bool addParameterObject (const size_t &index, const CDataObject *object)
 
bool addParameterObject (const std::string &name, const CDataObject *object)
 
bool addProduct (const std::string &metabKey, const C_FLOAT64 &multiplicity=1.0)
 
bool addSubstrate (const std::string &metabKey, const C_FLOAT64 &multiplicity=1.0)
 
virtual bool applyData (const CData &data, CUndoData::CChangeSet &changes)
 
CIssue compile ()
 
 CReaction (const CReaction &src, const CDataContainer *pParent)
 
 CReaction (const std::string &name="NoName", const CDataContainer *pParent=NO_PARENT)
 
CFunctioncreateFunctionFromExpression (const std::string &infix)
 
virtual void createUndoData (CUndoData &undoData, const CUndoData::Type &type, const CData &oldData=CData(), const CCore::Framework &framework=CCore::Framework::ParticleNumbers) const
 
const CCallParameters< C_FLOAT64 > & getCallParameters () const
 
CChemEqgetChemEq ()
 
const CChemEqgetChemEq () const
 
virtual std::string getChildObjectUnits (const CDataObject *pObject) const
 
size_t getCompartmentNumber () const
 
std::string getDefaultNoiseExpression () const
 
KineticLawUnit getEffectiveKineticLawUnitType () const
 
CEvaluationNodegetExpressionTree ()
 
const C_FLOAT64getFlux () const
 
CDataObjectgetFluxReference ()
 
const CDataObjectgetFluxReference () const
 
const CFunctiongetFunction () const
 
const CFunctionParametersgetFunctionParameters () const
 
virtual const std::string & getKey () const
 
std::string getKineticLawUnit () const
 
const KineticLawUnitgetKineticLawUnitType () const
 
const CCompartmentgetLargestCompartment () const
 
const CFunctionParameterMapgetMap () const
 
std::string getNoiseExpression () const
 
CExpressiongetNoiseExpressionPtr ()
 
const CExpressiongetNoiseExpressionPtr () const
 
const CDataObjectgetNoiseReference () const
 
virtual const CObjectInterfacegetObject (const CCommonName &cn) const
 
virtual std::string getObjectDisplayName () const
 
const std::vector< std::vector< CRegisteredCommonName > > & getParameterCNs () const
 
const std::vector< CRegisteredCommonName > & getParameterCNs (const size_t &index) const
 
const std::vector< CRegisteredCommonName > & getParameterCNs (const std::string &name) const
 
size_t getParameterIndex (const std::string &parameterName, const CFunctionParameter **ppFunctionParameter=NULL) const
 
const std::vector< std::vector< const CDataObject * > > & getParameterObjects () const
 
const std::vector< const CDataObject * > & getParameterObjects (const size_t &index) const
 
const std::vector< const CDataObject * > & getParameterObjects (const std::string &name) const
 
CCopasiParameterGroupgetParameters ()
 
const CCopasiParameterGroupgetParameters () const
 
const C_FLOAT64getParameterValue (const std::string &parameterName) const
 
const C_FLOAT64getParticleFlux () const
 
CDataObjectgetParticleFluxReference ()
 
const CDataObjectgetParticleFluxReference () const
 
const CDataObjectgetParticleNoiseReference () const
 
CDataObjectgetPropensityReference ()
 
const CDataObjectgetPropensityReference () const
 
std::string getReactionScheme () const
 
const std::string & getSBMLId () const
 
const CCompartmentgetScalingCompartment () const
 
const CCommonNamegetScalingCompartmentCN () const
 
const bool & hasNoise () const
 
const bool & isFast () const
 
bool isLocalParameter (const size_t &index) const
 
bool isLocalParameter (const std::string &parameterName) const
 
bool isReversible () const
 
C_INT32 load (CReadConfig &configbuffer)
 
void printDebug () const
 
void setFast (const bool &fast)
 
bool setFunction (CFunction *pFunction)
 
bool setFunction (const std::string &functionName)
 
CFunctionsetFunctionFromExpressionTree (const CExpression &tree, std::map< const CDataObject *, SBase * > &copasi2sbmlmap)
 
void setHasNoise (const bool &hasNoise)
 
void setKineticLawUnitType (const KineticLawUnit &kineticLawUnitType)
 
bool setNoiseExpression (const std::string &expression)
 
bool setNoiseExpressionPtr (CExpression *pExpression)
 
virtual bool setObjectParent (const CDataContainer *pParent)
 
bool setParameterCNs (const size_t &index, const std::vector< CRegisteredCommonName > &CNs)
 
bool setParameterCNs (const std::string &name, const std::vector< CRegisteredCommonName > &CNs)
 
bool setParameterObject (const size_t &index, const CDataObject *object)
 
bool setParameterObject (const std::string &name, const CDataObject *object)
 
bool setParameterObjects (const size_t &index, const std::vector< const CDataObject * > &objects)
 
bool setParameterObjects (const std::string &name, const std::vector< const CDataObject * > &objects)
 
void setParameterValue (const std::string &parameterName, const C_FLOAT64 &value)
 
bool setReactionScheme (const std::string &scheme, const std::string &newFunction="", bool createMetabolites=true, bool createOther=true)
 
void setReversible (bool reversible)
 
void setSBMLId (const std::string &id) const
 
void setScalingCompartment (const CCompartment *pCompartment)
 
void setScalingCompartmentCN (const std::string &compartmentCN)
 
virtual CData toData () const
 
virtual ~CReaction ()
 
- 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 objectMapgetObjects ()
 
virtual const objectMapgetObjects () const
 
virtual const std::string getUnits () const override
 
virtual const CDataObjectgetValueObject () const override
 
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
 
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
 
virtual void * getValuePointer () 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 CReactionfromData (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 CEnumAnnotation< std::string, KineticLawUnitKineticLawUnitTypeName
 
- Static Public Attributes inherited from CDataContainer
static const CObjectInterface::ContainerList EmptyList
 

Private Member Functions

void calculate ()
 
CIssue compileFunctionParameters (std::set< const CDataObject * > &Dependencies)
 
std::string escapeId (const std::string &id)
 
const CModelgetFirstCModelOrDefault (std::map< const CDataObject *, SBase * > &copasi2sbmlmap)
 
void initializeParameterMapping ()
 
void initializeParameters ()
 
void initObjects ()
 
C_INT32 loadOld (CReadConfig &configbuffer)
 
bool loadOneRole (CReadConfig &configbuffer, CFunctionParameter::Role role, C_INT32 n, const std::string &prefix)
 
CEvaluationNodeVariableobject2variable (const CEvaluationNodeObject *objectNode, std::map< std::string, std::pair< CDataObject *, CFunctionParameter * > > &replacementMap, std::map< const CDataObject *, SBase * > &copasi2sbmlmap)
 
CEvaluationNodeobjects2variables (const CEvaluationNode *expression, std::map< std::string, std::pair< CDataObject *, CFunctionParameter * > > &replacementMap, std::map< const CDataObject *, SBase * > &copasi2sbmlmap)
 
CReactionoperator= (const CReaction &)
 
CDataObjectresolveCN (const CModel *pModel, CCommonName cn)
 
void setScalingFactor ()
 
CEvaluationNodeObjectvariable2object (CEvaluationNodeVariable *pVariableNode)
 
CEvaluationNodevariables2objects (CEvaluationNode *expression)
 

Static Private Member Functions

static std::string sanitizeSBMLId (const std::string &id)
 

Private Attributes

CChemEq mChemEq
 
bool mFast
 
C_FLOAT64 mFlux
 
bool mHasNoise
 
KineticLawUnit mKineticLawUnit
 
CFunctionParameterMap mMap
 
C_FLOAT64 mNoise
 
std::vector< std::vector< CRegisteredCommonName > > mParameterIndexToCNs
 
std::vector< std::vector< const CDataObject * > > mParameterIndexToObjects
 
std::map< std::string, size_t > mParameterNameToIndex
 
CCopasiParameterGroup mParameters
 
C_FLOAT64 mParticleFlux
 
C_FLOAT64 mParticleNoise
 
CDataObjectReference< C_FLOAT64 > * mpFluxReference
 
CFunctionmpFunction
 
CExpressionmpNoiseExpression
 
CDataObjectReference< C_FLOAT64 > * mpNoiseReference
 
CDataObjectReference< C_FLOAT64 > * mpParticleFluxReference
 
CDataObjectReference< C_FLOAT64 > * mpParticleNoiseReference
 
CDataObjectReference< C_FLOAT64 > * mpPropensityReference
 
C_FLOAT64 mPropensity
 
const CCompartmentmpScalingCompartment
 
std::string mSBMLId
 
CRegisteredCommonName mScalingCompartmentCN
 

Friends

std::ostream & operator<< (std::ostream &os, const CReaction &d)
 

Additional Inherited Members

- 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 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

◆ KineticLawUnit

Enumerator
Default 
AmountPerTime 
ConcentrationPerTime 
__SIZE 

Constructor & Destructor Documentation

◆ CReaction() [1/2]

CReaction::CReaction ( const std::string &  name = "NoName",
const CDataContainer pParent = NO_PARENT 
)

Default constructor

Parameters
conststd::string & name (default: "NoName")
constCDataContainer * pParent (default: NULL)

References CKeyFactory::add(), CONSTRUCTOR_TRACE, CRootContainer::getKeyFactory(), CDataObject::getObjectType(), CRootContainer::getUndefinedFunction(), CAnnotation::initMiriamAnnotation(), initObjects(), CAnnotation::mKey, and setFunction().

Referenced by fromData().

◆ CReaction() [2/2]

◆ ~CReaction()

Member Function Documentation

◆ addModifier()

bool CReaction::addModifier ( const std::string &  metabKey,
const C_FLOAT64 multiplicity = 1.0 
)

Add a modifier to the reaction

Parameters
std::string& metabKey
constC_FLOAT64 & multiplicity (Default 1.0)
Returns
bool success

References CChemEq::addMetabolite(), mChemEq, and CChemEq::MODIFIER.

Referenced by CModelAdd::addReactions(), CModel::convert2NonReversible(), SBMLImporter::createCReactionFromReaction(), CModelExpansion::duplicateReaction(), and ModifierHandler::processStart().

◆ addParameterObject() [1/2]

bool CReaction::addParameterObject ( const size_t &  index,
const CDataObject object 
)

◆ addParameterObject() [2/2]

bool CReaction::addParameterObject ( const std::string &  name,
const CDataObject object 
)

◆ addProduct()

bool CReaction::addProduct ( const std::string &  metabKey,
const C_FLOAT64 multiplicity = 1.0 
)

Add a product to the reaction

Parameters
std::string& metabKey
constC_FLOAT64 & multiplicity (Default 1.0)
Returns
bool success

References CChemEq::addMetabolite(), mChemEq, and CChemEq::PRODUCT.

Referenced by CModelAdd::addReactions(), CModel::convert2NonReversible(), SBMLImporter::createCReactionFromReaction(), CModelExpansion::createDiffusionReaction(), CModelExpansion::duplicateReaction(), and ProductHandler::processStart().

◆ addSubstrate()

bool CReaction::addSubstrate ( const std::string &  metabKey,
const C_FLOAT64 multiplicity = 1.0 
)

Add a substrate to the reaction

Parameters
std::string& metabKey
constC_FLOAT64 & multiplicity (Default 1.0)
Returns
bool success

References CChemEq::addMetabolite(), mChemEq, and CChemEq::SUBSTRATE.

Referenced by CModelAdd::addReactions(), CModel::convert2NonReversible(), SBMLImporter::createCReactionFromReaction(), CModelExpansion::createDiffusionReaction(), CModelExpansion::duplicateReaction(), and SubstrateHandler::processStart().

◆ applyData()

◆ calculate()

void CReaction::calculate ( )
private

Calculate the kinetic function

◆ compile()

◆ compileFunctionParameters()

◆ createFunctionFromExpression()

◆ createUndoData()

◆ escapeId()

std::string CReaction::escapeId ( const std::string &  id)
private

Escapes double quotes and backslashes in a string and puts strings with tabs and spaces in double quotes.

Referenced by object2variable().

◆ fromData()

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

Static method to create a CDataObject based on the provided data

Parameters
constCData & data
Returns
CReaction * pDataObject

References CReaction(), CData::getProperty(), NO_PARENT, CData::OBJECT_NAME, and CDataValue::toString().

◆ getCallParameters()

const CCallParameters< C_FLOAT64 > & CReaction::getCallParameters ( ) const

Retrieve the call parameter given to the kinetic function.

Returns
const CCallParameters< C_FLOAT64 > & callParameters

References CFunctionParameterMap::getPointers(), and mMap.

Referenced by CMathObject::compileFlux().

◆ getChemEq() [1/2]

CChemEq & CReaction::getChemEq ( )

Retrieves the chemical equation of the reaction

Returns
CChemEq & chemEq

References mChemEq.

◆ getChemEq() [2/2]

◆ getChildObjectUnits()

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

Retrieve the units of the child object.

Returns
std::string units

Reimplemented from CDataContainer.

References CDataObject::getObjectAncestor(), CDataObject::getObjectName(), CModel::getQuantityUnit(), and CModel::getTimeUnit().

◆ getCompartmentNumber()

size_t CReaction::getCompartmentNumber ( ) const

Retrieves the number of compartments the reaction is acting in.

Returns
"size_t" the compartment number

References CChemEq::getCompartmentNumber(), and mChemEq.

◆ getDefaultNoiseExpression()

std::string CReaction::getDefaultNoiseExpression ( ) const

Retrieve the default expression for the noise.

Returns
std::string expression

References CDataObject::getCN(), and mpParticleFluxReference.

Referenced by CReactionInterface::setHasNoise().

◆ getEffectiveKineticLawUnitType()

◆ getExpressionTree()

CEvaluationNode * CReaction::getExpressionTree ( )

Converts the function tree into the corresponding expression tree. All variable nodes are replaced by object nodes.

References getFunction(), and variables2objects().

◆ getFirstCModelOrDefault()

const CModel * CReaction::getFirstCModelOrDefault ( std::map< const CDataObject *, SBase * > &  copasi2sbmlmap)
private
Returns
the first non-null CModel from the map or the default one

References CDataObject::getObjectDataModel().

Referenced by object2variable().

◆ getFlux()

const C_FLOAT64 & CReaction::getFlux ( ) const

Retrieves the flux of the reaction

Returns
const C_FLOAT64 & flux

References mFlux.

◆ getFluxReference() [1/2]

◆ getFluxReference() [2/2]

const CDataObject * CReaction::getFluxReference ( ) const

Retrieve const object referencing the flux

Returns
CDataObject * fluxReference

References mpFluxReference.

◆ getFunction()

◆ getFunctionParameters()

◆ getKey()

◆ getKineticLawUnit()

std::string CReaction::getKineticLawUnit ( ) const

Retrieve the effective kinetic law unit

Returns
std::string kineticLawUnit

References AmountPerTime, getEffectiveKineticLawUnitType(), CDataObject::getObjectAncestor(), CModel::getQuantityUnit(), CModel::getTimeUnit(), and CModel::getVolumeUnit().

Referenced by CModelParameter::getUnit().

◆ getKineticLawUnitType()

const CReaction::KineticLawUnit & CReaction::getKineticLawUnitType ( ) const

Retrieve the kinetic law unit type

Returns
const KineticLawUnit & kineticLawUnitType

References mKineticLawUnit.

Referenced by CModelExpansion::duplicateReaction(), CReactionInterface::init(), and CCopasiXML::saveModel().

◆ getLargestCompartment()

const CCompartment * CReaction::getLargestCompartment ( ) const

Retrieve the largest compartment that the reaction touches. This is time dependent it can only be called after update initial values has been called. Note for an empty reaction a NULL pointer is returned.

Returns
const CCompartment * pCompartment

References CChemEq::getLargestCompartment(), and mChemEq.

◆ getMap()

const CFunctionParameterMap & CReaction::getMap ( ) const

References mMap.

Referenced by CModel::prepareElasticity().

◆ getNoiseExpression()

std::string CReaction::getNoiseExpression ( ) const

Retrieve the expression for the noise.

Returns
std::string expression

References CEvaluationTree::getInfix(), mpNoiseExpression, and CExpression::updateInfix().

Referenced by CModelExpansion::duplicateReaction(), CReactionInterface::init(), and CCopasiXML::saveModel().

◆ getNoiseExpressionPtr() [1/2]

CExpression * CReaction::getNoiseExpressionPtr ( )

Retrieve the pointer to the expression for ODE model values.

Returns
CExpression*

References mpNoiseExpression, and CExpression::updateInfix().

◆ getNoiseExpressionPtr() [2/2]

const CExpression * CReaction::getNoiseExpressionPtr ( ) const

Retrieve the pointer to the expression for ODE model values.

Returns
CExpression*

References mpNoiseExpression, and CExpression::updateInfix().

Referenced by CMathObject::compileReactionParticleNoise(), and CModelExpansion::duplicateReaction().

◆ getNoiseReference()

const CDataObject * CReaction::getNoiseReference ( ) const

Retrieve object referencing the noise

Returns
const CDataObject * noiseReference

References mpNoiseReference.

◆ getObject()

const CObjectInterface * CReaction::getObject ( const CCommonName cn) const
virtual

We are hiding local reaction parameter which are covered by global quantities.

Parameters
constCCommonName & cn
Returns
const CObjectInterface * pObject

Reimplemented from CDataContainer.

References CDataContainer::getObject(), CDataObject::getObjectName(), CDataObject::getObjectParent(), CDataObject::hasFlag(), isLocalParameter(), mParameters, and CDataObject::StaticString.

Referenced by SBMLImporter::sbmlId2CopasiCN().

◆ getObjectDisplayName()

std::string CReaction::getObjectDisplayName ( ) const
virtual

Overload display name. Special treatment for reaction to provide a shorter display

Reimplemented from CDataObject.

References CDataObject::getObjectAncestor(), CDataObject::getObjectDisplayName(), and CDataObject::getObjectName().

◆ getParameterCNs() [1/3]

const std::vector< std::vector< CRegisteredCommonName > > & CReaction::getParameterCNs ( ) const

References mParameterIndexToCNs.

Referenced by getParameterCNs().

◆ getParameterCNs() [2/3]

const std::vector< CRegisteredCommonName > & CReaction::getParameterCNs ( const size_t &  index) const

◆ getParameterCNs() [3/3]

const std::vector< CRegisteredCommonName > & CReaction::getParameterCNs ( const std::string &  name) const

◆ getParameterIndex()

size_t CReaction::getParameterIndex ( const std::string &  parameterName,
const CFunctionParameter **  ppFunctionParameter = NULL 
) const

Retrieve the index of the given parameter name in the function call. If pType is not NULL the type of the parameter is returned

Parameters
conststd::string & parameterName
constCFunctionParameter ** ppFunctionParameter (default: NULL)
Returns
size_t index;

Retrieve the index of the given parameter name in the function call

Parameters
conststd::string & parameterName
Returns
size_t index;

References CFunctionParameterMap::findParameterByName(), and mMap.

Referenced by SBMLImporter::findCorrespondingFunction(), CDataModel::findObjectByDisplayName(), CModelParameterGroup::getObjectUnit(), initializeParameters(), and variable2object().

◆ getParameterObjects() [1/3]

const std::vector< std::vector< const CDataObject * > > & CReaction::getParameterObjects ( ) const

References mParameterIndexToObjects.

Referenced by getParameterObjects().

◆ getParameterObjects() [2/3]

◆ getParameterObjects() [3/3]

const std::vector< const CDataObject * > & CReaction::getParameterObjects ( const std::string &  name) const

◆ getParameters() [1/2]

CCopasiParameterGroup & CReaction::getParameters ( )

Gets the list of kinetic parameter objects of the reaction/function

References mParameters.

◆ getParameters() [2/2]

◆ getParameterValue()

◆ getParticleFlux()

const C_FLOAT64 & CReaction::getParticleFlux ( ) const

Retrieves the scaled flux of the reaction

Returns
const C_FLOAT64 & scaledFlux

References mParticleFlux.

◆ getParticleFluxReference() [1/2]

CDataObject * CReaction::getParticleFluxReference ( )

Retrieve object referencing the particle flux

Returns
CDataObject * particleFluxReference

References mpParticleFluxReference.

Referenced by CMathObject::compilePropensity(), CModel::convert2NonReversible(), CDataModel::findObjectByDisplayName(), and CMathReaction::initialize().

◆ getParticleFluxReference() [2/2]

const CDataObject * CReaction::getParticleFluxReference ( ) const

Retrieve const object referencing the particle flux

Returns
CDataObject * particleFluxReference

References mpParticleFluxReference.

◆ getParticleNoiseReference()

const CDataObject * CReaction::getParticleNoiseReference ( ) const

Retrieve object referencing the particle noise

Returns
const CDataObject * particleNoiseReference

References mpParticleNoiseReference.

Referenced by CMathObject::compileReactionNoise().

◆ getPropensityReference() [1/2]

CDataObject * CReaction::getPropensityReference ( )

Retrieve object referencing the propensity

Returns
CDataObject * propensityReference

References mpPropensityReference.

Referenced by CMathReaction::initialize().

◆ getPropensityReference() [2/2]

const CDataObject * CReaction::getPropensityReference ( ) const

Retrieve object referencing the propensity

Returns
CDataObject * propensityReference

References mpPropensityReference.

◆ getReactionScheme()

std::string CReaction::getReactionScheme ( ) const
Returns
the reaction scheme of this reaction

References CReactionInterface::getChemEqString(), CDataObject::getObjectDataModel(), and CReactionInterface::init().

◆ getSBMLId()

◆ getScalingCompartment()

const CCompartment * CReaction::getScalingCompartment ( ) const

◆ getScalingCompartmentCN()

const CCommonName & CReaction::getScalingCompartmentCN ( ) const

Retrieve the CN of the scaling compartment.

Returns
const CCommonName & scalingCompartmentCN

References mScalingCompartmentCN.

◆ hasNoise()

const bool & CReaction::hasNoise ( ) const

◆ initializeParameterMapping()

◆ initializeParameters()

◆ initObjects()

◆ isFast()

const bool & CReaction::isFast ( ) const

Check whether the reaction needs to be treated as fast @ return const bool & fast

References mFast.

Referenced by CModelExpansion::duplicateReaction(), CMathReaction::isFast(), and CCopasiXML::saveModel().

◆ isLocalParameter() [1/2]

◆ isLocalParameter() [2/2]

bool CReaction::isLocalParameter ( const std::string &  parameterName) const

Check whether the named parameter is a local parameter.

Parameters
conststd::string & parameterName
Returns
bool isLocal

References isLocalParameter(), and mParameterNameToIndex.

◆ isReversible()

◆ load()

C_INT32 CReaction::load ( CReadConfig configbuffer)

Loads an object with data coming from a CReadConfig object. (CReadConfig object reads an input stream)

Parameters
pconfigbufferreference to a CReadConfig object.
Returns
mFail
See also
mFail

References C_INT32, CReadConfig::getVariable(), loadOld(), mChemEq, mpFunction, CReadConfig::SEARCH, CChemEqInterface::setChemEqFromString(), setFunction(), CDataObject::setObjectName(), and CChemEq::setReversibility().

◆ loadOld()

◆ loadOneRole()

◆ object2variable()

CEvaluationNodeVariable * CReaction::object2variable ( const CEvaluationNodeObject objectNode,
std::map< std::string, std::pair< CDataObject *, CFunctionParameter * > > &  replacementMap,
std::map< const CDataObject *, SBase * > &  copasi2sbmlmap 
)
private

◆ objects2variables()

CEvaluationNode * CReaction::objects2variables ( const CEvaluationNode expression,
std::map< std::string, std::pair< CDataObject *, CFunctionParameter * > > &  replacementMap,
std::map< const CDataObject *, SBase * > &  copasi2sbmlmap 
)
private

◆ operator=()

CReaction& CReaction::operator= ( const CReaction )
private

◆ printDebug()

void CReaction::printDebug ( ) const

◆ resolveCN()

CDataObject * CReaction::resolveCN ( const CModel pModel,
CCommonName  cn 
)
private
Parameters
pModelthe model in which to resolve the cn
cnthe common name, primary parts before model will be dropped
Returns
the data object for the given cn

References CObjectInterface::DataObject(), CDataContainer::getObject(), CCommonName::getObjectName(), CCommonName::getObjectType(), and CCommonName::getRemainder().

Referenced by compileFunctionParameters(), and object2variable().

◆ sanitizeSBMLId()

std::string CReaction::sanitizeSBMLId ( const std::string &  id)
staticprivate

Convert SBML to a valid COPASI infix identifier

Parameters
conststd::string & id
Returns
std::string

Referenced by object2variable().

◆ setFast()

void CReaction::setFast ( const bool &  fast)

Set whether the reaction is to be treated as fast

Parameters
constbool & fast

References mFast.

Referenced by CModelExpansion::duplicateReaction(), and ReactionHandler::processStart().

◆ setFunction() [1/2]

bool CReaction::setFunction ( CFunction pFunction)

◆ setFunction() [2/2]

◆ setFunctionFromExpressionTree()

◆ setHasNoise()

void CReaction::setHasNoise ( const bool &  hasNoise)

Set whether to add noise to the reaction rate

Parameters
constbool & hasNoise

References CDataObject::getObjectAncestor(), hasNoise(), mHasNoise, and CModel::setCompileFlag().

Referenced by CModelExpansion::duplicateReaction(), ReactionHandler::processStart(), and CReactionInterface::writeBackToReaction().

◆ setKineticLawUnitType()

void CReaction::setKineticLawUnitType ( const KineticLawUnit kineticLawUnitType)

Set the kinetic law unit type;

Parameters
constKineticLawUnit & kineticLawUnit

References mKineticLawUnit.

Referenced by applyData(), CModelExpansion::duplicateReaction(), KineticLawHandler::processStart(), and CReactionInterface::writeBackToReaction().

◆ setNoiseExpression()

bool CReaction::setNoiseExpression ( const std::string &  expression)

◆ setNoiseExpressionPtr()

bool CReaction::setNoiseExpressionPtr ( CExpression pExpression)

◆ setObjectParent()

bool CReaction::setObjectParent ( const CDataContainer pParent)
virtual

Sets the parent of the metabolite;

Parameters
constCDataContainer * pParent
Returns
bool success

Reimplemented from CDataObject.

References CDataObject::setObjectParent().

◆ setParameterCNs() [1/2]

◆ setParameterCNs() [2/2]

bool CReaction::setParameterCNs ( const std::string &  name,
const std::vector< CRegisteredCommonName > &  CNs 
)

◆ setParameterObject() [1/2]

bool CReaction::setParameterObject ( const size_t &  index,
const CDataObject object 
)

References setParameterObjects().

◆ setParameterObject() [2/2]

bool CReaction::setParameterObject ( const std::string &  name,
const CDataObject object 
)

References setParameterObjects().

◆ setParameterObjects() [1/2]

◆ setParameterObjects() [2/2]

bool CReaction::setParameterObjects ( const std::string &  name,
const std::vector< const CDataObject * > &  objects 
)

◆ setParameterValue()

◆ setReactionScheme()

bool CReaction::setReactionScheme ( const std::string &  scheme,
const std::string &  newFunction = "",
bool  createMetabolites = true,
bool  createOther = true 
)

Initializes this reaction from the specified reaction scheme

Parameters
schemethe new reaction scheme to be used
newFunctiona candidate function to be used
createMetabolietsif true, new metabolites will be created
createOtherif true, additional elements will be created as well
Returns
success / failure

Initializes this reaction from the specified reaction scheme

References CModel::compileIfNecessary(), CReactionInterface::createMetabolites(), CReactionInterface::createOtherObjects(), CDataModel::getModel(), CDataObject::getObjectDataModel(), CReactionInterface::init(), CReactionInterface::setChemEqString(), and CReactionInterface::writeBackToReaction().

◆ setReversible()

void CReaction::setReversible ( bool  reversible)

◆ setSBMLId()

void CReaction::setSBMLId ( const std::string &  id) const

◆ setScalingCompartment()

void CReaction::setScalingCompartment ( const CCompartment pCompartment)

Set the compartment used for scaling the kinetic function

Parameters
constCCompartment * pCompartment

References CDataObject::getCN(), mpScalingCompartment, and mScalingCompartmentCN.

Referenced by CModelExpansion::duplicateReaction().

◆ setScalingCompartmentCN()

void CReaction::setScalingCompartmentCN ( const std::string &  compartmentCN)

Set the CN of the compartment used for scaling the kinetic function

Parameters
conststd::string & compartmentCN

References CDataObject::getObjectDataModel(), CObjectInterface::GetObjectFromCN(), mpScalingCompartment, and mScalingCompartmentCN.

Referenced by applyData(), CReaction(), KineticLawHandler::processStart(), and CReactionInterface::writeBackToReaction().

◆ setScalingFactor()

◆ toData()

◆ variable2object()

◆ variables2objects()

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const CReaction d 
)
friend

Friend declaration for ostream operator

Parameters
std::ostream& os
constCReaction & d
Returns
std::ostream & os

Member Data Documentation

◆ KineticLawUnitTypeName

◆ mChemEq

◆ mFast

bool CReaction::mFast
private

This flag indicates whether the reaction is treated as fast. The interpretation of fast is up to to the integration algorithm.

Referenced by isFast(), and setFast().

◆ mFlux

C_FLOAT64 CReaction::mFlux
private

The flux of the reaction, as amount of substance/time

Referenced by compile(), getFlux(), and initObjects().

◆ mHasNoise

bool CReaction::mHasNoise
private

A Boolean flag indicating whether to add noise to the reaction

Referenced by applyData(), compile(), createUndoData(), hasNoise(), setHasNoise(), and toData().

◆ mKineticLawUnit

KineticLawUnit CReaction::mKineticLawUnit
private

This indicates what the units of the kinetic law are

Referenced by createUndoData(), getEffectiveKineticLawUnitType(), getKineticLawUnitType(), setKineticLawUnitType(), setScalingFactor(), and toData().

◆ mMap

CFunctionParameterMap CReaction::mMap
private

This describes the mapping of the species and parameters to the function parameters. Here are the pointers to the actual objects and values.

Referenced by compileFunctionParameters(), getCallParameters(), getFunctionParameters(), getMap(), getParameterIndex(), initializeParameterMapping(), initializeParameters(), loadOld(), loadOneRole(), and setFunction().

◆ mNoise

C_FLOAT64 CReaction::mNoise
private

The noise of the reaction

Referenced by initObjects().

◆ mParameterIndexToCNs

◆ mParameterIndexToObjects

◆ mParameterNameToIndex

std::map< std::string, size_t > CReaction::mParameterNameToIndex
private

This describes the mapping of the species to the function parameters. Here the keys of the metabolites (as in the chemical equation) are stored.

Referenced by addParameterObject(), applyData(), getParameterCNs(), getParameterObjects(), initializeParameterMapping(), initializeParameters(), isLocalParameter(), loadOneRole(), setFunctionFromExpressionTree(), setParameterCNs(), setParameterObjects(), and setParameterValue().

◆ mParameters

◆ mParticleFlux

C_FLOAT64 CReaction::mParticleFlux
private

The scaled flux of the reaction, as particle number/time

Referenced by compile(), getParticleFlux(), and initObjects().

◆ mParticleNoise

C_FLOAT64 CReaction::mParticleNoise
private

The particle noise

Referenced by initObjects().

◆ mpFluxReference

CDataObjectReference<C_FLOAT64>* CReaction::mpFluxReference
private

Referenced by getFluxReference(), and initObjects().

◆ mpFunction

◆ mpNoiseExpression

CExpression* CReaction::mpNoiseExpression
private

◆ mpNoiseReference

CDataObjectReference<C_FLOAT64>* CReaction::mpNoiseReference
private

Referenced by getNoiseReference(), and initObjects().

◆ mpParticleFluxReference

CDataObjectReference<C_FLOAT64>* CReaction::mpParticleFluxReference
private

◆ mpParticleNoiseReference

CDataObjectReference<C_FLOAT64>* CReaction::mpParticleNoiseReference
private

◆ mpPropensityReference

CDataObjectReference<C_FLOAT64>* CReaction::mpPropensityReference
private

◆ mPropensity

C_FLOAT64 CReaction::mPropensity
private

The propensity of the reaction

Referenced by initObjects().

◆ mpScalingCompartment

const CCompartment* CReaction::mpScalingCompartment
private

◆ mSBMLId

std::string CReaction::mSBMLId
mutableprivate

The id of the corresponding reaction in an SBML file. This value is either set upon importing an SBML file, or when the object is first exported to an SBML file.

Referenced by getSBMLId(), and setSBMLId().

◆ mScalingCompartmentCN


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