29 : mpModel(pModel), mmModel(mModel)
53 std::string name =
"model_2";
82 for (i = 0; i < imax; ++i)
86 if (!sourceEvent)
return info;
90 std::string eventName;
94 std::string appendix =
"";
96 unsigned int counter = 2;
97 std::ostringstream numberStream;
101 numberStream.str(
"");
102 numberStream <<
"_" << counter;
104 appendix = numberStream.str();
108 appendix =
"_" + name;
113 if (newEvent == NULL)
return info;
140 for (j = 0; j < jmax; ++j)
144 if (!sourceAssignment)
return info;
175 if (pExpression == NULL)
return info;
180 const std::vector<CEvaluationNode*>& objectNodes = tmp->
getNodeList();
181 size_t j, jmax = objectNodes.size();
183 for (j = 0; j < jmax; ++j)
189 if (pObjectNode == NULL)
return info;
196 if (mObject == NULL)
return info;
198 std::string host =
"";
206 if (mObject == NULL)
return info;
211 cn = pObject->
getCN() + host;
213 pObjectNode->
setData(
"<" + cn +
">");
231 if (pExpression == NULL)
return info;
236 const std::vector<CEvaluationNode*>& objectNodes = tmp->
getNodeList();
237 size_t j, jmax = objectNodes.size();
239 for (j = 0; j < jmax; ++j)
245 if (pObjectNode == NULL)
return info;
252 if (mObject == NULL)
return info;
254 std::string host =
"";
262 if (mObject == NULL)
return info;
267 cn = pObject->
getCN() + host;
269 pObjectNode->
setData(
"<" + cn +
">");
287 if (pExpression == NULL)
return info;
292 const std::vector<CEvaluationNode*>& objectNodes = tmp->
getNodeList();
293 size_t j, jmax = objectNodes.size();
295 for (j = 0; j < jmax; ++j)
301 if (pObjectNode == NULL)
return info;
308 if (mObject == NULL)
return info;
310 std::string host =
"";
318 if (mObject == NULL)
return info;
323 cn = pObject->
getCN() + host;
325 pObjectNode->
setData(
"<" + cn +
">");
343 if (pExpression == NULL)
return info;
348 const std::vector<CEvaluationNode*>& objectNodes = tmp->
getNodeList();
349 size_t j, jmax = objectNodes.size();
351 for (j = 0; j < jmax; ++j)
357 if (pObjectNode == NULL)
return info;
364 if (mObject == NULL)
return info;
366 std::string host =
"";
374 if (mObject == NULL)
return info;
379 cn = pObject->
getCN() + host;
381 pObjectNode->
setData(
"<" + cn +
">");
399 if (pExpression == NULL)
return info;
404 const std::vector<CEvaluationNode*>& objectNodes = tmp->
getNodeList();
405 size_t j, jmax = objectNodes.size();
407 for (j = 0; j < jmax; ++j)
413 if (pObjectNode == NULL)
return info;
420 if (mObject == NULL)
return info;
422 std::string host =
"";
430 if (mObject == NULL)
return info;
435 cn = pObject->
getCN() + host;
437 pObjectNode->
setData(
"<" + cn +
">");
453 for (i = 0; i < imax; ++i)
457 if (!sourceComp)
return false;
461 std::string newName = sourceComp->
getObjectName() +
"_" + name;
465 if (!newComp)
return false;
485 for (i = 0; i < imax; ++i)
489 if (!sourceComp)
return info;
497 if (!newComp)
return info;
499 switch (newComp ->getStatus())
536 for (i = 0; i < imax; ++i)
541 if (!sourceMetab)
return info;
543 if (!sourceComp)
return info;
547 std::string newName = sourceMetab->
getObjectName() +
"_" + name;
551 if (!newMetab)
return info;
568 for (i = 0; i < imax; ++i)
572 if (!sourceMetab)
return info;
580 if (!newMetab)
return info;
582 switch (newMetab ->getStatus())
622 for (i = 0; i < imax; ++i)
626 if (!sourceModVal)
return info;
630 std::string newName = sourceModVal->
getObjectName() +
"_" + name;
634 if (!newModVal)
return info;
651 for (i = 0; i < imax; ++i)
655 if (!sourceModVal)
return info;
663 if (!newModVal)
return info;
665 switch (newModVal ->getStatus())
707 for (ic = 0; ic < icmax; ++ic)
711 if (!sourceComp)
return info;
713 for (i = 0; i < imax; ++i)
720 std::string newName = sourceReac->
getObjectName() +
"_" + name;
724 if (!newReac)
return info;
729 std::map<std::string, std::string>::const_iterator mapIt;
730 std::string targetKey;
733 for (j = 0; j < jmax; ++j)
739 if (mapIt ==
keyMap.end())
744 targetKey = mapIt->second;
751 for (j = 0; j < jmax; ++j)
757 if (mapIt ==
keyMap.end())
762 targetKey = mapIt->second;
769 for (j = 0; j < jmax; ++j)
776 if (mapIt ==
keyMap.end())
781 targetKey = mapIt->second;
811 if (mapIt ==
keyMap.end())
816 targetKey = mapIt->second;
831 if (mapIt ==
keyMap.end())
836 targetKey = mapIt->second;
851 if (mapIt ==
keyMap.end())
856 targetKey = mapIt->second;
873 if (mapIt ==
keyMap.end())
878 targetKey = mapIt->second;
900 if (!reac)
return false;
902 if (!comp)
return false;
906 for (i = 0; i < imax; ++i)
912 for (i = 0; i < imax; ++i)
918 for (i = 0; i < imax; ++i)
954 std::string empty =
"";
956 for (i = 0; i < imax; ++i)
960 for (j = 0; j < imax; ++j)
962 if (objectKey[i] !=
"")
966 if (tmp->
getKey() == objectKey[i])
981 for (i = 0; i < imax; ++i)
999 for (i = 0; i < imax; ++i)
1005 for (j = 0; j < jmax; ++j)
1015 for (j = 0; j < jmax; ++j)
1025 for (j = 0; j < jmax; ++j)
1049 for (k = 0; k < kmax; ++k)
1074 for (i = 0; i < imax; ++i)
1078 if (!event)
return info;
1081 CExpression* pExpression =
event->getTriggerExpressionPtr();
1083 if (pExpression == NULL)
return info;
1087 pExpression =
event->getDelayExpressionPtr();
1093 jmax =
event->getAssignments().size();
1095 for (j = 0; j < jmax; ++j)
1099 if (!assignment)
return info;
1101 std::string assignmentKey = assignment->
getTargetKey();
1103 if (assignmentKey == key) assignment->
setTargetKey(toKey);
1107 if (pExpression == NULL)
return info;
1115 for (i = 0; i < imax; ++i)
1119 if (!metab)
return info;
1150 for (i = 0; i < imax; ++i)
1154 if (!comp)
return info;
1156 switch (comp ->getStatus())
1184 for (i = 0; i < imax; ++i)
1188 if (!modval)
return info;
1190 switch (modval ->getStatus())
1224 if (pExpression == NULL)
return info;
1226 const std::vector<CEvaluationNode*>& objectNodes = pExpression->
getNodeList();
1227 size_t j, jmax = objectNodes.size();
1229 for (j = 0; j < jmax; ++j)
1235 if (pObjectNode == NULL)
return info;
1242 if (mObject == NULL)
return info;
1244 std::string host =
"";
1252 if (mObject == NULL)
return info;
1262 cn = pObject->
getCN() + host;
1264 pObjectNode->
setData(
"<" + cn +
">");
const CExpression * getExpressionPtr() const
Header file of class CExpression.
CCopasiDataModel * getObjectDataModel()
void setReversible(bool reversible)
const CCopasiVectorN< CEventAssignment > & getAssignments() const
const bool & getDelayAssignment() const
bool mergeMetabolites(std::string toKey, std::string key)
bool addMetabolitesExpressions()
CEvent * createEvent(const std::string &name)
CCopasiVectorN< CEvent > & getEvents()
virtual CCopasiObjectName getCN() const
bool addSubstrate(const std::string &metabKey, const C_FLOAT64 &multiplicity=1.0)
const CCopasiVector< CMetab > & getMetabolites() const
const std::string & getObjectName() const
bool setDimensionality(unsigned C_INT32 dim)
const CCopasiVectorN< CModelValue > & getModelValues() const
unsigned C_INT32 getDimensionality() const
virtual size_t size() const
const CRegisteredObjectName & getObjectCN() const
bool removeMetabolite(const std::string &key, const bool &recursive=true)
const std::string & getTargetKey() const
CCopasiObject * get(const std::string &key)
static const std::string TypeName[]
void setParameterValue(const std::string ¶meterName, const C_FLOAT64 &value, const bool &updateStatus=true)
void setModel(CModel *pModel, CModel *mModel)
const CMetab * getMetabolite() const
std::map< std::string, std::string > keyMap
const CExpression * getExpressionPtr() const
bool setExpression(const std::string &expression)
bool addProduct(const std::string &metabKey, const C_FLOAT64 &multiplicity=1.0)
void setModel(CModel *pModel)
bool isLocalParameter(const size_t &index) const
bool addEvents(std::string name)
bool setInitialExpression(const std::string &expression)
void clearParameterMapping(const std::string ¶meterName)
CModelValue * createModelValue(const std::string &name, const C_FLOAT64 &value=0.0)
virtual size_t getIndex(const std::string &name) const
bool setTargetKey(const std::string &targetKey)
bool mergeInExpression(std::string toKey, std::string key, CExpression *pExpression)
bool addModelValuesExpressions()
bool copyEventAssignmentExpression(const CEventAssignment *sourceAssignment, CEventAssignment *newAssignment)
CExpression * getDelayExpressionPtr()
bool copyExpression(const CModelEntity *sourceEntity, CModelEntity *newEntity)
virtual const std::string & getKey() const
const C_FLOAT64 & getInitialValue() const
bool addMetabolites(std::string name)
std::map< std::string, std::string > nameMap
const CCopasiVector< CChemEqElement > & getProducts() const
static Type type(const Type &type)
const CFunction * getFunction() const
bool addCompartmentsExpressions()
const CFunctionParameters & getFunctionParameters() const
CModelAdd(CModel *pModel, CModel *mModel)
virtual bool add(const CType &src)
bool addModifier(const std::string &metabKey, const C_FLOAT64 &multiplicity=1.0)
void setMetabolite(const std::string &key)
bool setFunction(const std::string &functionName)
virtual const std::string & getKey() const
virtual void setStatus(const CModelEntity::Status &status)
CReaction * createReaction(const std::string &name)
bool setTriggerExpression(const std::string &expression)
bool addCompartments(std::string name)
const C_FLOAT64 & getMultiplicity() const
const std::string & getMetaboliteKey() const
std::string getInitialExpression() const
bool addModelValues(std::string name)
bool copyTriggerExpression(const CEvent *sourceEvent, CEvent *newEvent)
void simpleCall(std::vector< std::string > &toKey, std::vector< std::string > &objectKey)
just a simple method to call during development
void setDelayAssignment(const bool &delayCalculation)
const CCopasiVector< CChemEqElement > & getSubstrates() const
const std::string & getKey() const
bool isReversible() const
CCopasiVectorNS< CCompartment > & getCompartments()
const CExpression * getTriggerExpressionPtr() const
static CKeyFactory * getKeyFactory()
bool setDelayExpression(const std::string &expression)
bool compileIfNecessary(CProcessReport *pProcessReport)
const CCopasiVector< CChemEqElement > & getModifiers() const
void setParameterMapping(const size_t &index, const std::string &key)
CCopasiVectorNS< CReaction > & getReactions()
virtual bool setData(const Data &data)
bool copyDelayExpression(const CEvent *sourceEvent, CEvent *newEvent)
Header file of class CEvent.
virtual const CObjectInterface * getObject(const CCopasiObjectName &cn) const
static bool reactionInvolvesCompartment(const CReaction *reac, const CCompartment *comp)
bool copyInitialExpression(const CModelEntity *sourceEntity, CModelEntity *newEntity)
const CModelEntity::Status & getStatus() const
const std::vector< std::vector< std::string > > & getParameterMappings() const
bool setExpression(const std::string &expression)
void simpleCall()
just a simple method to call during development
const std::vector< CEvaluationNode * > & getNodeList() const
const CChemEq & getChemEq() const
CModelMerging(CModel *pModel)
const C_FLOAT64 & getParameterValue(const std::string ¶meterName) const
const std::string & getInfix() const
CCopasiContainer * getObjectParent() const
const CExpression * getInitialExpressionPtr() const
void addParameterMapping(const size_t &index, const std::string &key)
CCompartment * createCompartment(const std::string &name, const C_FLOAT64 &volume=1.0)
bool addReactions(std::string name)
CMetab * createMetabolite(const std::string &name, const std::string &compartment, const C_FLOAT64 &iconc=1.0, const CModelEntity::Status &status=CModelEntity::REACTIONS)