COPASI API  4.40.278
CModelParameterSet Class Reference

#include <CModelParameterSet.h>

Inheritance diagram for CModelParameterSet:
[legend]

Public Member Functions

virtual void add (CModelParameter *pModelParameter)
 
virtual bool applyData (const CData &data, CUndoData::CChangeSet &changes)
 
void assignSetContent (const CModelParameterSet &src, const bool &createMissing)
 
const_iterator begin () const
 
 CModelParameterSet (const CModelParameterSet &src, const CDataContainer *pParent, const bool &createMissing=false)
 
 CModelParameterSet (const std::string &name, const CDataContainer *pParent=NO_PARENT)
 
bool compareWithModel (const CCore::Framework &framework)
 
virtual void compile ()
 
void createFromModel ()
 
virtual void createUndoData (CUndoData &undoData, const CUndoData::Type &type, const CData &oldData=CData(), const CCore::Framework &framework=CCore::Framework::ParticleNumbers) const
 
virtual void destruct ()
 
const CompareResultdiff (const CModelParameterSet &other, const CCore::Framework &framework, const bool &createMissing=false)
 
const_iterator end () const
 
virtual CCommonName getCN () const
 
virtual size_t getIndex () const
 
virtual const std::string & getKey () const
 
CModelgetModel () const
 
const CModelParametergetModelParameter (const std::string &cn) const
 
virtual std::string getName () const
 
virtual CUndoObjectInterfaceinsert (const CData &data)
 
bool isActive () const
 
virtual bool refreshFromModel (const bool &modifyExistence)
 
bool saveToStream (std::ostream &os, const CCore::Framework &framework, const std::string &mode, const std::string &separator)
 
void setModel (const CModel *pModel)
 
virtual bool setObjectParent (const CDataContainer *pParent)
 
virtual CData toData () const
 
CModelParameterGrouptoGroup ()
 
const CModelParameterGrouptoGroup () const
 
virtual CModelParameterSettoSet ()
 
virtual const CModelParameterSettoSet () const
 
virtual void updateIndex (const size_t &index, const CUndoObjectInterface *pUndoObject)
 
virtual bool updateModel ()
 
virtual ~CModelParameterSet ()
 
- 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)
 
virtual std::string getChildObjectUnits (const CDataObject *pObject) const
 
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 const std::string getUnits () const override
 
virtual const CDataObjectgetValueObject () const 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 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
 
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 ~CUndoObjectInterface ()
 
- Public Member Functions inherited from CModelParameterGroup
CModelParameteradd (const CModelParameter::Type &type)
 
void assignGroupContent (const CModelParameterGroup &src, const bool &createMissing)
 
iterator begin ()
 
const_iterator begin () const
 
void clear ()
 
 CModelParameterGroup (CModelParameterGroup *pParent, const CModelParameter::Type &type=CModelParameter::Type::Group)
 
 CModelParameterGroup (const CModelParameterGroup &src, CModelParameterGroup *pParent, const bool &createMissing)
 
virtual const CompareResultdiff (const CModelParameter &other, const CCore::Framework &framework, const bool &createMissing=false)
 
iterator end ()
 
const_iterator end () const
 
virtual const CModelParametergetChild (const size_t &index) const
 
CModelParametergetModelParameter (const std::string &cn) const
 
CModelParametergetModelParameter (const std::string &name, const CModelParameter::Type &type) const
 
virtual size_t getNumChildren () const
 
const CValidatedUnitgetObjectUnit (const CModelParameter *pModelParameter) const
 
void remove (CModelParameter *pModelParameter)
 
void remove (const size_t &index)
 
size_t size () const
 
virtual ~CModelParameterGroup ()
 
- Public Member Functions inherited from CModelParameter
 CModelParameter (CModelParameterGroup *pParent, const CModelParameter::Type &type)
 
 CModelParameter (const CModelParameter &src, CModelParameterGroup *pParent)
 
