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

#include <CMoiety.h>

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

Public Member Functions

void add (C_FLOAT64 value, CMetab *metabolite)
 
void cleanup ()
 
 CMoiety (const std::string &name="NoName", const CCopasiContainer *pParent=NULL)
 
 CMoiety (const CMoiety &src, const CCopasiContainer *pParent=NULL)
 
const C_FLOAT64dependentNumber ()
 
const C_FLOAT64getAmount () const
 
const C_FLOAT64getDependentNumber () const
 
CCopasiObjectgetDependentNumberReference () const
 
std::string getDescription (const CModel *model) const
 
const std::vector< std::pair
< C_FLOAT64, CMetab * > > & 
getEquation () const
 
std::string getExpression () const
 
CCopasiObjectgetInitialValueReference () const
 
virtual const std::string & getKey () const
 
C_FLOAT64 getNumber () const
 
CCopasiObjectgetTotalNumberReference () const
 
CCopasiObjectgetValueReference () const
 
void refreshAmount ()
 
void refreshDependentNumber ()
 
void refreshInitialValue ()
 
void refreshValue ()
 
virtual bool setObjectParent (const CCopasiContainer *pParent)
 
 ~CMoiety ()
 
- Public Member Functions inherited from CCopasiContainer
virtual bool add (CCopasiObject *pObject, const bool &adopt=true)
 
 CCopasiContainer (const std::string &name, const CCopasiContainer *pParent=NULL, const std::string &type="CN", const unsigned C_INT32 &flag=CCopasiObject::Container)
 
 CCopasiContainer (const CCopasiContainer &src, const CCopasiContainer *pParent=NULL)
 
virtual std::string getChildObjectUnits (const CCopasiObject *pObject) const
 
virtual const CObjectInterfacegetObject (const CCopasiObjectName &cn) const
 
virtual const objectMapgetObjects () const
 
virtual std::string getUnits () const
 
virtual const CCopasiObjectgetValueObject () const
 
virtual bool remove (CCopasiObject *pObject)
 
virtual ~CCopasiContainer ()
 
- Public Member Functions inherited from CCopasiObject
void addDirectDependency (const CCopasiObject *pObject)
 
 CCopasiObject (const CCopasiObject &src, const CCopasiContainer *pParent=NULL)
 
void clearDirectDependencies ()
 
void clearRefresh ()
 
bool dependsOn (DataObjectSet candidates, const DataObjectSet &context=DataObjectSet()) const
 
void getAllDependencies (DataObjectSet &dependencies, const DataObjectSet &context) const
 
virtual CCopasiObjectName getCN () const
 
virtual const DataObjectSetgetDirectDependencies (const DataObjectSet &context=DataObjectSet()) const
 
CCopasiContainergetObjectAncestor (const std::string &type) const
 
CCopasiDataModelgetObjectDataModel ()
 
const CCopasiDataModelgetObjectDataModel () const
 
virtual std::string getObjectDisplayName (bool regular=true, bool richtext=false) const
 
const std::string & getObjectName () const
 
CCopasiContainergetObjectParent () const
 
const std::string & getObjectType () const
 
virtual const
CObjectInterface::ObjectSet
getPrerequisites () const
 
virtual RefreshgetRefresh () const
 
UpdateMethodgetUpdateMethod () const
 
virtual voidgetValuePointer () const
 
bool hasCircularDependencies (DataObjectSet &candidates, DataObjectSet &verified, const DataObjectSet &context) const
 
bool hasUpdateMethod () const
 
bool isArray () const
 
bool isContainer () const
 
bool isDataModel () const
 
bool isMatrix () const
 
bool isNameVector () const
 
bool isNonUniqueName () const
 
virtual bool isPrerequisiteForContext (const CObjectInterface *pObject, const CMath::SimulationContextFlag &context, const CObjectInterface::ObjectSet &changedObjects) const
 
bool isReference () const
 
bool isRoot () const
 
bool isSeparator () const
 
bool isStaticString () const
 
bool isValueBool () const
 
bool isValueDbl () const
 
bool isValueInt () const
 
bool isValueInt64 () const
 
bool isValueString () const
 
bool isVector () const
 
virtual bool mustBeDeleted (const DataObjectSet &deletedObjects) const
 
virtual void print (std::ostream *ostream) const
 
