COPASI API  4.16.103
Public Member Functions | Private Attributes | List of all members
CModelParameterReactionParameter Class Reference

#include <CModelParameter.h>

Inheritance diagram for CModelParameterReactionParameter:
Inheritance graph
[legend]
Collaboration diagram for CModelParameterReactionParameter:
Collaboration graph
[legend]

Public Member Functions

 CModelParameterReactionParameter (CModelParameterGroup *pParent, const CModelParameter::Type &type=CModelParameter::ReactionParameter)
 
 CModelParameterReactionParameter (const CModelParameterReactionParameter &src, CModelParameterGroup *pParent)
 
virtual void compile ()
 
const CRegisteredObjectNamegetGlobalQuantityCN () const
 
const CReactiongetReaction () const
 
void setGlobalQuantityCN (const std::string &globalQuantityCN)
 
virtual ~CModelParameterReactionParameter ()
 
- Public Member Functions inherited from CModelParameter
 CModelParameter (CModelParameterGroup *pParent, const CModelParameter::Type &type)
 
 CModelParameter (const CModelParameter &src, CModelParameterGroup *pParent)
 
virtual const CompareResultdiff (const CModelParameter &other, const CModelParameter::Framework &framework=ParticleNumbers, const bool &createMissing=false)
 
virtual const CModelParametergetChild (const size_t &index) const
 
const CCopasiObjectNamegetCN () const
 
const CompareResultgetCompareResult () const
 
size_t getIndex () const
 
std::string getInitialExpression () const
 
const CExpressiongetInitialExpressionPtr () const
 
CModelgetModel () const
 
virtual std::string getName () const
 
virtual size_t getNumChildren () const
 
CCopasiObjectgetObject () const
 
CModelParameterGroupgetParent () const
 
CModelParameterSetgetSet () const
 
const CModelEntity::StatusgetSimulationType () const
 
const TypegetType () 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 ()
 

Private Attributes

CRegisteredObjectName mGlobalQuantityCN
 
CModelParametermpGlobalQuantity
 
CReactionmpReaction
 

Additional Inherited Members

- Public Types inherited from CModelParameter
enum  CompareResult {
  Obsolete, Missing, Modified, Conflict,
  Identical
}
 
enum  Framework { Concentration = 0, ParticleNumbers }
 
enum  Type {
  Model, Compartment, Species, ModelValue,
  ReactionParameter, Reaction, Group, Set,
  unknown
}
 
- Static Public Attributes inherited from CModelParameter
static const char * TypeNames []
 
- Static Protected Member Functions inherited from CModelParameter
static std::string nameFromCN (const CCopasiObjectName &cn)
 
- Protected Attributes inherited from CModelParameter
CRegisteredObjectName mCN
 
CompareResult mCompareResult
 
bool mIsInitialExpressionValid
 
CExpressionmpInitialExpression
 
CCopasiObjectmpObject
 
CModelParameterGroupmpParent
 
CModelEntity::Status mSimulationType
 
Type mType
 
double mValue
 

Detailed Description

Definition at line 428 of file CModelParameter.h.

Constructor & Destructor Documentation

CModelParameterReactionParameter::CModelParameterReactionParameter ( CModelParameterGroup pParent,
const CModelParameter::Type type = CModelParameter::ReactionParameter 
)

Constructor

Definition at line 874 of file CModelParameter.cpp.

874  :
875  CModelParameter(pParent, type),
876  mpReaction(NULL),
878  mpGlobalQuantity(NULL)
879 {}
CRegisteredObjectName mGlobalQuantityCN
CModelParameterReactionParameter::CModelParameterReactionParameter ( const CModelParameterReactionParameter src,
CModelParameterGroup pParent 
)

Copy constructor

Definition at line 881 of file CModelParameter.cpp.

881  :
882  CModelParameter(src, pParent),
883  mpReaction(NULL),
885  mpGlobalQuantity(NULL)
886 {}
CRegisteredObjectName mGlobalQuantityCN
CModelParameterReactionParameter::~CModelParameterReactionParameter ( )
virtual

Destructor

Definition at line 889 of file CModelParameter.cpp.

890 {}

Member Function Documentation

void CModelParameterReactionParameter::compile ( )
virtual

Compile the parameter

Reimplemented from CModelParameter.

Definition at line 893 of file CModelParameter.cpp.

