|
COPASI API
4.40.278
|
#include <CModelParameter.h>
Public Types | |
| enum class | CompareResult { Obsolete , Missing , Modified , Conflict , Identical , __SIZE } |
| enum class | Type { Model , Compartment , Species , ModelValue , ReactionParameter , Reaction , Group , Set , unknown , __SIZE } |
Public Member Functions | |
| virtual bool | applyData (const CData &data, CUndoData::CChangeSet &changes) |
| CModelParameter (CModelParameterGroup *pParent, const CModelParameter::Type &type) | |
| CModelParameter (const CModelParameter &src, CModelParameterGroup *pParent) | |
| virtual void | compile () |
| virtual void | createUndoData (CUndoData &undoData, const CUndoData::Type &type, const CData &oldData=CData(), const CCore::Framework &framework=CCore::Framework::ParticleNumbers) const |
| virtual void | destruct () |
| virtual const CompareResult & | diff (const CModelParameter &other, const CCore::Framework &framework=CCore::Framework::ParticleNumbers, const bool &createMissing=false) |
| virtual const CModelParameter * | getChild (const size_t &index) const |
| const CCommonName & | getCN () const |
| const CompareResult & | getCompareResult () const |
| virtual size_t | getIndex () const |
| std::string | getInitialExpression () const |
| const CExpression * | getInitialExpressionPtr () const |
| CModel * | getModel () const |
| virtual std::string | getName () const |
| virtual size_t | getNumChildren () const |
| CDataObject * | getObject () const |
| CModelParameterGroup * | getParent () const |
| CModelParameterSet * | getSet () const |
| const CModelEntity::Status & | getSimulationType () const |
| const Type & | getType () const |
| CValidatedUnit | getUnit (const CCore::Framework &framework) const |
| virtual const double & | getValue (const CCore::Framework &framework) const |
| bool | isInitialExpressionValid () const |
| bool | isReadOnly () const |
| bool | operator< (const CModelParameter &rhs) const |
| virtual bool | refreshFromModel (const bool &modifyExistence) |
| virtual void | setCN (const CCommonName &cn) |
| void | setCompareResult (const CompareResult &compareResult) |
| void | setInitialExpression (const std::string &initialExpression) |
| void | setParent (CModelParameterGroup *pParent) |
| bool | setSimulationType (const CModelEntity::Status &simulationType) |
| virtual void | setValue (const C_FLOAT64 &value, const CCore::Framework &framework, bool updateModelIfActive=true) |
| virtual CData | toData () const |
| virtual CModelParameterSet * | toSet () |
| virtual const CModelParameterSet * | toSet () const |
| virtual bool | updateModel () |
| virtual | ~CModelParameter () |
Public Member Functions inherited from CUndoObjectInterface | |
| CUndoObjectInterface () | |
| CUndoObjectInterface (const CUndoObjectInterface &src) | |
| bool | generateUuid () |
| const xg::Guid & | getUuid () const |
| virtual CUndoObjectInterface * | insert (const CData &data) |
| bool | setUuid (const std::string &uuid) |
| bool | setUuid (const xg::Guid &uuid) |
| virtual void | updateIndex (const size_t &index, const CUndoObjectInterface *pUndoObject) |
| virtual | ~CUndoObjectInterface () |
Static Public Member Functions | |
| static CModelParameter * | fromData (const CData &data, CUndoObjectInterface *pParent) |
Static Public Member Functions inherited from CUndoObjectInterface | |
| template<class CType > | |
| static CType * | fromData (const CData &, CUndoObjectInterface *) |
Static Public Attributes | |
| static const CEnumAnnotation< std::string, CompareResult > | CompareResultNames |
| static const CEnumAnnotation< std::string, Type > | TypeNames |
Protected Attributes | |
| CRegisteredCommonName | mCN |
| CompareResult | mCompareResult |
| bool | mIsInitialExpressionValid |
| CExpression * | mpInitialExpression |
| CDataObject * | mpObject |
| CModelParameterGroup * | mpParent |
| CModelEntity::Status | mSimulationType |
| Type | mType |
| double | mValue |
Private Member Functions | |
| CModelParameter () | |
Friends | |
| std::ostream & | operator<< (std::ostream &os, const CModelParameter &o) |
|
strong |
|
strong |
|
private |
The default constructor is hidden.
Referenced by CModelParameterGroup::add(), CModelParameterGroup::copy(), and fromData().
| CModelParameter::CModelParameter | ( | CModelParameterGroup * | pParent, |
| const CModelParameter::Type & | type | ||
| ) |
Constructor
| CModelParameter::CModelParameter | ( | const CModelParameter & | src, |
| CModelParameterGroup * | pParent | ||
| ) |
Copy constructor
References getInitialExpression(), mpParent, mType, Set, and setInitialExpression().
|
virtual |
Destructor
References mpInitialExpression, mpParent, pdelete, and CModelParameterGroup::remove().
|
virtual |
Apply the provided data to the object
| const | CData & data |
Implements CUndoObjectInterface.
Reimplemented in CModelParameterSet, and CModelParameterGroup.
References CDataValue::DATA, CModelEntity::FIXED, CData::FRAMEWORK, CCore::FrameworkNames, CData::getProperty(), CDataValue::getType(), CData::INITIAL_EXPRESSION, CData::INITIAL_VALUE, CData::isSetProperty(), mpParent, mSimulationType, mType, CData::OBJECT_INDEX, CData::OBJECT_NAME, CData::PARAMETER_VALUE, CCore::ParticleNumbers, Set, setCN(), setInitialExpression(), setValue(), CData::SIMULATION_TYPE, CModelEntity::StatusName, CDataValue::toData(), CDataValue::toDouble(), CEnumAnnotation< Type, Enum >::toEnum(), CDataValue::toSizeT(), CDataValue::toString(), and CModelParameterGroup::updateIndex().
Referenced by CModelParameterGroup::applyData().
|
virtual |
Compile the parameter
Reimplemented in CModelParameterSet, CModelParameterGroup, CModelParameterReactionParameter, and CModelParameterSpecies.
References Compartment, CExpression::compile(), CObjectInterface::DataObject(), CCopasiMessage::getLastMessage(), getModel(), CObjectInterface::GetObjectFromCN(), mCN, mIsInitialExpressionValid, Model, ModelValue, mpInitialExpression, mpObject, mType, ReactionParameter, CCopasiMessage::size(), Species, and unknown.
Referenced by CModelParameterSpecies::compile(), CModelParameterReactionParameter::compile(), and CModelParameterGroup::compile().
|
virtual |
Create the undo data which represents the changes recording the differences between the provided oldData and the current data.
| CUndoData | & undoData |
| const | CUndoData::Type & type |
| const | CData & oldData (default: empty data) |
| const | CCore::Framework & framework (default: CCore::Framework::ParticleNumbers) |
Implements CUndoObjectInterface.
Reimplemented in CModelParameterSet, CModelParameterGroup, and CModelParameterSpecies.
References CUndoData::addProperty(), CData::addProperty(), CUndoData::CHANGE, Compartment, CData::FRAMEWORK, CCore::FrameworkNames, getCN(), getIndex(), getInitialExpression(), CData::getProperty(), getSet(), CData::INITIAL_EXPRESSION, CData::INITIAL_VALUE, mCN, Model, ModelValue, mSimulationType, mType, mValue, CData::OBJECT_INDEX, CData::OBJECT_NAME, CData::OBJECT_PARENT_CN, CData::OBJECT_TYPE, CData::PARAMETER_VALUE, ReactionParameter, Set, CData::SIMULATION_TYPE, Species, CModelEntity::StatusName, CDataValue::toData(), and TypeNames.
Referenced by CModelParameterSpecies::createUndoData(), and CModelParameterGroup::createUndoData().
|
virtual |
|
virtual |
Compare the parameter to an other
| const | CModelParameter & other |
| const | CCore::Framework & framework (default: ParticleNumbers) |
| const | bool & createMissing = false |
Reimplemented in CModelParameterGroup.
References CModelEntity::ASSIGNMENT, Compartment, Conflict, getInitialExpression(), getObject(), CModelEntity::getStatus(), getValue(), Identical, mCompareResult, Missing, ModelValue, Modified, mpObject, mType, Obsolete, CCore::ParticleNumbers, and Species.
|
static |
Static method to create a CDataObject based on the provided data
| const | CData & data |
References CModelParameter(), Compartment, CData::getProperty(), Group, Model, ModelValue, CData::OBJECT_TYPE, Reaction, ReactionParameter, Set, Species, CEnumAnnotation< Type, Enum >::toEnum(), CDataValue::toString(), TypeNames, and unknown.
Referenced by CModelParameterGroup::insert(), and CModelParameterSet::insert().
|
virtual |
Reimplemented in CModelParameterGroup.
| const CCommonName & CModelParameter::getCN | ( | ) | const |
Retrieve the CN of the object represented by the parameter
References mCN.
Referenced by CModelParameterSet::add(), CModelParameterReactionParameter::compile(), createUndoData(), CCopasiXML::saveModelParameter(), and toData().
| const CModelParameter::CompareResult & CModelParameter::getCompareResult | ( | ) | const |
Retrieve the compare result.
References mCompareResult.
Referenced by CCopasiXML::saveModelParameter().
|
virtual |
Retrieve the index of the parameter in the vector of children in the parent
Reimplemented in CModelParameterSet.
References CModelParameterGroup::begin(), C_INVALID_INDEX, CModelParameterGroup::end(), and mpParent.
Referenced by createUndoData(), and toData().
| std::string CModelParameter::getInitialExpression | ( | ) | const |
Retrieve the initial expression infix.
References CEvaluationTree::getInfix(), mpInitialExpression, and CExpression::updateInfix().
Referenced by CModelParameter(), CModelParameterReactionParameter::compile(), createUndoData(), diff(), isReadOnly(), CCopasiXML::saveModelParameter(), toData(), and updateModel().
| const CExpression * CModelParameter::getInitialExpressionPtr | ( | ) | const |
Retrieve the actual initial expression.
References mpInitialExpression.
| CModel * CModelParameter::getModel | ( | ) | const |
Retrieve a pointer to the model the parameter is part of
References CModelParameterSet::getModel(), and getSet().
Referenced by compile(), CModelParameterReactionParameter::compile(), CModelParameterGroup::getObjectUnit(), getUnit(), CModelParameterSpecies::setValue(), and updateModel().
|
virtual |
Retrieve the name of the parameter.
Reimplemented in CModelParameterSet, and CModelParameterSpecies.
References CDataObject::getObjectName(), mCN, mpObject, and CCommonName::nameFromCN().
Referenced by CModelParameterGroup::getObjectUnit(), and refreshFromModel().
|
virtual |
Reimplemented in CModelParameterGroup.
| CDataObject * CModelParameter::getObject | ( | ) | const |
Retrieve the pointer to the corresponding model object
References mpObject.
Referenced by diff(), and CModelParameterGroup::getObjectUnit().
| CModelParameterGroup * CModelParameter::getParent | ( | ) | const |
Retrieve the parent, i.e., containing group, of the parameter.
References mpParent.
Referenced by getSet().
| CModelParameterSet * CModelParameter::getSet | ( | ) | const |
Retrieve a pointer to the parameter set the parameter belongs to
References getParent(), getType(), mpParent, mType, Set, and toSet().
Referenced by CModelParameterGroup::applyData(), CModelParameterSpecies::compile(), CModelParameterReactionParameter::compile(), createUndoData(), getModel(), CModelParameterSpecies::getName(), refreshFromModel(), setInitialExpression(), setValue(), CModelParameterCompartment::setValue(), CModelParameterSpecies::setValue(), and toData().
| const CModelEntity::Status & CModelParameter::getSimulationType | ( | ) | const |
Retrieve the role the parameters object plays in the simulation
References mSimulationType.
Referenced by CCopasiXML::saveModelParameter().
| const CModelParameter::Type & CModelParameter::getType | ( | ) | const |
Retrieve the type of the parameter
References mType.
Referenced by CModelParameterSet::add(), CModelParameterGroup::copy(), CModelParameterGroup::diff(), CModelParameterGroup::getObjectUnit(), getSet(), and CCopasiXML::saveModelParameter().
| CValidatedUnit CModelParameter::getUnit | ( | const CCore::Framework & | framework | ) | const |
Retrieve the unit of the parameter based on the current framework
| const | Framework & framework (default: ParticleNumbers) |
References Compartment, CCore::Concentration, CMetab::getChildObjectUnits(), CModelEntity::getChildObjectUnits(), CMetab::getInitialConcentrationReference(), CModelEntity::getInitialValueReference(), CReaction::getKineticLawUnit(), getModel(), CModelParameterGroup::getObjectUnit(), CModelEntity::getUnitExpression(), Model, ModelValue, mpObject, mpParent, mType, Reaction, ReactionParameter, and Species.
|
virtual |
Retrieve the value of the parameter based on the current framework
| const | Framework & framework |
Reimplemented in CModelParameterSpecies.
References mValue.
Referenced by CModelParameterReactionParameter::compile(), diff(), refreshFromModel(), CCopasiXML::saveModelParameter(), and CModelParameterSpecies::setValue().
| bool CModelParameter::isInitialExpressionValid | ( | ) | const |
Check whether the initial expression is valid, i.e., it compiled
References mIsInitialExpressionValid.
| bool CModelParameter::isReadOnly | ( | ) | const |
Check whether the value is read only.
References getInitialExpression(), Group, mIsInitialExpressionValid, mType, Reaction, and Set.
| bool CModelParameter::operator< | ( | const CModelParameter & | rhs | ) | const |
References mCN.
|
virtual |
Refresh the parameter from the corresponding model object
| const | bool & modifyExistence |
Reimplemented in CModelParameterSet, and CModelParameterGroup.
References CModelEntity::ASSIGNMENT, C_FLOAT64, Compartment, CModelEntity::FIXED, CDataObject::getCN(), CModelEntity::getInitialValue(), CModelEntity::getInitialValueReference(), CModelParameterSet::getModelParameter(), getName(), getSet(), CCopasiParameter::getValue(), getValue(), Identical, mCompareResult, Missing, Model, ModelValue, mpObject, mSimulationType, mType, Obsolete, CCore::ParticleNumbers, ReactionParameter, setValue(), and Species.
|
virtual |
Set the CN of the object represented by the parameter
| const | CCommonName & cn |
Reimplemented in CModelParameterSpecies.
References mCN.
Referenced by applyData(), CModelParameterSet::CModelParameterSet(), CModelParameterSet::createFromModel(), CModelParameterSet::insert(), ModelParameterGroupHandler::processStart(), ModelParameterHandler::processStart(), and CModelParameterSpecies::setCN().
| void CModelParameter::setCompareResult | ( | const CompareResult & | compareResult | ) |
The the compare result.
| const | CompareResult & compareResult |
References mCompareResult.
Referenced by CModelParameterGroup::diff().
| void CModelParameter::setInitialExpression | ( | const std::string & | initialExpression | ) |
Set the initial expression infix.
| const | std::string & initialExpression |
References getSet(), mpInitialExpression, pdelete, and CExpression::setInfix().
Referenced by applyData(), CModelParameter(), CModelParameterSet::createFromModel(), ModelParameterHandler::processEnd(), and CModelParameterReactionParameter::setGlobalQuantityCN().
| void CModelParameter::setParent | ( | CModelParameterGroup * | pParent | ) |
Set the parent, i.e., containing group, of the parameter. Note, it is the responsibility of the user to remove the parameter from the old part.
| CModelParameterGroup | * pParent |
References mpParent.
Referenced by CModelParameterGroup::add(), and CModelParameterGroup::insert().
| bool CModelParameter::setSimulationType | ( | const CModelEntity::Status & | simulationType | ) |
Set the role the parameters object plays in the simulation. Note, REACTION is only valid for species.
| const | CModelEntity::Status & simulationType |
References CModelEntity::ASSIGNMENT, Compartment, CModelEntity::FIXED, Model, ModelValue, mSimulationType, mType, ReactionParameter, CModelEntity::REACTIONS, Species, and CModelEntity::TIME.
Referenced by CModelParameterReactionParameter::compile(), CModelParameterSet::createFromModel(), and ModelParameterHandler::processStart().
|
virtual |
Set the value of the parameter based on the current framework
| const | double & value |
| const | Framework & framework |
| updateModelIfActive | if this is the active parameter set, write the changes back to the model |
Reimplemented in CModelParameterSpecies, and CModelParameterCompartment.
References getSet(), CModelParameterSet::isActive(), mValue, and updateModel().
Referenced by applyData(), CModelParameterSet::createFromModel(), ModelParameterHandler::processStart(), and refreshFromModel().
|
virtual |
Retrieve the data describing the object
Implements CUndoObjectInterface.
Reimplemented in CModelParameterSet, CModelParameterGroup, and CModelParameterSpecies.
References CData::addProperty(), Compartment, getCN(), getIndex(), getInitialExpression(), getSet(), CUndoObjectInterface::getUuid(), CData::INITIAL_EXPRESSION, CData::INITIAL_VALUE, mCN, Model, ModelValue, mSimulationType, mType, mValue, CData::OBJECT_INDEX, CData::OBJECT_NAME, CData::OBJECT_PARENT_CN, CData::OBJECT_TYPE, CData::OBJECT_UUID, CData::PARAMETER_VALUE, ReactionParameter, Set, CData::SIMULATION_TYPE, Species, CModelEntity::StatusName, and TypeNames.
Referenced by CModelParameterSpecies::toData(), and CModelParameterGroup::toData().
|
virtual |
Reimplemented in CModelParameterSet.
Referenced by getSet().
|
virtual |
Reimplemented in CModelParameterSet.
|
virtual |
Update the corresponding model object with the current parameter settings
Reimplemented in CModelParameterSet, CModelParameterGroup, and CModelParameterSpecies.
References CModelEntity::ASSIGNMENT, C_FLOAT64, Compartment, CObjectInterface::DataObject(), getInitialExpression(), getModel(), CDataObject::getObjectAncestor(), CDataObject::getObjectFromCN(), CDataObject::getObjectName(), CDataObject::getObjectParent(), CEvaluationTree::getRoot(), CModelEntity::getStatus(), CDataObject::getValuePointer(), mIsInitialExpressionValid, Model, ModelValue, mpInitialExpression, mpObject, mpParent, mType, mValue, ReactionParameter, CModelEntity::setInitialExpression(), CModelEntity::setInitialValue(), CReaction::setParameterObjects(), CCopasiParameter::setValue(), and Species.
Referenced by setValue(), CModelParameterCompartment::setValue(), and CModelParameterSpecies::updateModel().
|
friend |
|
static |
|
protected |
The CN of the corresponding model object
Referenced by compile(), createUndoData(), getCN(), getName(), CModelParameterSpecies::getName(), operator<(), setCN(), CModelParameterSpecies::setCN(), and toData().
|
protected |
The result of the last compare
Referenced by CModelParameterGroup::diff(), diff(), getCompareResult(), refreshFromModel(), CModelParameterGroup::refreshFromModel(), and setCompareResult().
|
protected |
The result of the last compile of the initial expression. Note an empty or missing expression is valid.
Referenced by compile(), isInitialExpressionValid(), isReadOnly(), and updateModel().
|
protected |
A pointer to the initial expression
Referenced by compile(), getInitialExpression(), getInitialExpressionPtr(), setInitialExpression(), updateModel(), and ~CModelParameter().
|
protected |
A pointer to the corresponding model object. NULL if no object exists.
Referenced by compile(), diff(), getName(), CModelParameterSpecies::getName(), getObject(), CModelParameterGroup::getObjectUnit(), getUnit(), refreshFromModel(), updateModel(), and CModelParameterSpecies::updateModel().
|
protected |
The parent group
Referenced by applyData(), CModelParameter(), CModelParameterReactionParameter::compile(), getIndex(), getParent(), getSet(), getUnit(), CModelParameterReactionParameter::setGlobalQuantityCN(), setParent(), updateModel(), and ~CModelParameter().
|
protected |
The role the parameter object is used in the simulation.
Referenced by applyData(), createUndoData(), getSimulationType(), refreshFromModel(), setSimulationType(), and toData().
|
protected |
|
protected |
The value of the parameter
Referenced by CModelParameterSpecies::compile(), CModelParameterReactionParameter::compile(), createUndoData(), CModelParameterSpecies::createUndoData(), getValue(), CModelParameterSpecies::getValue(), setValue(), CModelParameterCompartment::setValue(), CModelParameterSpecies::setValue(), toData(), and updateModel().
|
static |