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

#include <CModelParameter.h>

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

Public Member Functions

 CModelParameterSpecies (CModelParameterGroup *pParent, const CModelParameter::Type &type=CModelParameter::Species)
 
 CModelParameterSpecies (const CModelParameterSpecies &src, CModelParameterGroup *pParent)
 
virtual void compile ()
 
virtual std::string getName () const
 
virtual const C_FLOAT64getValue (const Framework &framework) const
 
virtual void setCN (const CCopasiObjectName &cn)
 
virtual void setValue (const C_FLOAT64 &value, const Framework &framework)
 
virtual ~CModelParameterSpecies ()
 
- 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 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
 
bool isInitialExpressionValid () const
 
bool isReadOnly () const
 
virtual bool refreshFromModel (const bool &modifyExistence)
 
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 Member Functions

friend CModelParameterCompartment::~CModelParameterCompartment ()
 
CCopasiObjectName getCompartmentCN () const
 

Private Attributes

CRegisteredObjectName mCompartmentCN
 
C_FLOAT64 mConcentration
 
CModelParameterCompartmentmpCompartment
 

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 353 of file CModelParameter.h.

Constructor & Destructor Documentation

CModelParameterSpecies::CModelParameterCompartment::~CModelParameterCompartment ( )
private
CModelParameterSpecies::CModelParameterSpecies ( CModelParameterGroup pParent,
const CModelParameter::Type type = CModelParameter::Species 
)

Constructor

Definition at line 737 of file CModelParameter.cpp.

737  :
738  CModelParameter(pParent, type),
739  mCompartmentCN(),
740  mpCompartment(NULL),
741  mConcentration(std::numeric_limits< C_FLOAT64 >::quiet_NaN())
742 {}
CModelParameterCompartment * mpCompartment
CRegisteredObjectName mCompartmentCN
CModelParameterSpecies::CModelParameterSpecies ( const CModelParameterSpecies src,
CModelParameterGroup pParent 
)

Copy constructor

Definition at line 744 of file CModelParameter.cpp.

744  :
745  CModelParameter(src, pParent),
747  mpCompartment(NULL),
749 {}
CModelParameterCompartment * mpCompartment
CRegisteredObjectName mCompartmentCN
CModelParameterSpecies::~CModelParameterSpecies ( )
virtual

Destructor

Definition at line 752 of file CModelParameter.cpp.

References mpCompartment, and CModelParameterCompartment::removeSpecies().

753 {
754  if (mpCompartment != NULL)
755  {
757  }
758 }
CModelParameterCompartment * mpCompartment
void removeSpecies(CModelParameterSpecies *pSpecies)

Member Function Documentation

void CModelParameterSpecies::compile ( )
virtual

Compile the parameter

Reimplemented from CModelParameter.

Definition at line 774 of file CModelParameter.cpp.

References CModelParameterCompartment::addSpecies(), CModelParameter::compile(), CModelParameterGroup::getModelParameter(), CModelParameter::getSet(), mCompartmentCN, mpCompartment, CModelParameter::mValue, CModelParameter::ParticleNumbers, and setValue().

775 {
777 
779 
780  if (mpCompartment != NULL)
781  {
782  mpCompartment->addSpecies(this);
783  }
784 
785  // Update the concentration if possible
787 }
CModelParameterCompartment * mpCompartment
CModelParameter * getModelParameter(const std::string &cn) const
void addSpecies(CModelParameterSpecies *pSpecies)
virtual void compile()
CModelParameterSet * getSet() const
CRegisteredObjectName mCompartmentCN
virtual void setValue(const C_FLOAT64 &value, const Framework &framework)
CCopasiObjectName CModelParameterSpecies::getCompartmentCN ( ) const
private

Retrieve the CN of the compartment the species is contained in.

Returns
CCopasiObjectName compartmentCN

Definition at line 857 of file CModelParameter.cpp.

References mCompartmentCN.

858 {
859  return mCompartmentCN;
860 }
CRegisteredObjectName mCompartmentCN
std::string CModelParameterSpecies::getName ( ) const
virtual

Retrieve the name.

Returns
std::string name

Reimplemented from CModelParameter.

Definition at line 761 of file CModelParameter.cpp.

References CMetabNameInterface::getDisplayName(), CModelParameterSet::getModel(), CModelParameter::getSet(), CModelParameter::mCN, mCompartmentCN, CModelParameter::mpObject, and CModelParameter::nameFromCN().

