COPASI API  4.40.278
CModelParameter Class Reference

#include <CModelParameter.h>

Inheritance diagram for CModelParameter:
[legend]

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 CompareResultdiff (const CModelParameter &other, const CCore::Framework &framework=CCore::Framework::ParticleNumbers, const bool &createMissing=false)
 
virtual const CModelParametergetChild (const size_t &index) const
 
const CCommonNamegetCN () const
 
const CompareResultgetCompareResult () const
 
virtual size_t getIndex () const
 
std::string getInitialExpression () const
 
const CExpressiongetInitialExpressionPtr () const
 
CModelgetModel () const
 
virtual std::string getName () const
 
virtual size_t getNumChildren () const
 
CDataObjectgetObject () const
 
CModelParameterGroupgetParent () const
 
CModelParameterSetgetSet () const
 
const CModelEntity::StatusgetSimulationType () const
 
const TypegetType () 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 CModelParameterSettoSet ()
 
virtual const CModelParameterSettoSet () 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 CUndoObjectInterfaceinsert (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 CModelParameterfromData (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, CompareResultCompareResultNames
 
static const CEnumAnnotation< std::string, TypeTypeNames
 

Protected Attributes

CRegisteredCommonName mCN
 
CompareResult mCompareResult
 
bool mIsInitialExpressionValid
 
CExpressionmpInitialExpression
 
CDataObjectmpObject
 
CModelParameterGroupmpParent
 
CModelEntity::Status mSimulationType
 
Type mType
 
double mValue
 

Private Member Functions

 CModelParameter ()
 

Friends

std::ostream & operator<< (std::ostream &os, const CModelParameter &o)
 

Member Enumeration Documentation

◆ CompareResult

Enumerator
Obsolete 
Missing 
Modified 
Conflict 
Identical 
__SIZE 

◆ Type

enum CModelParameter::Type
strong
Enumerator
Model 
Compartment 
Species 
ModelValue 
ReactionParameter 
Reaction 
Group 
Set 
unknown 
__SIZE 

Constructor & Destructor Documentation

◆ CModelParameter() [1/3]

CModelParameter::CModelParameter ( )
private

The default constructor is hidden.

Referenced by CModelParameterGroup::add(), CModelParameterGroup::copy(), and fromData().

◆ CModelParameter() [2/3]

CModelParameter::CModelParameter ( CModelParameterGroup pParent,
const CModelParameter::Type type 
)

Constructor

◆ CModelParameter() [3/3]

CModelParameter::CModelParameter ( const CModelParameter src,
CModelParameterGroup pParent 
)

Copy constructor

References getInitialExpression(), mpParent, mType, Set, and setInitialExpression().

◆ ~CModelParameter()

CModelParameter::~CModelParameter ( )
virtual

Member Function Documentation

◆ applyData()

◆ compile()

◆ createUndoData()

◆ destruct()

void CModelParameter::destruct ( )
virtual

Destruct the object

Implements CUndoObjectInterface.

Reimplemented in CModelParameterSet.

◆ diff()

const CModelParameter::CompareResult & CModelParameter::diff ( const CModelParameter other,
const CCore::Framework framework = CCore::Framework::ParticleNumbers,
const bool &  createMissing = false 
)
virtual

Compare the parameter to an other

Parameters
constCModelParameter & other
constCCore::Framework & framework (default: ParticleNumbers)
constbool & 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.

◆ fromData()

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

◆ getChild()

const CModelParameter * CModelParameter::getChild ( const size_t &  index) const
virtual

Reimplemented in CModelParameterGroup.

◆ getCN()

const CCommonName & CModelParameter::getCN ( ) const

Retrieve the CN of the object represented by the parameter

Returns
const CCommonName & cn

References mCN.

Referenced by CModelParameterSet::add(), CModelParameterReactionParameter::compile(), createUndoData(), CCopasiXML::saveModelParameter(), and toData().

◆ getCompareResult()

const CModelParameter::CompareResult & CModelParameter::getCompareResult ( ) const

Retrieve the compare result.

Returns
const CompareResult & compareResult

References mCompareResult.

Referenced by CCopasiXML::saveModelParameter().

◆ getIndex()

size_t CModelParameter::getIndex ( ) const
virtual

Retrieve the index of the parameter in the vector of children in the parent

Returns
size_t index

Reimplemented in CModelParameterSet.

References CModelParameterGroup::begin(), C_INVALID_INDEX, CModelParameterGroup::end(), and mpParent.

Referenced by createUndoData(), and toData().

◆ getInitialExpression()

std::string CModelParameter::getInitialExpression ( ) const

◆ getInitialExpressionPtr()

const CExpression * CModelParameter::getInitialExpressionPtr ( ) const

Retrieve the actual initial expression.

Returns
const CExpression* initialExpression

References mpInitialExpression.

◆ getModel()

CModel * CModelParameter::getModel ( ) const

◆ getName()

std::string CModelParameter::getName ( ) const
virtual

Retrieve the name of the parameter.

Returns
std::string name

Reimplemented in CModelParameterSet, and CModelParameterSpecies.

References CDataObject::getObjectName(), mCN, mpObject, and CCommonName::nameFromCN().

Referenced by CModelParameterGroup::getObjectUnit(), and refreshFromModel().

◆ getNumChildren()

size_t CModelParameter::getNumChildren ( ) const
virtual

Reimplemented in CModelParameterGroup.

◆ getObject()

CDataObject * CModelParameter::getObject ( ) const

Retrieve the pointer to the corresponding model object

Returns
CDataObject * pObject

References mpObject.

Referenced by diff(), and CModelParameterGroup::getObjectUnit().

◆ getParent()

CModelParameterGroup * CModelParameter::getParent ( ) const

Retrieve the parent, i.e., containing group, of the parameter.

Returns
CModelParameterGroup * pParent

References mpParent.

Referenced by getSet().

◆ getSet()

◆ getSimulationType()

const CModelEntity::Status & CModelParameter::getSimulationType ( ) const

Retrieve the role the parameters object plays in the simulation

Returns
const CModelEntity::Status & simulationType

References mSimulationType.

Referenced by CCopasiXML::saveModelParameter().

◆ getType()

const CModelParameter::Type & CModelParameter::getType ( ) const

◆ getUnit()

◆ getValue()

const C_FLOAT64 & CModelParameter::getValue ( const CCore::Framework framework) const
virtual

Retrieve the value of the parameter based on the current framework

Parameters
constFramework & framework
Returns
const double & value

Reimplemented in CModelParameterSpecies.

References mValue.

Referenced by CModelParameterReactionParameter::compile(), diff(), refreshFromModel(), CCopasiXML::saveModelParameter(), and CModelParameterSpecies::setValue().

◆ isInitialExpressionValid()

bool CModelParameter::isInitialExpressionValid ( ) const

Check whether the initial expression is valid, i.e., it compiled

Returns
bool isInitialExpressionValid

References mIsInitialExpressionValid.

◆ isReadOnly()

bool CModelParameter::isReadOnly ( ) const

Check whether the value is read only.

Returns
bool isReadOnly

References getInitialExpression(), Group, mIsInitialExpressionValid, mType, Reaction, and Set.

◆ operator<()

bool CModelParameter::operator< ( const CModelParameter rhs) const

References mCN.

◆ refreshFromModel()

◆ setCN()

void CModelParameter::setCN ( const CCommonName cn)
virtual

◆ setCompareResult()

void CModelParameter::setCompareResult ( const CompareResult compareResult)

The the compare result.

Parameters
constCompareResult & compareResult

References mCompareResult.

Referenced by CModelParameterGroup::diff().

◆ setInitialExpression()

void CModelParameter::setInitialExpression ( const std::string &  initialExpression)

◆ setParent()

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.

Parameters
CModelParameterGroup* pParent

References mpParent.

Referenced by CModelParameterGroup::add(), and CModelParameterGroup::insert().

◆ setSimulationType()

bool CModelParameter::setSimulationType ( const CModelEntity::Status simulationType)

Set the role the parameters object plays in the simulation. Note, REACTION is only valid for species.

Parameters
constCModelEntity::Status & simulationType
Returns
bool success

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().

◆ setValue()

void CModelParameter::setValue ( const C_FLOAT64 value,
const CCore::Framework framework,
bool  updateModelIfActive = true 
)
virtual

Set the value of the parameter based on the current framework

Parameters
constdouble & value
constFramework & framework
updateModelIfActiveif 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().

◆ toData()

◆ toSet() [1/2]

CModelParameterSet * CModelParameter::toSet ( )
virtual

Reimplemented in CModelParameterSet.

Referenced by getSet().

◆ toSet() [2/2]

const CModelParameterSet * CModelParameter::toSet ( ) const
virtual

Reimplemented in CModelParameterSet.

◆ updateModel()

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const CModelParameter o 
)
friend

Member Data Documentation

◆ CompareResultNames

const CEnumAnnotation< std::string, CModelParameter::CompareResult > CModelParameter::CompareResultNames
static

◆ mCN

CRegisteredCommonName CModelParameter::mCN
protected

◆ mCompareResult

CompareResult CModelParameter::mCompareResult
protected

◆ mIsInitialExpressionValid

bool CModelParameter::mIsInitialExpressionValid
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().

◆ mpInitialExpression

CExpression* CModelParameter::mpInitialExpression
protected

◆ mpObject

CDataObject* CModelParameter::mpObject
protected

◆ mpParent

◆ mSimulationType

CModelEntity::Status CModelParameter::mSimulationType
protected

The role the parameter object is used in the simulation.

Referenced by applyData(), createUndoData(), getSimulationType(), refreshFromModel(), setSimulationType(), and toData().

◆ mType

◆ mValue

◆ TypeNames


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