void removeDirectDependency (const CCopasiObject *pObject)
 
void setDirectDependencies (const DataObjectSet &directDependencies)
 
bool setObjectName (const std::string &name)
 
void setObjectValue (const C_FLOAT64 &value)
 
void setObjectValue (const C_INT32 &value)
 
void setObjectValue (const bool &value)
 
template<class CType >
void setRefresh (CType *pType, void(CType::*method)(void))
 
template<class CType >
void setUpdateMethod (CType *pType, void(CType::*method)(const C_FLOAT64 &))
 
template<class CType >
void setUpdateMethod (CType *pType, void(CType::*method)(const C_INT32 &))
 
template<class CType >
void setUpdateMethod (CType *pType, void(CType::*method)(const bool &))
 
virtual ~CCopasiObject ()
 
- Public Member Functions inherited from CObjectInterface
 CObjectInterface ()
 
virtual ~CObjectInterface ()
 

Private Member Functions

void initConversionFactor ()
 
void initObjects ()
 

Private Attributes

std::vector< std::pair
< C_FLOAT64, CMetab * > > 
mEquation
 
C_FLOAT64 mIAmount
 
C_FLOAT64 mINumber
 
std::string mKey
 
C_FLOAT64 mNumber
 
const C_FLOAT64mpConversionFactor
 
CDependentNumberReferencempDNumberReference
 
CTotalNumberReferencempINumberReference
 
CTotalNumberReferencempNumberReference
 

Static Private Attributes

static const C_FLOAT64 DefaultFactor
 

Additional Inherited Members

- Public Types inherited from CCopasiContainer
typedef std::multimap
< std::string, CCopasiObject * > 
objectMap
 
- Public Types inherited from CCopasiObject
typedef std::set< const
CCopasiObject * > 
DataObjectSet
 
typedef std::vector< Refresh * > DataUpdateSequence
 
- Public Types inherited from CObjectInterface
typedef std::set< const
CObjectInterface * > 
ObjectSet
 
typedef std::vector
< CObjectInterface * > 
UpdateSequence
 
- Static Public Member Functions inherited from CCopasiObject
static std::vector< Refresh * > buildUpdateSequence (const DataObjectSet &objects, const DataObjectSet &uptoDateObjects, const DataObjectSet &context=DataObjectSet())
 
static void setRenameHandler (CRenameHandler *rh)
 
- Static Public Attributes inherited from CCopasiContainer
static const std::vector
< CCopasiContainer * > 
EmptyList
 
- Protected Types inherited from CCopasiObject
enum  Flag {
  Container = 0x1, Vector = 0x2, Matrix = 0x4, NameVector = 0x8,
  Reference = 0x10, ValueBool = 0x20, ValueInt = 0x40, ValueInt64 = 0x80,
  ValueDbl = 0x100, NonUniqueName = 0x200, StaticString = 0x400, ValueString = 0x800,
  Separator = 0x1000, ModelEntity = 0x2000, Array = 0x4000, DataModel = 0x8000,
  Root = 0x10000, Gui = 0x20000
}
 
- Protected Member Functions inherited from CCopasiContainer
template<class CType >
CCopasiObjectaddMatrixReference (const std::string &name, CType &reference, const unsigned C_INT32 &flag=0)
 
template<class CType >
CCopasiObjectaddObjectReference (const std::string &name, CType &reference, const unsigned C_INT32 &flag=0)
 
template<class CType >
CCopasiObjectaddVectorReference (const std::string &name, CType &reference, const unsigned C_INT32 &flag=0)
 
void initObjects ()
 
- Protected Member Functions inherited from CCopasiObject
 CCopasiObject ()
 
 CCopasiObject (const std::string &name, const CCopasiContainer *pParent=NULL, const std::string &type="CN", const unsigned C_INT32 &flag=0)
 
- Protected Attributes inherited from CCopasiContainer
objectMap mObjects
 
- Static Protected Attributes inherited from CCopasiObject
static CRenameHandlersmpRenameHandler = NULL
 

Detailed Description

Definition at line 119 of file CMoiety.h.

Constructor & Destructor Documentation

CMoiety::CMoiety ( const std::string &  name = "NoName",
const CCopasiContainer pParent = NULL 
)

Default constructor