const CCommonNamegetCN () const
 
const CompareResultgetCompareResult () const
 
std::string getInitialExpression () const
 
const CExpressiongetInitialExpressionPtr () const
 
CModelgetModel () 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 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 ~CModelParameter ()
 
- 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 CModelParameterSetfromData (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 CModelParameter
static CModelParameterfromData (const CData &data, CUndoObjectInterface *pParent)
 
- 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)
 

Private Member Functions

void init ()
 

Private Attributes

std::string mKey
 
CModelParameterGroupmpCompartments
 
CModelmpModel
 
CModelParameterGroupmpModelValues
 
CModelParameterGroupmpReactions
 
CModelParameterGroupmpSpecies
 
CModelParameterGroupmpTimes
 

Additional Inherited Members

- 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 CModelParameterGroup
typedef std::vector< CModelParameter * >::const_iterator const_iterator
 
typedef std::vector< CModelParameter * >::iterator iterator
 
- Public Types inherited from CModelParameter
enum class  CompareResult {
  Obsolete , Missing , Modified , Conflict ,
  Identical , __SIZE
}
 
enum class  Type {
  Model , Compartment , Species , ModelValue ,
  ReactionParameter , Reaction , Group , Set ,
  unknown , __SIZE
}
 
- Public Types inherited from CAnnotation
typedef std::map< std::string, std::string > UnsupportedAnnotation
 
- Static Public Attributes inherited from CDataContainer
static const CObjectInterface::ContainerList EmptyList
 
- Static Public Attributes inherited from CModelParameter
static const CEnumAnnotation< std::string, CompareResultCompareResultNames
 
static const CEnumAnnotation< std::string, TypeTypeNames
 
- 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 Member Functions inherited from CModelParameterGroup
CModelParametercopy (const CModelParameter &src, const bool &createMissing)
 
- 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 CModelParameter
CRegisteredCommonName mCN
 
CompareResult mCompareResult
 
bool mIsInitialExpressionValid
 
CExpressionmpInitialExpression
 
CDataObjectmpObject
 
CModelParameterGroupmpParent
 
CModelEntity::Status mSimulationType
 
Type mType
 
double mValue
 
- Protected Attributes inherited from CAnnotation
std::string mKey
 

Constructor & Destructor Documentation

◆ CModelParameterSet() [1/2]

CModelParameterSet::CModelParameterSet ( const std::string &  name,
const CDataContainer pParent = NO_PARENT 
)

◆ CModelParameterSet() [2/2]

CModelParameterSet::CModelParameterSet ( const CModelParameterSet src,
const CDataContainer pParent,
const bool &  createMissing = false 
)

◆ ~CModelParameterSet()

CModelParameterSet::~CModelParameterSet ( )
virtual

Member Function Documentation

◆ add()

void CModelParameterSet::add ( CModelParameter pModelParameter)
virtual

Add the given parameter to the group. Note, the parent of the parameter is not updated

Parameters
CModelParameter* pModelParameter

Reimplemented from CModelParameterGroup.

References CModelParameterGroup::add(), CModelParameter::getCN(), getCN(), CDataObject::getCN(), CModelParameter::getType(), CModelParameter::Group, mpCompartments, mpModelValues, mpReactions, mpSpecies, mpTimes, and pdelete.

◆ applyData()

bool CModelParameterSet::applyData ( const CData data,
CUndoData::CChangeSet changes 
)
virtual

Apply the provided data to the object

Parameters
constCData & data
Returns
bool success

Reimplemented from CDataContainer.

References CAnnotation::applyData(), CModelParameterGroup::applyData(), and CDataContainer::applyData().

◆ assignSetContent()

void CModelParameterSet::assignSetContent ( const CModelParameterSet src,
const bool &  createMissing 
)

Assign the content of the source set to this, i.e., copy all contained parameters and groups.

Parameters
constCModelParameterSet & src
constbool & createMissing

