33 if (pModel == NULL)
return;
52 for (; itReaction != endReaction; ++itReaction)
58 for (; itParameter != endParameter; ++itParameter)
63 std::string CN =
"<" + (*itParameter)->getCN() +
",Reference=Value>";
67 for (; ppEntity != ppEntityEnd; ++ppEntity)
69 if ((*ppEntity)->getExpression().find(CN) != std::string::npos)
71 (std::pair< CCopasiParameter * const, CExpression * >(*itParameter, (*ppEntity)->getExpressionPtr()));
73 if ((*ppEntity)->getInitialExpression().find(CN) != std::string::npos)
75 (std::pair< CCopasiParameter * const, CExpression * >(*itParameter, (*ppEntity)->getInitialExpressionPtr()));
87 std::stringstream NameStream;
91 std::string NewCNBase;
95 std::string::size_type Start;
98 std::multimap< CCopasiParameter *, CExpression * >::const_iterator itChanges =
mChanges.begin();
99 std::multimap< CCopasiParameter *, CExpression * >::const_iterator endChanges =
mChanges.end();
101 for (; itChanges != endChanges; ++itChanges)
103 if (pParameter != itChanges->first)
106 pParameter = itChanges->first;
107 OldCN =
"<" + pParameter->
getCN() +
",Reference=";
120 while (pModelValue == NULL)
123 NameStream << Name <<
"_" << index++;
127 NewCNBase =
"<" + pModelValue->
getCN() +
",Reference=";
135 <<
" is replaced by " << pModelValue->
getObjectName() << std::endl;
139 if (itChanges->second->getObjectName().compare(0, 7,
"Initial") == 0)
140 NewCN = NewCNBase +
"Initial";
145 Infix = itChanges->second->getInfix();
149 while ((Start = Infix.find(OldCN), Start) != std::string::npos)
150 Infix.replace(Start, OldCN.length(), NewCN);
152 itChanges->second->setInfix(Infix);
Header file of class CExpression.
CCopasiContainer * getObjectAncestor(const std::string &type) const
virtual CCopasiObjectName getCN() const
const std::string & getObjectName() const
std::multimap< CCopasiParameter *, CExpression * > mChanges
void fixModel(CModel *pModel)
bool isLocalParameter(const size_t &index) const
CModelValue * createModelValue(const std::string &name, const C_FLOAT64 &value=0.0)
const size_t & size() const
std::vector< CType * >::const_iterator const_iterator
virtual const std::string & getKey() const
const Value & getValue() const
virtual CCopasiObjectName getCN() const
const CStateTemplate & getStateTemplate() const
void setParameterMapping(const size_t &index, const std::string &key)
CCopasiVectorNS< CReaction > & getReactions()
~CFixLocalReactionParameters()
parameterGroup::iterator index_iterator
CModelEntity ** getEntities()
CFixLocalReactionParameters()