Parameters
conststd::string & name (default: "NoName")
constCCopasiContainer * pParent (default: NULL)

Definition at line 36 of file CMoiety.cpp.

References CONSTRUCTOR_TRACE, and initObjects().

37  :
38  CCopasiContainer(name, pParent, "Moiety"),
39  mKey(CCopasiRootContainer::getKeyFactory()->add("Moiety", this)), //By G
40  mNumber(0),
41  mINumber(0),
42  mIAmount(0),
43  mEquation(),
44  mpINumberReference(NULL),
45  mpNumberReference(NULL),
46  mpDNumberReference(NULL),
48 {
49  initObjects();
51 }
C_FLOAT64 mIAmount
Definition: CMoiety.h:146
void initObjects()
Definition: CMoiety.cpp:76
static const C_FLOAT64 DefaultFactor
Definition: CMoiety.h:126
std::vector< std::pair< C_FLOAT64, CMetab * > > mEquation
Definition: CMoiety.h:153
CTotalNumberReference * mpNumberReference
Definition: CMoiety.h:164
CDependentNumberReference * mpDNumberReference
Definition: CMoiety.h:169
C_FLOAT64 mNumber
Definition: CMoiety.h:136
static CKeyFactory * getKeyFactory()
const C_FLOAT64 * mpConversionFactor
Definition: CMoiety.h:174
void add(C_FLOAT64 value, CMetab *metabolite)
Definition: CMoiety.cpp:96
C_FLOAT64 mINumber
Definition: CMoiety.h:141
std::string mKey
Definition: CMoiety.h:131
CTotalNumberReference * mpINumberReference
Definition: CMoiety.h:158
#define CONSTRUCTOR_TRACE
Definition: copasi.h:202
CMoiety::CMoiety ( const CMoiety src,
const CCopasiContainer pParent = NULL 
)

Copy constructor

Parameters
const CMoiety &src
constCCopasiContainer * pParent (default: NULL)

Definition at line 53 of file CMoiety.cpp.

References CONSTRUCTOR_TRACE, and initObjects().

54  :
55  CCopasiContainer(src, pParent),
56  mKey(CCopasiRootContainer::getKeyFactory()->add("Moiety", this)), //By G
57  mNumber(src.mNumber),
58  mINumber(src.mINumber),
59  mIAmount(src.mIAmount),
60  mEquation(src.mEquation),
61  mpINumberReference(NULL),
62  mpNumberReference(NULL),
63  mpDNumberReference(NULL),
65 {
66  initObjects();
68 }
C_FLOAT64 mIAmount
Definition: CMoiety.h:146
void initObjects()
Definition: CMoiety.cpp:76
std::vector< std::pair< C_FLOAT64, CMetab * > > mEquation
Definition: CMoiety.h:153
CTotalNumberReference * mpNumberReference
Definition: CMoiety.h:164
CDependentNumberReference * mpDNumberReference
Definition: CMoiety.h:169
C_FLOAT64 mNumber
Definition: CMoiety.h:136
static CKeyFactory * getKeyFactory()
const C_FLOAT64 * mpConversionFactor
Definition: CMoiety.h:174
void add(C_FLOAT64 value, CMetab *metabolite)
Definition: CMoiety.cpp:96
C_FLOAT64 mINumber
Definition: CMoiety.h:141
std::string mKey
Definition: CMoiety.h:131
CTotalNumberReference * mpINumberReference
Definition: CMoiety.h:158
#define CONSTRUCTOR_TRACE
Definition: copasi.h:202
CMoiety::~CMoiety ( )

Destructor

Definition at line 70 of file CMoiety.cpp.

References DESTRUCTOR_TRACE, CCopasiRootContainer::getKeyFactory(), mKey, and CKeyFactory::remove().

71 {
74 }
bool remove(const std::string &key)
#define DESTRUCTOR_TRACE
Definition: copasi.h:206
static CKeyFactory * getKeyFactory()
std::string mKey
Definition: CMoiety.h:131

Member Function Documentation

void CMoiety::add ( C_FLOAT64  value,
CMetab metabolite 
)

Add a metabolite to a moiety

Parameters
C_FLOAT64value
CMetab* metabolite

Definition at line 96 of file CMoiety.cpp.