References CModelParameterGroup::assignGroupContent(), compile(), getCN(), getModelParameter(), mpCompartments, mpModelValues, mpReactions, mpSpecies, and mpTimes.

Referenced by ModelHandler::processEnd().

◆ begin()

CModelParameterGroup::const_iterator CModelParameterSet::begin ( ) const

Retrieve the const_iterator pointing to the first contained parameter.

Returns
const_iterator begin

References CModelParameterGroup::begin().

Referenced by CCopasiXML::saveModelParameterSets().

◆ compareWithModel()

bool CModelParameterSet::compareWithModel ( const CCore::Framework framework)

Compare the parameter set with the assigned model

References createFromModel(), diff(), CModelParameter::Identical, and mpModel.

◆ compile()

void CModelParameterSet::compile ( )
virtual

Compile the parameter

Reimplemented from CModelParameterGroup.

References CModelParameterGroup::compile().

Referenced by assignSetContent(), CModelParameterSet(), createFromModel(), and updateModel().

◆ createFromModel()

◆ createUndoData()

void CModelParameterSet::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 CDataContainer.

References CAnnotation::createUndoData(), CModelParameterGroup::createUndoData(), and CDataContainer::createUndoData().

◆ destruct()

void CModelParameterSet::destruct ( )
virtual

Destruct the object

Reimplemented from CDataObject.

◆ diff()

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

Compare the parameter to an other

Parameters
constCModelParameterSet & other
constCCore::Framework & framework
constbool & createMissing = false

References CModelParameterGroup::diff().

Referenced by compareWithModel(), and CDataModel::loadModelParameterSets().

◆ end()

CModelParameterGroup::const_iterator CModelParameterSet::end ( ) const

Retrieve the const_iterator pointing past the last contained parameter.

Returns
const_iterator end

References CModelParameterGroup::end().

Referenced by CCopasiXML::saveModelParameterSets().

◆ fromData()

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

Static method to create a CDataObject based on the provided data

Parameters
constCData & data
Returns
CModelParameterSet * pDataObject

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

◆ getCN()

CCommonName CModelParameterSet::getCN ( ) const
virtual

Retrieve the CN of the object

Returns
CCommonName

Reimplemented from CDataObject.

References CDataObject::getCN().

Referenced by add(), assignSetContent(), and CModelParameterSet().

◆ getIndex()

size_t CModelParameterSet::getIndex ( ) const
virtual

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

Returns
size_t index

Reimplemented from CModelParameter.

References C_INVALID_INDEX, CDataContainer::getIndex(), and CDataObject::getObjectParent().

◆ getKey()

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

Retrieve the unique key of the set.

Returns
const std::string & key

Reimplemented from CAnnotation.

References mKey.

Referenced by CModel::applyActiveParameterSet(), isActive(), ModelParameterSetHandler::processEnd(), and CCopasiXML::saveModelParameterSets().

◆ getModel()

CModel * CModelParameterSet::getModel ( ) const

Retrieve the model the parameter set is storing values for

Returns
CModel * pModel

References mpModel.

Referenced by CModelParameterSet(), CModelParameter::getModel(), and CModelParameterSpecies::getName().

◆ getModelParameter()

const CModelParameter * CModelParameterSet::getModelParameter ( const std::string &  cn) const

Retrieve a pointer to the parameter with the given CN

Parameters
conststd::string & cn
Returns
const CModelParameter * pModelParameter

References CModelParameterGroup::getModelParameter().

Referenced by applyValueToParameterSet(), assignSetContent(), CUndoData::getObject(), and CModelParameter::refreshFromModel().

◆ getName()

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

Retrieve the name of the parameter set

Returns
std::string name

Reimplemented from CModelParameter.

References CDataObject::getObjectName().

◆ init()

void CModelParameterSet::init ( )
private

◆ insert()

◆ isActive()

bool CModelParameterSet::isActive ( ) const

