COPASI API
4.16.103
|
#include <CModelParameter.h>
Public Types | |
enum | CompareResult { Obsolete, Missing, Modified, Conflict, Identical } |
enum | Framework { Concentration = 0, ParticleNumbers } |
enum | Type { Model, Compartment, Species, ModelValue, ReactionParameter, Reaction, Group, Set, unknown } |
Public Member Functions | |
CModelParameter (CModelParameterGroup *pParent, const CModelParameter::Type &type) | |
CModelParameter (const CModelParameter &src, CModelParameterGroup *pParent) | |
virtual void | compile () |
virtual const CompareResult & | diff (const CModelParameter &other, const CModelParameter::Framework &framework=ParticleNumbers, const bool &createMissing=false) |
virtual const CModelParameter * | getChild (const size_t &index) const |
const CCopasiObjectName & | getCN () const |
const CompareResult & | getCompareResult () const |
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 |
CCopasiObject * | getObject () const |
CModelParameterGroup * | getParent () const |
CModelParameterSet * | getSet () const |
const CModelEntity::Status & | getSimulationType () const |
const Type & | getType () const |
const std::string | getUnit (const Framework &framework) const |
virtual const double & | getValue (const Framework &framework) const |
bool | isInitialExpressionValid () const |
bool | isReadOnly () const |
virtual bool | refreshFromModel (const bool &modifyExistence) |
virtual void | setCN (const CCopasiObjectName &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 double &value, const Framework &framework) |
virtual bool | updateModel () |
virtual | ~CModelParameter () |
Static Public Attributes | |
static const char * | TypeNames [] |
Static Protected Member Functions | |
static std::string | nameFromCN (const CCopasiObjectName &cn) |
Protected Attributes | |
CRegisteredObjectName | mCN |
CompareResult | mCompareResult |
bool | mIsInitialExpressionValid |
CExpression * | mpInitialExpression |
CCopasiObject * | mpObject |
CModelParameterGroup * | mpParent |
CModelEntity::Status | mSimulationType |
Type | mType |
double | mValue |
Private Member Functions | |
CModelParameter () | |
Friends | |
std::ostream & | operator<< (std::ostream &os, const CModelParameter &o) |
Definition at line 21 of file CModelParameter.h.
Enumerator | |
---|---|
Obsolete | |
Missing | |
Modified | |
Conflict | |
Identical |
Definition at line 41 of file CModelParameter.h.
Enumerator | |
---|---|
Model | |
Compartment | |
Species | |
ModelValue | |
ReactionParameter | |
Reaction | |
Group | |
Set | |
unknown |
Definition at line 26 of file CModelParameter.h.
|
private |
The default constructor is hidden.
Referenced by CModelParameterGroup::add(), and CModelParameterGroup::copy().
CModelParameter::CModelParameter | ( | CModelParameterGroup * | pParent, |
const CModelParameter::Type & | type | ||
) |
Constructor
Definition at line 60 of file CModelParameter.cpp.
References mpParent, mType, and Set.
CModelParameter::CModelParameter | ( | const CModelParameter & | src, |
CModelParameterGroup * | pParent | ||
) |
Copy constructor
Definition at line 74 of file CModelParameter.cpp.
References getInitialExpression(), mpParent, mType, Set, and setInitialExpression().
|
virtual |
Destructor
Definition at line 91 of file CModelParameter.cpp.
References mpParent, and CModelParameterGroup::remove().
|
virtual |
Compile the parameter
Reimplemented in CModelParameterReactionParameter, CModelParameterSpecies, and CModelParameterGroup.
Definition at line 391 of file CModelParameter.cpp.
References Compartment, CExpression::compile(), getModel(), CCopasiObject::getObjectDataModel(), mCN, mIsInitialExpressionValid, Model, ModelValue, mpInitialExpression, mpObject, mType, CCopasiDataModel::ObjectFromName(), ReactionParameter, Species, and unknown.
Referenced by CModelParameterGroup::compile(), CModelParameterSpecies::compile(), and CModelParameterReactionParameter::compile().
|
virtual |
Compare the parameter to an other
const | CModelParameter & other |
const | CModelParameter::Framework & framework (default: ParticleNumbers) |
const | bool & createMissing = false |
Reimplemented in CModelParameterGroup.
Definition at line 428 of file CModelParameter.cpp.
References CModelEntity::ASSIGNMENT, Compartment, Conflict, getInitialExpression(), getObject(), getValue(), Identical, mCompareResult, Missing, ModelValue, Modified, mpObject, mType, Obsolete, ParticleNumbers, and Species.
|
virtual |
Reimplemented in CModelParameterGroup.
Definition at line 673 of file CModelParameter.cpp.
Referenced by applyValueToModelParameter().
const CCopasiObjectName & CModelParameter::getCN | ( | ) | const |
Retrieve the CN of the object represented by the parameter
Definition at line 199 of file CModelParameter.cpp.
References mCN.
Referenced by applyValueToModelParameter(), CModelParameterReactionParameter::compile(), CModelParameterSet::createFromModel(), CCopasiXML::saveModelParameter(), and CQParameterOverviewDM::setData().
const CModelParameter::CompareResult & CModelParameter::getCompareResult | ( | ) | const |
Retrieve the compare result.
Definition at line 302 of file CModelParameter.cpp.
References mCompareResult.
Referenced by CQParameterOverviewDM::diffData(), CQParameterOverviewDM::flags(), and CCopasiXML::saveModelParameter().
size_t CModelParameter::getIndex | ( | ) | const |
Retrieve the index of the parameter in the vector of children in the parent
Definition at line 307 of file CModelParameter.cpp.
References CModelParameterGroup::begin(), C_INVALID_INDEX, CModelParameterGroup::end(), and mpParent.
std::string CModelParameter::getInitialExpression | ( | ) | const |
Retrieve the initial expression infix.
Definition at line 287 of file CModelParameter.cpp.
References CEvaluationTree::getInfix(), and mpInitialExpression.
Referenced by CQParameterOverviewDM::assignmentData(), CModelParameter(), CModelParameterReactionParameter::compile(), diff(), isReadOnly(), operator<<(), CCopasiXML::saveModelParameter(), and updateModel().
const CExpression * CModelParameter::getInitialExpressionPtr | ( | ) | const |
Retrieve the actual initial expression.
Definition at line 282 of file CModelParameter.cpp.
References mpInitialExpression.
Referenced by CQParameterOverviewDM::assignmentData().
CModel * CModelParameter::getModel | ( | ) | const |
Retrieve a pointer to the model the parameter is part of
Definition at line 363 of file CModelParameter.cpp.
References CModelParameterSet::getModel(), and getSet().
Referenced by compile(), CModelParameterReactionParameter::compile(), getUnit(), isReadOnly(), CModelParameterSpecies::setValue(), and updateModel().
|
virtual |
Retrieve the name of the parameter.
Reimplemented in CModelParameterSpecies, and CModelParameterSet.
Definition at line 381 of file CModelParameter.cpp.
References CCopasiObject::getObjectName(), mCN, mpObject, and nameFromCN().
Referenced by CQParameterOverviewDM::assignmentData(), getUnit(), CQParameterOverviewDM::nameData(), refreshFromModel(), and CModelParameterSet::saveToStream().
|
virtual |
Reimplemented in CModelParameterGroup.
Definition at line 667 of file CModelParameter.cpp.
Referenced by applyValueToModelParameter().
CCopasiObject * CModelParameter::getObject | ( | ) | const |
Retrieve the pointer to the corresponding model object
Definition at line 336 of file CModelParameter.cpp.
References mpObject.
Referenced by diff().
CModelParameterGroup * CModelParameter::getParent | ( | ) | const |
Retrieve the parent, i.e., containing group, of the parameter.
Definition at line 104 of file CModelParameter.cpp.
References mpParent.
Referenced by CQParameterOverviewDM::getRow(), getSet(), CQParameterOverviewDM::index(), and CQParameterOverviewDM::parent().
CModelParameterSet * CModelParameter::getSet | ( | ) | const |
Retrieve a pointer to the parameter set the parameter belongs to
Definition at line 341 of file CModelParameter.cpp.
References getParent(), getType(), mpParent, mType, and Set.
Referenced by CQParameterOverviewDM::assignmentData(), CModelParameterSpecies::compile(), CModelParameterReactionParameter::compile(), getModel(), CModelParameterSpecies::getName(), refreshFromModel(), CQParameterOverviewDM::setData(), setInitialExpression(), and setValue().
const CModelEntity::Status & CModelParameter::getSimulationType | ( | ) | const |
Retrieve the role the parameters object plays in the simulation
Definition at line 242 of file CModelParameter.cpp.
References mSimulationType.
Referenced by CCopasiXML::saveModelParameter(), and CQParameterOverviewDM::typeData().
const CModelParameter::Type & CModelParameter::getType | ( | ) | const |
Retrieve the type of the parameter
Definition at line 109 of file CModelParameter.cpp.
References mType.
Referenced by CQParameterOverviewDM::assignmentData(), CModelParameterGroup::copy(), CModelParameterGroup::diff(), CQParameterOverviewDM::diffData(), CQParameterOverviewDM::flags(), getSet(), CQParameterOverviewDM::rowCount(), CCopasiXML::saveModelParameter(), CModelParameterSet::saveToStream(), CQParameterOverviewDM::typeData(), and CQParameterOverviewDM::valueData().
const std::string CModelParameter::getUnit | ( | const Framework & | framework | ) | const |
Retrieve the unit of the parameter based on the current framework
const | Framework & framework (default: ParticleNumbers) |
Definition at line 114 of file CModelParameter.cpp.
References Compartment, Concentration, CModel::dimensionlessArea, CModel::dimensionlessLength, CModel::dimensionlessQuantity, CModel::dimensionlessTime, CModel::dimensionlessVolume, CModel::getAreaUnitEnum(), CReaction::getChemEq(), CCompartment::getChildObjectUnits(), CMetab::getChildObjectUnits(), CReaction::getCompartmentNumber(), CReaction::getFunction(), CMetab::getInitialConcentrationReference(), CModelEntity::getInitialValueReference(), CModel::getLengthUnitEnum(), getModel(), getName(), CReaction::getParameterIndex(), CModel::getQuantityUnitEnum(), CModel::getTimeUnitEnum(), CModel::getTimeUnitsDisplayString(), CModel::getVolumeUnitEnum(), Model, ModelValue, mpObject, mType, ReactionParameter, CFindDimensions::setUseHeuristics(), and Species.
Referenced by CModelParameterSet::saveToStream(), and CQParameterOverviewDM::unitData().
Retrieve the value of the parameter based on the current framework
const | Framework & framework |
Reimplemented in CModelParameterSpecies.
Definition at line 261 of file CModelParameter.cpp.
References mValue.
Referenced by CModelParameterReactionParameter::compile(), diff(), refreshFromModel(), CCopasiXML::saveModelParameter(), CModelParameterSet::saveToStream(), CModelParameterSpecies::setValue(), and CQParameterOverviewDM::valueData().
bool CModelParameter::isInitialExpressionValid | ( | ) | const |
Check whether the initial expression is valid, i.e., it compiled
Definition at line 375 of file CModelParameter.cpp.
References mIsInitialExpressionValid.
bool CModelParameter::isReadOnly | ( | ) | const |
Check whether the value is read only.
Definition at line 322 of file CModelParameter.cpp.
References getInitialExpression(), getModel(), Group, mIsInitialExpressionValid, Model, mType, Reaction, and Set.
Referenced by CQParameterOverviewDM::flags().
|
staticprotected |
Determine the parameter name based on the CN of the corresponding object
const | CCopasiObjectName & cn |
Definition at line 39 of file CModelParameter.cpp.
References CCopasiObjectName::getElementName(), CCopasiObjectName::getObjectName(), CCopasiObjectName::getPrimary(), and CCopasiObjectName::getRemainder().
Referenced by getName(), and CModelParameterSpecies::getName().
|
virtual |
Refresh the parameter from the corresponding model object
const | bool & modifyExistence |
Reimplemented in CModelParameterGroup.
Definition at line 561 of file CModelParameter.cpp.
References CModelEntity::ASSIGNMENT, Compartment, CModelEntity::FIXED, CKeyFactory::get(), CModelEntity::getInitialValue(), CCopasiRootContainer::getKeyFactory(), CModelParameterGroup::getModelParameter(), getName(), CReaction::getParameterMapping(), getSet(), getValue(), CCopasiParameter::getValue(), Identical, CModel::isAutonomous(), CReaction::isLocalParameter(), mCompareResult, Missing, Model, ModelValue, mpObject, mSimulationType, mType, mValue, Obsolete, ParticleNumbers, CCopasiParameter::Value::pDOUBLE, ReactionParameter, and Species.
Referenced by CQParameterOverviewWidget::slotResolve().
|
virtual |
Set the CN of the object represented by the parameter
const | CCopasiObjectName & cn |
Reimplemented in CModelParameterSpecies.
Definition at line 194 of file CModelParameter.cpp.
References mCN.
Referenced by CModelParameterSet::createFromModel(), CModelParameterSpecies::setCN(), CCopasiXMLParser::ModelParameterElement::start(), and CCopasiXMLParser::ModelParameterGroupElement::start().
void CModelParameter::setCompareResult | ( | const CompareResult & | compareResult | ) |
The the compare result.
const | CompareResult & compareResult |
Definition at line 297 of file CModelParameter.cpp.
References mCompareResult.
Referenced by CModelParameterGroup::diff().
void CModelParameter::setInitialExpression | ( | const std::string & | initialExpression | ) |
Set the initial expression infix.
const | std::string & initialExpression |
Definition at line 266 of file CModelParameter.cpp.
References getSet(), mpInitialExpression, pdelete, and CExpression::setInfix().
Referenced by CModelParameter(), CModelParameterSet::createFromModel(), CCopasiXMLParser::ModelParameterElement::end(), 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 |
Definition at line 99 of file CModelParameter.cpp.
References mpParent.
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 |
Definition at line 204 of file CModelParameter.cpp.
References CModelEntity::ASSIGNMENT, Compartment, CModelEntity::FIXED, Model, ModelValue, mSimulationType, mType, ReactionParameter, CModelEntity::REACTIONS, Species, and CModelEntity::TIME.
Referenced by CModelParameterReactionParameter::compile(), CModelParameterSet::createFromModel(), and CCopasiXMLParser::ModelParameterElement::start().
Set the value of the parameter based on the current framework
const | double & value |
const | Framework & framework |
Definition at line 248 of file CModelParameter.cpp.
References getSet(), CModelParameterSet::isActive(), mValue, and updateModel().
Referenced by applyValueToModelParameter(), CModelParameterSet::createFromModel(), CQParameterOverviewDM::setData(), and CCopasiXMLParser::ModelParameterElement::start().
|
virtual |
Update the corresponding model object with the current parameter settings
Reimplemented in CModelParameterGroup, and CModelParameterSet.
Definition at line 474 of file CModelParameter.cpp.
References CModelEntity::ASSIGNMENT, C_FLOAT64, Compartment, getInitialExpression(), CCopasiParameter::getKey(), CCopasiObject::getKey(), getModel(), CCopasiObject::getObjectAncestor(), CCopasiObject::getObjectDataModel(), CCopasiObject::getObjectName(), CCopasiObject::getObjectParent(), CEvaluationTree::getRoot(), CModelEntity::getStatus(), CCopasiObject::getValuePointer(), CModel::isAutonomous(), mIsInitialExpressionValid, Model, ModelValue, mpInitialExpression, mpObject, mpParent, mType, mValue, CCopasiDataModel::ObjectFromName(), ReactionParameter, CModelEntity::setInitialExpression(), CModelEntity::setInitialValue(), CReaction::setParameterMapping(), CCopasiParameter::setValue(), and Species.
Referenced by setValue().
|
friend |
Definition at line 862 of file CModelParameter.cpp.
|
protected |
The CN of the corresponding model object
Definition at line 274 of file CModelParameter.h.
Referenced by compile(), getCN(), getName(), CModelParameterSpecies::getName(), operator<<(), setCN(), and CModelParameterSpecies::setCN().
|
protected |
The result of the last compare
Definition at line 294 of file CModelParameter.h.
Referenced by CModelParameterGroup::diff(), diff(), getCompareResult(), operator<<(), CModelParameterGroup::refreshFromModel(), refreshFromModel(), and setCompareResult().
|
protected |
The result of the last compile of the initial expression. Note an empty or missing expression is valid.
Definition at line 305 of file CModelParameter.h.
Referenced by compile(), isInitialExpressionValid(), isReadOnly(), and updateModel().
|
protected |
A pointer to the initial expression
Definition at line 289 of file CModelParameter.h.
Referenced by compile(), getInitialExpression(), getInitialExpressionPtr(), setInitialExpression(), and updateModel().
|
protected |
A pointer to the corresponding model object. NULL if no object exists.
Definition at line 299 of file CModelParameter.h.
Referenced by compile(), diff(), getName(), CModelParameterSpecies::getName(), getObject(), getUnit(), refreshFromModel(), and updateModel().
|
protected |
The parent group
Definition at line 264 of file CModelParameter.h.
Referenced by CModelParameter(), CModelParameterReactionParameter::compile(), getIndex(), getParent(), getSet(), setParent(), updateModel(), and ~CModelParameter().
|
protected |
The role the parameter object is used in the simulation.
Definition at line 279 of file CModelParameter.h.
Referenced by getSimulationType(), refreshFromModel(), and setSimulationType().
|
protected |
The type
Definition at line 269 of file CModelParameter.h.
Referenced by CModelParameter(), compile(), diff(), getSet(), getType(), getUnit(), isReadOnly(), operator<<(), refreshFromModel(), setSimulationType(), and updateModel().
|
protected |
The value of the parameter
Definition at line 284 of file CModelParameter.h.
Referenced by CModelParameterSpecies::compile(), CModelParameterReactionParameter::compile(), getValue(), CModelParameterSpecies::getValue(), operator<<(), refreshFromModel(), setValue(), CModelParameterCompartment::setValue(), CModelParameterSpecies::setValue(), and updateModel().
|
static |
Definition at line 39 of file CModelParameter.h.
Referenced by operator<<(), CCopasiXML::saveModelParameter(), CCopasiXMLParser::ModelParameterElement::start(), and CCopasiXMLParser::ModelParameterGroupElement::start().