References CCopasiObject::addDirectDependency(), mEquation, mpINumberReference, CModelEntity::mpIValueReference, mpNumberReference, CModelEntity::mpValueReference, and CMetab::setDependentOn().

Referenced by CModel::buildMoieties().

97 {
98  if (!mEquation.size())
99  pMetabolite->setDependentOn(this);
100  else
101  addDirectDependency(pMetabolite->mpValueReference);
102 
103  mpINumberReference->addDirectDependency(pMetabolite->mpIValueReference);
104  mpNumberReference->addDirectDependency(pMetabolite->mpValueReference);
105 
106  std::pair<C_FLOAT64, CMetab *> element;
107 
108  element.first = value;
109  element.second = pMetabolite;
110 
111  mEquation.push_back(element);
112 }
std::vector< std::pair< C_FLOAT64, CMetab * > > mEquation
Definition: CMoiety.h:153
CTotalNumberReference * mpNumberReference
Definition: CMoiety.h:164
void addDirectDependency(const CCopasiObject *pObject)
CTotalNumberReference * mpINumberReference
Definition: CMoiety.h:158
void CMoiety::cleanup ( )

Definition at line 114 of file CMoiety.cpp.

References CCopasiObject::clearDirectDependencies(), mEquation, mpINumberReference, and mpNumberReference.

115 {
117  mEquation.clear();
120 }
void clearDirectDependencies()
std::vector< std::pair< C_FLOAT64, CMetab * > > mEquation
Definition: CMoiety.h:153
CTotalNumberReference * mpNumberReference
Definition: CMoiety.h:164
CTotalNumberReference * mpINumberReference
Definition: CMoiety.h:158
const C_FLOAT64 & CMoiety::dependentNumber ( )

Retrieve and refresh the dependent number;

Returns
const C_FLOAT64 & dependentNumber

Definition at line 139 of file CMoiety.cpp.

References mNumber, and refreshDependentNumber().

140 {
142  return mNumber;
143 }
C_FLOAT64 mNumber
Definition: CMoiety.h:136
void refreshDependentNumber()
Definition: CMoiety.cpp:122
const C_FLOAT64 & CMoiety::getAmount ( ) const

Retrieve the total amount

Returns
const C_FLOAT64 & amount

Definition at line 257 of file CMoiety.cpp.

References mIAmount.

258 {
259  return mIAmount;
260 }
C_FLOAT64 mIAmount
Definition: CMoiety.h:146
const C_FLOAT64 & CMoiety::getDependentNumber ( ) const

Retrieve the dependent number;

Returns
const C_FLOAT64 & dependentNumber

Definition at line 145 of file CMoiety.cpp.

References mNumber.

Referenced by CMetab::calculate().

146 {return mNumber;}
C_FLOAT64 mNumber
Definition: CMoiety.h:136
CCopasiObject * CMoiety::getDependentNumberReference ( ) const

Retrieve the object for the dependent particle number

Returns
CCopasiObject * dependentNumberReference

Definition at line 151 of file CMoiety.cpp.

References mpDNumberReference.

Referenced by CMathObject::compileValue(), and CParticleReference::getPrerequisites().

152 {return mpDNumberReference;}
CDependentNumberReference * mpDNumberReference
Definition: CMoiety.h:169
std::string CMoiety::getDescription ( const CModel model) const

get the string representation of the moiety using the CMetabNameInterface

Definition at line 164 of file CMoiety.cpp.

References CMetabNameInterface::getDisplayName(), and mEquation.

165 {
166  std::ostringstream Description;
167  Description.imbue(std::locale::classic());
168  Description.precision(16);
169 
170  std::vector< std::pair< C_FLOAT64, CMetab * > >::const_iterator it = mEquation.begin();
171  std::vector< std::pair< C_FLOAT64, CMetab * > >::const_iterator end = mEquation.end();
172 
173  for (; it != end; ++it)
174  {
175  if (it != mEquation.begin())
176  {
177  if (it->first < 0.0)
178  Description << " - ";
179  else
180  Description << " + ";
181  }
182 
183  if (fabs(it->first) > 1.0 + 100.0 * std::numeric_limits< C_FLOAT64 >::epsilon() ||
184  fabs(it->first) < 1.0 - 100.0 * std::numeric_limits< C_FLOAT64 >::epsilon())
185  Description << fabs(it->first) << "*";
186 
187  Description << CMetabNameInterface::getDisplayName(model, *it->second, false);
188  }
189 
190  return Description.str();
191 }
std::vector< std::pair< C_FLOAT64, CMetab * > > mEquation
Definition: CMoiety.h:153
static std::string getDisplayName(const CModel *model, const std::string &key, const bool &quoted)
const std::vector< std::pair< C_FLOAT64, CMetab * > > & CMoiety::getEquation ( ) const

