33 for (; it != end; ++it)
50 CObjectInterface::ObjectSet::const_iterator it = Prerequisites.begin();
51 CObjectInterface::ObjectSet::const_iterator end = Prerequisites.end();
53 for (; it != end; ++it)
62 foundPrerequisite->second->addDependent(found->second);
63 found->second->addPrerequisite(foundPrerequisite->second);
81 updateSequence.clear();
83 CObjectInterface::ObjectSet::const_iterator it = changedObjects.begin();
84 CObjectInterface::ObjectSet::const_iterator end = changedObjects.end();
90 for (; it != end && success; ++it)
94 if (found != notFound)
96 success &= found->second->updateDependentState(context, changedObjects);
103 if (!success)
goto finish;
105 it = requestedObjects.begin();
106 end = requestedObjects.end();
109 for (; it != end && success; ++it)
113 if (found != notFound)
115 found->second->setRequested(
true);
116 success &= found->second->updatePrerequisiteState(context, changedObjects);
123 #ifdef COPASI_DEBUG_TRACE
125 std::ofstream GetUpdateSequence(
"GetUpdateSequence.dot");
127 GetUpdateSequence.close();
129 #endif //COPASI_DEBUG_TRACE
131 if (!success)
goto finish;
133 it = requestedObjects.begin();
134 end = requestedObjects.end();
136 for (; it != end && success; ++it)
140 if (found != notFound)
142 success &= found->second->buildUpdateSequence(context, updateSequence);
149 if (!success)
goto finish;
151 for (; itCheck != endCheck; ++itCheck)
154 itCheck->second->setChanged(
false);
155 itCheck->second->setRequested(
false);
162 updateSequence.clear();
168 CObjectInterface::UpdateSequence::const_iterator itSeq = updateSequence.begin();
169 CObjectInterface::UpdateSequence::const_iterator endSeq = updateSequence.end();
171 std::cout << std::endl <<
"Start" << std::endl;
173 for (; itSeq != endSeq; ++itSeq)
175 if (dynamic_cast< const CMathObject * >(*itSeq))
177 std::cout << *static_cast< const CMathObject * >(*itSeq);
181 std::cout << (*itSeq)->getCN() << std::endl;
185 std::cout <<
"End" << std::endl;
193 os <<
"digraph " << name <<
" {" << std::endl;
194 os <<
"rankdir=LR;" << std::endl;
201 for (; it != end; ++it)
205 const std::vector< CMathDependencyNode * > & Dependents = it->second->getDependents();
206 std::vector< CMathDependencyNode * >::const_iterator itDep = Dependents.begin();
207 std::vector< CMathDependencyNode * >::const_iterator endDep = Dependents.end();
209 for (; itDep != endDep; ++itDep)
213 os << ((it->second->isChanged()) ?
"\\nC" :
"\\no");
214 os << ((it->second->isRequested()) ?
"R" :
"o");
219 os << (((*itDep)->isChanged()) ?
"\\nC" :
"\\no");
220 os << (((*itDep)->isRequested()) ?
"R" :
"o");
222 os <<
";" << std::endl;
226 os <<
"}" << std::endl;
235 if (pDataObject == NULL && pMathObject == NULL)
237 return "Invalid Node";
240 if (pDataObject == NULL)
245 if (pDataObject == NULL)
247 std::ostringstream os;
252 os <<
"ValueTypeUndefined";
264 os <<
"ParticleFlux";
280 os <<
"DependentMass";
284 os <<
"Discontinuous";
292 os <<
"EventPriority";
296 os <<
"EventAssignment";
300 os <<
"EventTrigger";
308 os <<
"EventRootState";
312 std::map< const CObjectInterface *, size_t >::const_iterator found =
mObject2Index.find(pMathObject);
316 os <<
"::" << found->second;
const std::string & getObjectName() const
virtual const CObjectInterface::ObjectSet & getPrerequisites() const =0
NodeMap::iterator iterator
NodeMap::const_iterator const_iterator
bool getUpdateSequence(const CMath::SimulationContextFlag &context, const CObjectInterface::ObjectSet &changedObjects, const CObjectInterface::ObjectSet &requestedObjects, CObjectInterface::UpdateSequence &updateSequence)
void exportDOTFormat(std::ostream &os, const std::string &name) const
Header file of class CCopasiContainer.
std::set< const CObjectInterface * > ObjectSet
iterator addObject(const CObjectInterface *pObject)
virtual const CObjectInterface * getObject(const CCopasiObjectName &cn) const =0
const CMath::ValueType & getValueType() const
std::string getDOTNodeId(const CObjectInterface *pObject) const
CCopasiContainer * getObjectParent() const
std::vector< CObjectInterface * > UpdateSequence
const CCopasiObject * getDataObject() const
std::map< const CObjectInterface *, size_t > mObject2Index