Determine whether this is parameter set is currently active, i.e., it is synchronized with the model.

Returns
bool isActive

References CModel::getActiveModelParameterSet(), getKey(), mKey, and mpModel.

Referenced by CModelParameter::setValue(), CModelParameterCompartment::setValue(), and CModelParameterSpecies::setValue().

◆ refreshFromModel()

bool CModelParameterSet::refreshFromModel ( const bool &  modifyExistence)
virtual

Refresh the parameter from the corresponding model object

Parameters
constbool & modifyExistence

Reimplemented from CModelParameterGroup.

References CModelParameterGroup::refreshFromModel().

Referenced by CModel::refreshActiveParameterSet(), CDataModel::saveModel(), and CDataModel::saveModelToString().

◆ saveToStream()

bool CModelParameterSet::saveToStream ( std::ostream &  os,
const CCore::Framework framework,
const std::string &  mode,
const std::string &  separator 
)

◆ setModel()

void CModelParameterSet::setModel ( const CModel pModel)

Set the model the parameter set is storing values for

Parameters
constCModel * pModel

◆ setObjectParent()

bool CModelParameterSet::setObjectParent ( const CDataContainer pParent)
virtual

Set the object parent

Parameters
constCDataContainer * pParent
Returns
bool success

Reimplemented from CDataObject.

References CDataObject::getObjectAncestor(), mpModel, and CDataObject::setObjectParent().

Referenced by CModelParameterSet().

◆ toData()

CData CModelParameterSet::toData ( ) const
virtual

Retrieve the data describing the object

Returns
CData data

Reimplemented from CDataContainer.

References CData::appendData(), CAnnotation::toData(), CModelParameterGroup::toData(), and CDataContainer::toData().

◆ toGroup() [1/2]

◆ toGroup() [2/2]

const CModelParameterGroup * CModelParameterSet::toGroup ( ) const

◆ toSet() [1/2]

CModelParameterSet * CModelParameterSet::toSet ( )
virtual

Reimplemented from CModelParameter.

◆ toSet() [2/2]

const CModelParameterSet * CModelParameterSet::toSet ( ) const
virtual

Reimplemented from CModelParameter.

◆ updateIndex()

void CModelParameterSet::updateIndex ( const size_t &  index,
const CUndoObjectInterface pUndoObject 
)
virtual

Update the index of a contained object This method needs to be re-implemented in container which care about the order of contained objects

Parameters
constsize_t & index
constCUndoObjectInterface * pUndoObject

Reimplemented from CModelParameterGroup.

References CUndoObjectInterface::updateIndex().

◆ updateModel()

bool CModelParameterSet::updateModel ( )
virtual

Update the corresponding model object with the current parameter settings

Reimplemented from CModelParameterGroup.

References compile(), mpModel, CCore::ParticleNumbers, CModel::updateInitialValues(), and CModelParameterGroup::updateModel().

Referenced by CModel::applyActiveParameterSet(), CDataModel::commonAfterLoad(), and SEDMLImporter::importModel().

Member Data Documentation

◆ mKey

std::string CModelParameterSet::mKey
private

The unique key of the set

Referenced by CModelParameterSet(), getKey(), isActive(), and ~CModelParameterSet().

◆ mpCompartments

CModelParameterGroup* CModelParameterSet::mpCompartments
private

◆ mpModel

CModel* CModelParameterSet::mpModel
private

A pointer to the model the parameter set is storing values for

Referenced by CModelParameterSet(), compareWithModel(), createFromModel(), getModel(), isActive(), setObjectParent(), and updateModel().

◆ mpModelValues

CModelParameterGroup* CModelParameterSet::mpModelValues
private

◆ mpReactions

CModelParameterGroup* CModelParameterSet::mpReactions
private

◆ mpSpecies

CModelParameterGroup* CModelParameterSet::mpSpecies
private

◆ mpTimes

CModelParameterGroup* CModelParameterSet::mpTimes
private

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