Retrieve the components of the total mass equation

Returns
const std::vector<std::pair< C_FLOAT64, CMetab * > > & equation

Definition at line 267 of file CMoiety.cpp.

References mEquation.

Referenced by CMathObject::compileDependentMass(), CMathObject::compileTotalMass(), and QConservedSpeciesAnimation::getScales().

268 {
269  return mEquation;
270 }
std::vector< std::pair< C_FLOAT64, CMetab * > > mEquation
Definition: CMoiety.h:153
std::string CMoiety::getExpression ( ) const

Retrieve the infix expression, which can be used to calculate the total amount.

Returns
std::string expression

Definition at line 228 of file CMoiety.cpp.

References mEquation.

Referenced by CQMoietiesTaskResult::slotCreateGlobalQuantity().

229 {
230  std::ostringstream Infix;
231  Infix.imbue(std::locale::classic());
232  Infix.precision(16);
233 
234  std::vector< std::pair< C_FLOAT64, CMetab * > >::const_iterator it = mEquation.begin();
235  std::vector< std::pair< C_FLOAT64, CMetab * > >::const_iterator end = mEquation.end();
236 
237  for (; it != end; ++it)
238  {
239  if (it != mEquation.begin())
240  {
241  if (it->first < 0.0)
242  Infix << "-";
243  else
244  Infix << "+";
245  }
246 
247  if (fabs(it->first) > 1.0 + 100.0 * std::numeric_limits< C_FLOAT64 >::epsilon() ||
248  fabs(it->first) < 1.0 - 100.0 * std::numeric_limits< C_FLOAT64 >::epsilon())
249  Infix << fabs(it->first) << "*";
250 
251  Infix << "<" << it->second->getInitialValueReference()->getCN() << ">";
252  }
253 
254  return Infix.str();
255 }
std::vector< std::pair< C_FLOAT64, CMetab * > > mEquation
Definition: CMoiety.h:153
CCopasiObject * CMoiety::getInitialValueReference ( ) const

Retrieve the object for the total particle number

Returns
CCopasiObject * initialValueReference

Definition at line 206 of file CMoiety.cpp.

References mpINumberReference.

207 {return mpINumberReference;}
CTotalNumberReference * mpINumberReference
Definition: CMoiety.h:158
const std::string & CMoiety::getKey ( ) const
virtual

Returns a string with the name of this compartment.

Returns
std::string key

Reimplemented from CCopasiObject.

Definition at line 154 of file CMoiety.cpp.

References mKey.

154 {return mKey;} //By G
std::string mKey
Definition: CMoiety.h:131
C_FLOAT64 CMoiety::getNumber ( ) const

Definition at line 209 of file CMoiety.cpp.

References mINumber.

210 {
211  return mINumber;
212 }
C_FLOAT64 mINumber
Definition: CMoiety.h:141
CCopasiObject * CMoiety::getTotalNumberReference ( ) const

Retrieve the object for the dependent particle number

Returns
CCopasiObject * totalNumberReference

Definition at line 148 of file CMoiety.cpp.

References mpNumberReference.

Referenced by CMathObject::compileDependentMass().

149 {return mpNumberReference;}
CTotalNumberReference * mpNumberReference
Definition: CMoiety.h:164
CCopasiObject * CMoiety::getValueReference ( ) const

Retrieve the object for the total particle number

Returns
CCopasiObject * valueReference

Definition at line 223 of file CMoiety.cpp.

References mpNumberReference.

224 {
225  return mpNumberReference;
226 }
CTotalNumberReference * mpNumberReference
Definition: CMoiety.h:164
void CMoiety::initConversionFactor ( )
private

Initialize the number to amount conversion factor

Definition at line 272 of file CMoiety.cpp.