References CModelEntity::ASSIGNMENT, CModelParameter::compile(), CModelEntity::FIXED, CModelParameter::getCN(), CModelParameter::getInitialExpression(), CModelParameter::getModel(), CModelParameterGroup::getModelParameter(), CCopasiObject::getObjectDataModel(), CCopasiObjectName::getObjectType(), CCopasiObjectName::getPrimary(), CCopasiObjectName::getRemainder(), CModelParameter::getSet(), CModelParameter::getValue(), mGlobalQuantityCN, mpGlobalQuantity, CModelParameter::mpParent, mpReaction, CModelParameter::mValue, CCopasiDataModel::ObjectFromName(), CModelParameter::ParticleNumbers, and CModelParameter::setSimulationType().

Referenced by setGlobalQuantityCN().

894 {
896 
897  mGlobalQuantityCN = std::string();
898 
899  std::string Infix = getInitialExpression();
900 
901  if (Infix.length() > 2)
902  {
903  // Infix: <CN,Reference=InitialValue> or <CN,Reference=Value>
904  CCopasiObjectName Tmp = Infix.substr(1, Infix.length() - 2);
905  std::string Separator = "";
906 
907  for (; Tmp != ""; Tmp = Tmp.getRemainder())
908  {
909  CCopasiObjectName Primary = Tmp.getPrimary();
910 
911  if (Primary.getObjectType() == "Reference")
912  {
913  break;
914  }
915 
916  mGlobalQuantityCN += Separator + Primary;
917  Separator = ",";
918  }
919 
921  }
922  else
923  {
925  }
926 
928 
929  if (mpGlobalQuantity != NULL)
930  {
932  }
933 
934  std::vector< CCopasiContainer * > ListOfContainer;
935 
936  CModel * pModel = getModel();
937  ListOfContainer.push_back(pModel);
938 
939  mpReaction = static_cast< CReaction * >(pModel->getObjectDataModel()->ObjectFromName(ListOfContainer, mpParent->getCN()));
940 }
CCopasiDataModel * getObjectDataModel()
std::string getInitialExpression() const
CModelParameterGroup * mpParent
CCopasiObjectName getRemainder() const
CModelParameter * getModelParameter(const std::string &cn) const
std::string getObjectType() const
const CCopasiObjectName & getCN() const
CCopasiObjectName getPrimary() const
virtual void compile()
CModelParameterSet * getSet() const
CRegisteredObjectName mGlobalQuantityCN
virtual const double & getValue(const Framework &framework) const
Definition: CModel.h:50
bool setSimulationType(const CModelEntity::Status &simulationType)
CCopasiObject * ObjectFromName(const std::vector< CCopasiContainer * > &listOfContainer, const CCopasiObjectName &CN) const
CModel * getModel() const
const CRegisteredObjectName & CModelParameterReactionParameter::getGlobalQuantityCN ( ) const

Retrieve the CN of the assigned global quantity

Returns
const CRegisteredObjectName & globalQuantityCN

Definition at line 961 of file CModelParameter.cpp.

References mGlobalQuantityCN.

962 {
963  return mGlobalQuantityCN;
964 }
CRegisteredObjectName mGlobalQuantityCN
const CReaction * CModelParameterReactionParameter::getReaction ( ) const

Retrieve a pointer to the reaction the parameter belongs to.

Returns
const CReaction * reaction

Definition at line 942 of file CModelParameter.cpp.

References mpReaction.

943 {
944  return mpReaction;
945 }
void CModelParameterReactionParameter::setGlobalQuantityCN ( const std::string &  globalQuantityCN)

Set the CN of the assigned global quantity. If the CN is empty the assignment is removed.

Parameters
conststd::string & globalQuantityCN

Definition at line 947 of file CModelParameter.cpp.

References compile(), and CModelParameter::setInitialExpression().

948 {
949  if (globalQuantityCN == "")
950  {
952  }
953  else
954  {
955  setInitialExpression("<" + globalQuantityCN + ">");
956  }
957 
958  compile();
959 }
void setInitialExpression(const std::string &initialExpression)

Member Data Documentation

CRegisteredObjectName CModelParameterReactionParameter::mGlobalQuantityCN
private

The CN of the assigned global quantity.

Definition at line 479 of file CModelParameter.h.

Referenced by compile(), and getGlobalQuantityCN().

CModelParameter* CModelParameterReactionParameter::mpGlobalQuantity
private

A pointer to the parameter representing the assigned global quantity.

Definition at line 484 of file CModelParameter.h.

Referenced by compile().

CReaction* CModelParameterReactionParameter::mpReaction
private

A pointer to the reaction the parameter belongs to.

Definition at line 474 of file CModelParameter.h.

Referenced by compile(), and getReaction().


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