30 using namespace YACS::ENGINE;
46 _indexPort(NAME_OF_INDEX,this,
Runtime::_tc_int)
51 _nbOfTimesPort(other._nbOfTimesPort,this),
52 _indexPort(other._indexPort,this)
56 std::vector< std::pair<OutPort *, InPort *> >::iterator iter=linksToReproduce.begin();
57 for(;iter!=linksToReproduce.end();++iter)
60 InPort* pin = iter->second;
67 return new ForLoop(*
this,father,editionOnly);
72 if(name == NAME_OF_NSTEPS_NUMBER)
return (
InputPort*)&_nbOfTimesPort;
148 DEBTRACE(
"ForLoop::updateStateOnFinishedEventFrom " << node->
getName());
180 list<InputPort *>
ret;
187 if(name==NAME_OF_INDEX)
194 if(name==NAME_OF_INDEX)
201 list<OutputPort *>
ret;
208 std::vector<OutPort *>& fwCross,
216 throw Exception(
"Internal error occured - cross type link detected on decision port of a loop. Forbidden !");
221 bool direction,
LinkInfo& info)
const
223 const char what[]=
"ForLoop::checkCFLinks : internal error.";
238 Node *nodeStart=(*(starts.begin()))->getNode();
248 if(nodeEnd!=nodeStart)
254 else if(alreadyFed==
FED_ST)
273 if (aNbStepsPort && !aNbStepsPort->
isEmpty())
280 std::stringstream aProgress;
288 return aProgress.str();
299 list<ProgressWeight>
ret;
303 for(list<Node *>::const_iterator iter=setOfNode.begin();iter!=setOfNode.end();iter++)
305 list<ProgressWeight> myCurrentSet=(*iter)->getProgressWeight();
306 for(list<ProgressWeight>::iterator iter=myCurrentSet.begin();iter!=myCurrentSet.end();iter++)
308 (*iter).weightDone=((*iter).weightTotal) * nbStepsDone;
309 (*iter).weightTotal*=nbStepsTotal;
311 ret.insert(ret.end(),myCurrentSet.begin(),myCurrentSet.end());