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

#include <CModelParameter.h>

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

Public Member Functions

void addSpecies (CModelParameterSpecies *pSpecies)
 
 CModelParameterCompartment (CModelParameterGroup *pParent, const CModelParameter::Type &type=CModelParameter::Compartment)
 
 CModelParameterCompartment (const CModelParameterCompartment &src, CModelParameterGroup *pParent)
 
void removeSpecies (CModelParameterSpecies *pSpecies)
 
virtual void setValue (const C_FLOAT64 &value, const Framework &framework)
 
virtual ~CModelParameterCompartment ()
 
- Public Member Functions inherited from CModelParameter
 CModelParameter (CModelParameterGroup *pParent, const CModelParameter::Type &type)
 
 CModelParameter (const CModelParameter &src, CModelParameterGroup *pParent)
 
virtual void compile ()
 
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

std::set
< CModelParameterSpecies * > 
mSpecies
 

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

Constructor & Destructor Documentation

CModelParameterCompartment::CModelParameterCompartment ( CModelParameterGroup pParent,
const CModelParameter::Type type = CModelParameter::Compartment 
)

Constructor

Definition at line 678 of file CModelParameter.cpp.

678  :
679  CModelParameter(pParent, type),
680  mSpecies()
681 {}
std::set< CModelParameterSpecies * > mSpecies
CModelParameterCompartment::CModelParameterCompartment ( const CModelParameterCompartment src,
CModelParameterGroup pParent 
)

Copy constructor

Definition at line 683 of file CModelParameter.cpp.

683  :
684  CModelParameter(src, pParent),
685  mSpecies()
686 {}
std::set< CModelParameterSpecies * > mSpecies
CModelParameterCompartment::~CModelParameterCompartment ( )
virtual

Destructor

Definition at line 689 of file CModelParameter.cpp.

References mSpecies.

690 {
691  // If a compartment is deleted all contained species are not deleted however
692  // their compartment is set to NULL.
693  std::set< CModelParameterSpecies * >::iterator it = mSpecies.begin();
694  std::set< CModelParameterSpecies * >::iterator end = mSpecies.end();
695 
696  for (; it != end; ++it)
697  {
698  (*it)->mpCompartment = NULL;
699  }
700 }
std::set< CModelParameterSpecies * > mSpecies

Member Function Documentation

void CModelParameterCompartment::addSpecies ( CModelParameterSpecies pSpecies)

Add a pointer to a species parameter to the compartment

Definition at line 727 of file CModelParameter.cpp.

References mSpecies.

Referenced by CModelParameterSpecies::compile().

728 {
729  mSpecies.insert(pSpecies);
730 }
std::set< CModelParameterSpecies * > mSpecies
void CModelParameterCompartment::removeSpecies ( CModelParameterSpecies pSpecies)

Remove a pointer to a species parameter from the compartment

Definition at line 732 of file CModelParameter.cpp.

References mSpecies.

Referenced by CModelParameterSpecies::~CModelParameterSpecies().

733 {
734  mSpecies.erase(pSpecies);
735 }
std::set< CModelParameterSpecies * > mSpecies
void CModelParameterCompartment::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 703 of file CModelParameter.cpp.

References CVectorCore< CType >::array(), C_FLOAT64, mSpecies, and CModelParameter::mValue.

704 {
705  CVector< C_FLOAT64 > SpeciesValues(mSpecies.size());
706  C_FLOAT64 * pSpeciesValue = SpeciesValues.array();
707 
708  std::set< CModelParameterSpecies * >::iterator it = mSpecies.begin();
709  std::set< CModelParameterSpecies * >::iterator end = mSpecies.end();
710 
711  for (; it != end; ++it, ++pSpeciesValue)
712  {
713  *pSpeciesValue = (*it)->getValue(framework);
714  }
715 
716  mValue = value;
717 
718  pSpeciesValue = SpeciesValues.array();
719  it = mSpecies.begin();
720 
721  for (; it != end; ++it, ++pSpeciesValue)
722  {
723  (*it)->setValue(*pSpeciesValue, framework);
724  }
725 }
std::set< CModelParameterSpecies * > mSpecies
#define C_FLOAT64
Definition: copasi.h:92
CType * array()
Definition: CVector.h:139

Member Data Documentation

std::set< CModelParameterSpecies * > CModelParameterCompartment::mSpecies
private

The set of species parameters which are contained in the compartment

Definition at line 350 of file CModelParameter.h.

Referenced by addSpecies(), removeSpecies(), setValue(), and ~CModelParameterCompartment().


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