References DefaultFactor, CModel::getNumber2QuantityFactor(), CCopasiObject::getObjectAncestor(), and mpConversionFactor.

Referenced by setObjectParent().

273 {
274  const CModel * pModel = dynamic_cast< const CModel * >(getObjectAncestor("Model"));
275 
276  if (pModel != NULL)
277  {
279  }
280  else
281  {
283  }
284 }
CCopasiContainer * getObjectAncestor(const std::string &type) const
static const C_FLOAT64 DefaultFactor
Definition: CMoiety.h:126
const C_FLOAT64 & getNumber2QuantityFactor() const
Definition: CModel.cpp:2357
const C_FLOAT64 * mpConversionFactor
Definition: CMoiety.h:174
Definition: CModel.h:50
void CMoiety::initObjects ( )
private

Initialize the contained CCopasiObjects

Definition at line 76 of file CMoiety.cpp.

References CCopasiObject::addDirectDependency(), CCopasiContainer::addObjectReference(), mIAmount, mINumber, mNumber, mpDNumberReference, mpINumberReference, mpNumberReference, refreshAmount(), refreshDependentNumber(), refreshInitialValue(), refreshValue(), CCopasiObject::setRefresh(), and CCopasiObject::ValueDbl.

Referenced by CMoiety().

77 {
79 
80  mpINumberReference = new CTotalNumberReference("InitialValue", this, mINumber);
82 
83  mpNumberReference = new CTotalNumberReference("Value", this, mNumber);
85 
86  mpDNumberReference = new CDependentNumberReference("DependentValue", this, mNumber);
88 
90  pObject->setRefresh(this, &CMoiety::refreshAmount);
92 
93  return;
94 }
C_FLOAT64 mIAmount
Definition: CMoiety.h:146
void setRefresh(CType *pType, void(CType::*method)(void))
CTotalNumberReference * mpNumberReference
Definition: CMoiety.h:164
CDependentNumberReference * mpDNumberReference
Definition: CMoiety.h:169
C_FLOAT64 mNumber
Definition: CMoiety.h:136
void refreshValue()
Definition: CMoiety.cpp:214
void addDirectDependency(const CCopasiObject *pObject)
void refreshDependentNumber()
Definition: CMoiety.cpp:122
void refreshAmount()
Definition: CMoiety.cpp:262
C_FLOAT64 mINumber
Definition: CMoiety.h:141
CTotalNumberReference * mpINumberReference
Definition: CMoiety.h:158
CCopasiObject * addObjectReference(const std::string &name, CType &reference, const unsigned C_INT32 &flag=0)
void refreshInitialValue()
Definition: CMoiety.cpp:193
void CMoiety::refreshAmount ( )

Refresh the total amount

Definition at line 262 of file CMoiety.cpp.

References mIAmount, mINumber, and mpConversionFactor.

Referenced by initObjects().

263 {
265 }
C_FLOAT64 mIAmount
Definition: CMoiety.h:146
const C_FLOAT64 * mpConversionFactor
Definition: CMoiety.h:174
C_FLOAT64 mINumber
Definition: CMoiety.h:141
void CMoiety::refreshDependentNumber ( )

Refreshes the value of the dependent number

Definition at line 122 of file CMoiety.cpp.

References mEquation, mINumber, and mNumber.

Referenced by dependentNumber(), and initObjects().

123 {
124  mNumber = mINumber;
125 
126  std::vector< std::pair< C_FLOAT64, CMetab * > >::iterator it = mEquation.begin() + 1;
127  std::vector< std::pair< C_FLOAT64, CMetab * > >::iterator end = mEquation.end();
128 
129  for (; it != end; ++it)
130  mNumber -= it->first * it->second->getValue();
131 
132  // It is save to update the particle number of the dependent species here.
133  // We are mimicking the behavior of the new math container by doing it.
134  mEquation.begin()->second->setValue(mNumber);
135 
136  return;
137 }
std::vector< std::pair< C_FLOAT64, CMetab * > > mEquation
Definition: CMoiety.h:153
C_FLOAT64 mNumber
Definition: CMoiety.h:136
C_FLOAT64 mINumber
Definition: CMoiety.h:141
void CMoiety::refreshInitialValue ( )

Refresh the initial total particle number

Definition at line 193 of file CMoiety.cpp.

References mEquation, and mINumber.