762 {
763  CModel * pModel = getSet()->getModel();
764 
765  if (mpObject != NULL)
766  {
767  return CMetabNameInterface::getDisplayName(pModel, *static_cast< CMetab * >(mpObject), false);
768  }
769 
770  return nameFromCN(mCN) + '{' + nameFromCN(mCompartmentCN) + '}';
771 }
static std::string nameFromCN(const CCopasiObjectName &cn)
CCopasiObject * mpObject
static std::string getDisplayName(const CModel *model, const std::string &key, const bool &quoted)
CModelParameterSet * getSet() const
CRegisteredObjectName mCompartmentCN
Definition: CModel.h:50
CModel * getModel() const
CRegisteredObjectName mCN
const C_FLOAT64 & CModelParameterSpecies::getValue ( const Framework framework) const
virtual

Retrieve the value of the parameter based on the current framework

Parameters
constFramework & framework
Returns
const double & value

Reimplemented from CModelParameter.

Definition at line 847 of file CModelParameter.cpp.

References CModelParameter::Concentration, mConcentration, and CModelParameter::mValue.

848 {
849  if (framework == Concentration)
850  {
851  return mConcentration;
852  }
853 
854  return mValue;
855 }
void CModelParameterSpecies::setCN ( const CCopasiObjectName cn)
virtual

Set the CN of the object represented by the parameter

Parameters
constCCopasiObjectName & cn

Reimplemented from CModelParameter.

Definition at line 790 of file CModelParameter.cpp.

References CCopasiObjectName::getPrimary(), CCopasiObjectName::getRemainder(), CModelParameter::mCN, mCompartmentCN, and CModelParameter::setCN().

791 {
793 
794  // Determine the CN for the compartment.
795  // "CN=Root,Model=New Model,Vector=Compartments[compartment],Vector=Metabolites[A]"
796  CCopasiObjectName Tmp = mCN;
797  std::string Separator = "";
798 
799  for (; Tmp != ""; Tmp = Tmp.getRemainder())
800  {
801  CCopasiObjectName Primary = Tmp.getPrimary();
802  mCompartmentCN += Separator + Primary;
803  Separator = ",";
804 
805  if (Primary.getObjectType() == "Vector" &&
806  Primary.getObjectName() == "Compartments")
807  {
808  break;
809  }
810  }
811 }
CCopasiObjectName getRemainder() const
CCopasiObjectName getPrimary() const
CRegisteredObjectName mCompartmentCN
virtual void setCN(const CCopasiObjectName &cn)
CRegisteredObjectName mCN
void CModelParameterSpecies::setValue ( const C_FLOAT64 value,
const Framework framework 
)
virtual

Set the value of the parameter based on the current framework

Parameters
constdouble & value
constFramework & framework

Definition at line 814 of file CModelParameter.cpp.

References CModelParameter::Concentration, CModelParameter::getModel(), CModel::getNumber2QuantityFactor(), CModel::getQuantity2NumberFactor(), CModelParameter::getValue(), mConcentration, mpCompartment, CModelParameter::mValue, and CModelParameter::ParticleNumbers.

Referenced by compile().

815 {
816  CModel * pModel = getModel();
817 
818  if (framework == Concentration)
819  {
820  mConcentration = value;
821 
822  if (mpCompartment != NULL && pModel != NULL)
823  {
825  }
826  else
827  {
828  mValue = std::numeric_limits< C_FLOAT64 >::quiet_NaN();
829  }
830  }
831  else
832  {
833  mValue = value;
834 
835  if (mpCompartment != NULL && pModel != NULL)
836  {
838  }
839  else
840  {
841  mConcentration = std::numeric_limits< C_FLOAT64 >::quiet_NaN();
842  }
843  }
844 }
CModelParameterCompartment * mpCompartment
const C_FLOAT64 & getQuantity2NumberFactor() const
Definition: CModel.cpp:2354
const C_FLOAT64 & getNumber2QuantityFactor() const
Definition: CModel.cpp:2357
virtual const double & getValue(const Framework &framework) const
Definition: CModel.h:50
CModel * getModel() const

Member Data Documentation

CRegisteredObjectName CModelParameterSpecies::mCompartmentCN
private

The CN of the compartment the species is contained in.

Definition at line 415 of file CModelParameter.h.

Referenced by compile(), getCompartmentCN(), getName(), and setCN().

C_FLOAT64 CModelParameterSpecies::mConcentration
private

The concentration value of the species.

Definition at line 425 of file CModelParameter.h.

Referenced by getValue(), and setValue().

CModelParameterCompartment* CModelParameterSpecies::mpCompartment
private

A pointer to the parameter representing the compartment the species is contained in.

Definition at line 420 of file CModelParameter.h.

Referenced by compile(), setValue(), and ~CModelParameterSpecies().


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