34 mSubstrates(
"Substrates", this),
35 mProducts(
"Products", this),
36 mModifiers(
"Modifiers", this),
37 mBalances(
"Balances", this)
43 mReversible(src.mReversible),
44 mSubstrates(src.mSubstrates, this),
45 mProducts(src.mProducts, this),
46 mModifiers(src.mModifiers, this),
47 mBalances(src.mBalances, this)
118 std::set< const CCompartment * > Compartments;
123 for (; it != end; ++it)
125 if ((*it)->getMetabolite() == NULL)
128 if ((pCompartment = (*it)->getMetabolite()->getCompartment()) != NULL)
130 Compartments.insert(pCompartment);
149 tmp =
mSubstrates[i]->getMetabolite()->getCompartment()->getValue();
160 if (!
mProducts[i]->getMetabolite())
continue;
162 tmp =
mProducts[i]->getMetabolite()->getCompartment()->getValue();
172 return mProducts[indexProducts]->getMetabolite()->getCompartment();
175 return mSubstrates[indexSubstrates]->getMetabolite()->getCompartment();
191 for (i = 0; i < structure.
size(); i++)
192 if (key == structure[i]->getMetaboliteKey())
195 if (i >= structure.
size())
202 structure.
add(Element,
true);
233 size_t ccc, i, imax = tmpVector->
size();
236 for (i = 0; i < imax; ++i)
237 ccc += (
size_t) floor((*tmpVector)[i]->getMultiplicity());
244 os <<
"CChemEq:" << std::endl;
248 os <<
" mSubstrates:" << std::endl;
250 os <<
" mProducts:" << std::endl;
252 os <<
" mBalances:" << std::endl;
255 os <<
"----CChemEq" << std::endl;
280 std::string key = pMetab->
getKey();
296 if ((*it)->getMetaboliteKey() == key)
311 C_FLOAT64 diff = newMult - (*it)->getMultiplicity();
314 if (fabs(diff) > 1e-9)
318 (*it)->setMultiplicity(newMult);
void setMultiplicity(const C_FLOAT64 multiplicity)
size_t getCompartmentNumber() const
CCopasiVector< CChemEqElement > mModifiers
bool setMultiplicity(const CMetab *pMetab, C_FLOAT64 newMult, MetaboliteRole role)
virtual size_t size() const
CCopasiVector< CChemEqElement > mProducts
const CCopasiVector< CChemEqElement > & getBalances() const
void addElement(CCopasiVector< CChemEqElement > &structure, const CChemEqElement &element, CChemEq::MetaboliteRole role=CChemEq::PRODUCT)
CCopasiVector< CChemEqElement > mSubstrates
const CCopasiVector< CChemEqElement > & getProducts() const
std::set< const CCompartment * > getCompartments() const
void setMetabolite(const std::string &key)
CChemEq(const std::string &name="NoName", const CCopasiContainer *pParent=NULL)
virtual const std::string & getKey() const
const bool & getReversibility() const
const C_FLOAT64 & getMultiplicity() const
virtual bool add(const CType &src)
const std::string & getMetaboliteKey() const
const CCopasiVector< CChemEqElement > & getSubstrates() const
bool addMetabolite(const std::string &key, const C_FLOAT64 multiplicity, const MetaboliteRole &role)
CCopasiVector< CChemEqElement > mBalances
const CCopasiVector< CChemEqElement > & getModifiers() const
std::ostream & operator<<(std::ostream &os, const CChemEq &d)
size_t getMolecularity(const MetaboliteRole role) const
const CCompartment * getLargestCompartment() const
void setReversibility(const bool &reversible)
#define CONSTRUCTOR_TRACE