+void OptimizerLoop::checkLinkPossibility(OutPort *start, const std::list<ComposedNode *>& pointsOfViewStart,
+ InPort *end, const std::list<ComposedNode *>& pointsOfViewEnd) throw(YACS::Exception)
+{
+ DynParaLoop::checkLinkPossibility(start, pointsOfViewStart, end, pointsOfViewEnd);
+ std::string linkName("(");
+ linkName += start->getName()+" to "+end->getName()+")";
+
+ // Yes, it should be possible to link back the result port to any input port of the loop.
+ if(end == _nbOfBranches->getPort() || end == &_algoInitPort)
+ if(start != &_algoResultPort)
+ throw Exception(std::string("Illegal OptimizerLoop link.") + linkName);
+ else
+ return;
+
+ if(start == &_algoResultPort)
+ throw Exception(std::string("Illegal OptimizerLoop link: \
+The 'algoResult' port can't be linked within the scope of the loop.") + linkName);
+
+ if(end == &_retPortForOutPool && isInMyDescendance(start->getNode())!=_node)
+ throw Exception(std::string("Illegal OptimizerLoop link: \
+The 'evalResults' port can only be linked to the working node.") + linkName);
+}
+