Referenced by initObjects().

194 {
195  mINumber = 0;
196 
197  std::vector< std::pair< C_FLOAT64, CMetab * > >::iterator it = mEquation.begin();
198  std::vector< std::pair< C_FLOAT64, CMetab * > >::iterator end = mEquation.end();
199 
200  for (; it != end; ++it)
201  mINumber += it->first * it->second->getInitialValue();
202 
203  return;
204 }
std::vector< std::pair< C_FLOAT64, CMetab * > > mEquation
Definition: CMoiety.h:153
C_FLOAT64 mINumber
Definition: CMoiety.h:141
void CMoiety::refreshValue ( )

Refresh the total particle number

Definition at line 214 of file CMoiety.cpp.

References mEquation, and mINumber.

Referenced by initObjects().

215 {
216  std::vector< std::pair< C_FLOAT64, CMetab * > >::iterator it = mEquation.begin();
217  std::vector< std::pair< C_FLOAT64, CMetab * > >::iterator end = mEquation.end();
218 
219  for (; it != end; ++it)
220  mINumber += it->first * it->second->getValue();
221 }
std::vector< std::pair< C_FLOAT64, CMetab * > > mEquation
Definition: CMoiety.h:153
C_FLOAT64 mINumber
Definition: CMoiety.h:141
bool CMoiety::setObjectParent ( const CCopasiContainer pParent)
virtual

Sets the parent of the moiety;

Parameters
constCCopasiContainer * pParent
Returns
bool success

Reimplemented from CCopasiObject.

Definition at line 156 of file CMoiety.cpp.

References initConversionFactor(), and CCopasiObject::setObjectParent().

157 {
158  bool success = CCopasiContainer::setObjectParent(pParent);
160 
161  return success;
162 }
virtual bool setObjectParent(const CCopasiContainer *pParent)
void initConversionFactor()
Definition: CMoiety.cpp:272

Member Data Documentation

const C_FLOAT64 CMoiety::DefaultFactor
staticprivate

The default conversion factor used if the moiety is not part of a model

Definition at line 126 of file CMoiety.h.

Referenced by initConversionFactor().

std::vector<std::pair< C_FLOAT64, CMetab * > > CMoiety::mEquation
private

Vector of linear dependent CChemEqElement 0..*

Definition at line 153 of file CMoiety.h.

Referenced by add(), cleanup(), getDescription(), getEquation(), getExpression(), refreshDependentNumber(), refreshInitialValue(), and refreshValue().

C_FLOAT64 CMoiety::mIAmount
private

The total Amount of the Moiety.

Definition at line 146 of file CMoiety.h.

Referenced by getAmount(), initObjects(), and refreshAmount().

C_FLOAT64 CMoiety::mINumber
private

Initial Number of Particles of Moiety.

Definition at line 141 of file CMoiety.h.

Referenced by getNumber(), initObjects(), refreshAmount(), refreshDependentNumber(), refreshInitialValue(), and refreshValue().

std::string CMoiety::mKey
private

The key of the moiety

Definition at line 131 of file CMoiety.h.

Referenced by getKey(), and ~CMoiety().

C_FLOAT64 CMoiety::mNumber
private

Number of Particles of Moiety.

Definition at line 136 of file CMoiety.h.

Referenced by dependentNumber(), getDependentNumber(), initObjects(), and refreshDependentNumber().

const C_FLOAT64* CMoiety::mpConversionFactor
private

A pointer to the conversion factor between the particle number and the amount.

Definition at line 174 of file CMoiety.h.

Referenced by initConversionFactor(), and refreshAmount().

CDependentNumberReference* CMoiety::mpDNumberReference
private

A pointer to the object for the dependent particle number

Definition at line 169 of file CMoiety.h.

Referenced by getDependentNumberReference(), and initObjects().

CTotalNumberReference* CMoiety::mpINumberReference
private

A pointer to the object for the initial total particle number

Definition at line 158 of file CMoiety.h.

Referenced by add(), cleanup(), getInitialValueReference(), and initObjects().

CTotalNumberReference* CMoiety::mpNumberReference
private

A pointer to the object for the total particle number This is used during events

Definition at line 164 of file CMoiety.h.

Referenced by add(), cleanup(), getTotalNumberReference(), getValueReference(), and initObjects().


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