class to build optimization loops More...
#include <OptimizerLoop.hxx>
Public Member Functions | |
OptimizerLoop (const std::string &name, const std::string &algLibWthOutExt, const std::string &symbolNameToOptimizerAlgBaseInstanceFactory, bool algInitOnFile, bool initAlgo=true, Proc *procForTypes=NULL) | |
OptimizerLoop (const OptimizerLoop &other, ComposedNode *father, bool editionOnly) | |
~OptimizerLoop () | |
void | init (bool start=true) |
void | exUpdateState () |
Update the node state. More... | |
int | getNumberOfInputPorts () const |
InputPort * | edGetPortForOutPool () |
InputPort * | edGetAlgoInitPort () |
OutputPort * | edGetAlgoResultPort () |
InputPort * | getInputPort (const std::string &name) const throw (Exception) |
Get an input port given its name. More... | |
std::list< InputPort * > | getSetOfInputPort () const |
std::list< InputPort * > | getLocalInputPorts () const |
redefined on derived class of ComposedNode. by default a ComposedNode has no port by itself More... | |
void | selectRunnableTasks (std::vector< Task * > &tasks) |
void | getReadyTasks (std::vector< Task * > &tasks) |
YACS::Event | updateStateOnFinishedEventFrom (Node *node) |
void | checkNoCyclePassingThrough (Node *node) throw (Exception) |
virtual void | accept (Visitor *visitor) |
virtual std::string | getSymbol () const |
virtual std::string | getAlgLib () const |
Return the name of the algorithm library. More... | |
virtual void | setAlgorithm (const std::string &alglib, const std::string &symbol, bool checkLinks=true, Proc *procForTypes=NULL) |
Set the algorithm library name and factory name (symbol in library) to create the algorithm and change it if the node is not connected. More... | |
virtual void | checkBasicConsistency () const throw (Exception) |
Check validity for the node. More... | |
virtual std::string | typeName () |
int | getNumberOfOutputPorts () const |
std::list< OutputPort * > | getSetOfOutputPort () const |
std::list< OutputPort * > | getLocalOutputPorts () const |
redefined on derived class of ComposedNode. by default a ComposedNode has no port by itself More... | |
OutPort * | getOutPort (const std::string &name) const throw (Exception) |
OutputPort * | getOutputPort (const std::string &name) const throw (Exception) |
Get an output port given its name. More... | |
YACS::Event | finalize () |
Public Member Functions inherited from YACS::ENGINE::DynParaLoop | |
Node * | edRemoveNode () |
Node * | edRemoveInitNode () |
Node * | edRemoveFinalizeNode () |
Node * | edSetNode (Node *DISOWNnode) |
Node * | edSetInitNode (Node *DISOWNnode) |
Node * | edSetFinalizeNode (Node *DISOWNnode) |
virtual bool | edAddDFLink (OutPort *start, InPort *end) throw (Exception) |
Connect an OutPort to an InPort and add control link if necessary. More... | |
InputPort * | edGetNbOfBranchesPort () |
unsigned | getNumberOfEltsConsumed () const |
int | getBranchIDOfNode (Node *node) const |
OutputPort * | edGetSamplePort () |
bool | isPlacementPredictableB4Run () const |
For the moment false is returned : impovement about it coming soon. More... | |
void | edRemoveChild (Node *node) throw (Exception) |
Remove a child node. More... | |
virtual bool | edAddChild (Node *DISOWNnode) throw (Exception) |
std::list< Node * > | edGetDirectDescendants () const |
unsigned | getNumberOfBranchesCreatedDyn () const throw (Exception) |
Node * | getChildByShortName (const std::string &name) const throw (Exception) |
Node * | getChildByNameExec (const std::string &name, unsigned id) const throw (Exception) |
std::vector< Node * > | getNodes () const |
bool | isMultiplicitySpecified (unsigned &value) const |
void | forceMultiplicity (unsigned value) |
virtual std::string | getErrorReport () |
returns a string that contains an error report if the node is in error More... | |
Node * | getInitNode () |
Node * | getExecNode () |
Node * | getFinalizeNode () |
int | getMaxLevelOfParallelism () const |
Public Member Functions inherited from YACS::ENGINE::ComposedNode | |
virtual | ~ComposedNode () |
bool | isFinished () |
virtual void | resetState (int level) |
Reset the state of the node and its children depending on the parameter level. More... | |
std::string | getName () const |
std::string | getTaskName (Task *task) const |
DeploymentTree | getDeploymentTree () const |
Essentially for test. Use checkDeploymentTree instead to be sure that returned DeploymentTree is consistent. More... | |
DeploymentTree | checkDeploymentTree (bool deep) const throw (Exception) |
Perform check of deployment consistency of the current graph. More... | |
std::vector< Task * > | getNextTasks (bool &isMore) |
void | notifyFrom (const Task *sender, YACS::Event event, const Executor *execInst) |
Notify the node a task has emitted an event. More... | |
bool | edAddLink (OutPort *start, InPort *end) throw (Exception) |
Add a dataflow link between two data ports. More... | |
bool | edAddLink (OutGate *start, InGate *end) throw (Exception) |
Add a controlflow link between two control ports. More... | |
bool | edAddCFLink (Node *nodeS, Node *nodeE) throw (Exception) |
Add a controlflow link between two nodes. More... | |
void | edRemoveCFLink (Node *nodeS, Node *nodeE) throw (Exception) |
Remove a controlflow link. More... | |
void | edRemoveLink (OutPort *start, InPort *end) throw (Exception) |
Remove a dataflow link. More... | |
void | edRemoveLink (OutGate *start, InGate *end) throw (Exception) |
Remove a controlflow link. More... | |
virtual bool | isRepeatedUnpredictablySeveralTimes () const |
virtual void | removeRecursivelyRedundantCL () |
std::list< ElementaryNode * > | getRecursiveConstituents () const |
std::list< Node * > | getAllRecursiveNodes () |
Get all children nodes elementary and composed including this node. More... | |
virtual std::list< Node * > | getAllRecursiveConstituents () |
Idem getAllRecursiveNodes, but this node is NOT included. More... | |
std::list< ProgressWeight > | getProgressWeight () const |
Get the progress weight for all elementary nodes. More... | |
std::string | getInPortName (const InPort *) const throw (Exception) |
Get the input port name. More... | |
std::string | getOutPortName (const OutPort *) const throw (Exception) |
std::set< OutPort * > | getAllOutPortsLeavingCurrentScope () const |
List all output ports of children nodes that are linked to out of scope input ports. More... | |
std::set< InPort * > | getAllInPortsComingFromOutsideOfCurrentScope () const |
List all input ports that are linked to out of scope ports. More... | |
std::list< InputDataStreamPort * > | getSetOfInputDataStreamPort () const |
std::list< OutputDataStreamPort * > | getSetOfOutputDataStreamPort () const |
InputDataStreamPort * | getInputDataStreamPort (const std::string &name) const throw (Exception) |
OutputDataStreamPort * | getOutputDataStreamPort (const std::string &name) const throw (Exception) |
std::vector< std::pair < OutPort *, InPort * > > | getSetOfInternalLinks () const |
virtual std::vector< std::pair < OutPort *, InPort * > > | getSetOfLinksLeavingCurrentScope () const |
void | checkConsistency (LinkInfo &info) const throw (Exception) |
virtual std::vector< std::pair < InPort *, OutPort * > > | getSetOfLinksComingInCurrentScope () const |
virtual void | edUpdateState () |
update the status of the node More... | |
ComposedNode * | getRootNode () const throw (Exception) |
bool | isNodeAlreadyAggregated (const Node *node) const |
Check that Node 'node' is already a direct son of this. More... | |
virtual bool | isNameAlreadyUsed (const std::string &name) const |
Node * | isInMyDescendance (Node *nodeToTest) const |
Returns the parent of a node that is the direct child of this node. More... | |
std::string | getChildName (const Node *node) const throw (Exception) |
virtual std::string | getMyQualifiedName (const Node *directSon) const |
Node * | getChildByName (const std::string &name) const throw (Exception) |
void | loaded () |
void | connected () |
virtual void | cleanNodes () |
Clean the composed node in case of not clean exit. More... | |
virtual std::string | getProgress () const |
Public Member Functions inherited from YACS::ENGINE::Node | |
virtual | ~Node () |
Node * | clone (ComposedNode *father, bool editionOnly=true) const |
This method MUST NEVER BE VIRTUAL More... | |
Node * | cloneWithoutCompAndContDeepCpy (ComposedNode *father, bool editionOnly=true) const |
This method MUST NEVER BE VIRTUAL More... | |
void | setState (YACS::StatesForNode theState) |
Sets the given state for node. More... | |
virtual YACS::StatesForNode | getState () const |
virtual YACS::StatesForNode | getEffectiveState () const |
Return the node state in the context of its father. More... | |
virtual YACS::StatesForNode | getEffectiveState (const Node *) const |
Return the effective state of a node in the context of this one (its father) More... | |
std::string | getColorState (YACS::StatesForNode state) const |
Return the color associated to a state. More... | |
InGate * | getInGate () |
OutGate * | getOutGate () |
const std::string & | getName () const |
void | setName (const std::string &name) |
Change the name of the node. More... | |
ComposedNode * | getFather () const |
const std::string | getId () const |
bool | exIsControlReady () const |
std::list< Node * > | getOutNodes () const |
virtual void | writeDot (std::ostream &os) const |
Dump to the input stream a dot representation of the node. More... | |
virtual void | exFailedState () |
Notify this node that its execution has failed. More... | |
virtual void | exDisabledState () |
Notify this node that it has been disabled. More... | |
std::list< InPort * > | getSetOfInPort () const |
std::list< OutPort * > | getSetOfOutPort () const |
virtual std::set< InputPort * > | edGetSetOfUnitializedInputPort () const |
Becomes deprecated soon. Replaced by ComposedNode::CheckConsistency. More... | |
virtual bool | edAreAllInputPortInitialized () const |
Becomes deprecated soon. Replaced by ComposedNode::CheckConsistency. More... | |
InPort * | getInPort (const std::string &name) const throw (Exception) |
InPropertyPort * | getInPropertyPort () const throw (Exception) |
std::list< ComposedNode * > | getAllAscendanceOf (ComposedNode *levelToStop=0) const |
bool | operator> (const Node &other) const |
bool | operator< (const Node &other) const |
std::string | getImplementation () const |
virtual void | setProperty (const std::string &name, const std::string &value) |
virtual std::string | getProperty (const std::string &name) |
std::map< std::string, std::string > | getProperties () |
std::map< std::string, std::string > | getPropertyMap () |
virtual void | setProperties (std::map< std::string, std::string > properties) |
virtual Proc * | getProc () |
virtual const Proc * | getProc () const |
std::string | getQualifiedName () const |
same as Node::getName() in most cases, but differs for children of switch More... | |
int | getNumId () |
return node instance identifiant, unique for each node instance More... | |
std::vector< std::pair < std::string, int > > | getDPLScopeInfo (ComposedNode *gfn) |
virtual void | applyDPLScope (ComposedNode *gfn) |
virtual void | sendEvent (const std::string &event) |
emit notification to all observers registered with the dispatcher More... | |
virtual void | sendEvent2 (const std::string &event, void *something) |
emit notification to all observers registered with the dispatcher More... | |
virtual std::string | getErrorDetails () const |
virtual void | setErrorDetails (const std::string &error) |
virtual void | modified () |
Sets Node in modified state and its father if it exists. More... | |
virtual int | isModified () |
virtual int | isValid () |
indicates if the node is valid (returns 1) or not (returns 0) More... | |
virtual std::string | getContainerLog () |
returns a string that contains the name of the container log file if it exists More... | |
virtual void | ensureLoading () |
Put this node into TOLOAD state when possible. More... | |
virtual void | getCoupledNodes (std::set< Task * > &coupledNodes) |
Public Member Functions inherited from YACS::ENGINE::Scheduler | |
virtual | ~Scheduler () |
Protected Member Functions | |
virtual YACS::Event | updateStateOnFailedEventFrom (Node *node, const Executor *execInst) |
Method used to notify the node that a child node has failed. More... | |
void | buildDelegateOf (InPort *&port, OutPort *initialStart, const std::list< ComposedNode * > &pointsOfView) |
void | buildDelegateOf (std::pair< OutPort *, OutPort * > &port, InPort *finalTarget, const std::list< ComposedNode * > &pointsOfView) |
void | checkControlDependancy (OutPort *start, InPort *end, bool cross, std::map< ComposedNode *, std::list< OutPort * >, SortHierarc > &fw, std::vector< OutPort * > &fwCross, std::map< ComposedNode *, std::list< OutPort * >, SortHierarc > &bw, LinkInfo &info) const |
void | checkCFLinks (const std::list< OutPort * > &starts, InputPort *end, unsigned char &alreadyFed, bool direction, LinkInfo &info) const |
check control flow links More... | |
void | checkLinkPossibility (OutPort *start, const std::list< ComposedNode * > &pointsOfViewStart, InPort *end, const std::list< ComposedNode * > &pointsOfViewEnd) throw (Exception) |
void | cleanInterceptors () |
void | launchMaxOfSamples (bool first) |
bool | isFullyLazy () const |
bool | isFullyBusy (unsigned &branchId) const |
void | initInterceptors (unsigned nbOfBr) |
void | pushValueOutOfScopeForCase (unsigned branchId) |
Node * | simpleClone (ComposedNode *father, bool editionOnly=true) const |
virtual void | loadAlgorithm () |
Load the algorithm from the dynamic library. More... | |
Protected Member Functions inherited from YACS::ENGINE::DynParaLoop | |
DynParaLoop (const std::string &name, TypeCode *typeOfDataSplitted) | |
virtual | ~DynParaLoop () |
DynParaLoop (const DynParaLoop &other, ComposedNode *father, bool editionOnly) | |
void | cleanDynGraph () |
void | prepareInputsFromOutOfScope (int branchNb) |
void | putValueOnBranch (Any *val, unsigned branchId, bool first) |
TypeOfNode | getIdentityOfNotifyerNode (const Node *node, unsigned &id) |
InputPort * | getDynInputPortByAbsName (int branchNb, const std::string &name, bool initNodeAdmitted) |
virtual void | forwardExecStateToOriginalBody (Node *execNode) |
std::vector< Node * > | cloneAndPlaceNodesCoherently (const std::vector< Node * > &origNodes) |
Clone nodes and make their placement consistent with the placement of the original ones. More... | |
Node * | checkConsistencyAndSetNode (Node *&nodeToReplace, Node *DISOWNnode) |
This method is used to factorize methods edSetNode, edSetInitNode and edSetFinalizeNode. More... | |
Node * | removeNode (Node *&nodeToRemove) |
This method is used to factorize methods edRemoveNode, edRemoveInitNode and edRemoveFinalizeNode. More... | |
virtual void | shutdown (int level) |
Stop all pending activities of the composed node. More... | |
Protected Member Functions inherited from YACS::ENGINE::ComposedNode | |
ComposedNode (const std::string &name) | |
ComposedNode (const ComposedNode &other, ComposedNode *father) | |
void | performDuplicationOfPlacement (const Node &other) |
performs a duplication of placement using clone method of containers and components. clone behaviour is driven by attachOnCloning attribute. More... | |
void | performShallowDuplicationOfPlacement (const Node &other) |
performs a also duplication of placement but here containers and components are not copied at all whatever the value of attachedOnCloning. More... | |
void | edDisconnectAllLinksWithMe () |
YACS::Event | updateStateFrom (Node *node, YACS::Event event, const Executor *execInst) |
Update node state on receiving event from a node. More... | |
virtual YACS::Event | updateStateOnStartEventFrom (Node *node) |
Method used to notify the node that a child node has started. More... | |
virtual void | getDelegateOf (InPort *&port, OutPort *initialStart, const std::list< ComposedNode * > &pointsOfView) throw (Exception) |
virtual void | getDelegateOf (std::pair< OutPort *, OutPort * > &port, InPort *finalTarget, const std::list< ComposedNode * > &pointsOfView) throw (Exception) |
virtual void | releaseDelegateOf (InPort *&port, OutPort *initialStart, const std::list< ComposedNode * > &pointsOfView) throw (Exception) |
virtual void | releaseDelegateOf (OutPort *portDwn, OutPort *portUp, InPort *finalTarget, const std::list< ComposedNode * > &pointsOfView) throw (Exception) |
void | checkInMyDescendance (Node *nodeToTest) const throw (Exception) |
Check if a node is in the descendance of this node. More... | |
template<class PORT > | |
std::string | getPortName (const PORT *port) const throw (Exception) |
void | checkNoCrossHierachyWith (Node *node) const throw (Exception) |
virtual void | performCFComputations (LinkInfo &info) const |
perform recursively all CF computations. More... | |
virtual void | destructCFComputations (LinkInfo &info) const |
destroy recursively all results of initial computations. More... | |
Node * | getLowestNodeDealingAll (const std::list< OutPort * > &ports) const |
void | checkLinksCoherenceRegardingControl (const std::vector< OutPort * > &starts, InputPort *end, LinkInfo &info) const throw (Exception) |
void | solveObviousOrDelegateCFLinks (const std::list< OutPort * > &starts, InputPort *end, unsigned char &alreadyFed, bool direction, LinkInfo &info) const |
Protected Member Functions inherited from YACS::ENGINE::Node | |
Node (const std::string &name) | |
Node (const Node &other, ComposedNode *father) | |
virtual void | exForwardFailed () |
virtual void | exForwardFinished () |
Protected Attributes | |
Pool | _myPool |
bool | _algInitOnFile |
std::string | _symbol |
std::string | _alglib |
AnyInputPort | _algoInitPort |
::YACS::BASES::DynLibLoader * | _loader |
OptimizerAlgBase * | _alg |
AnyInputPort | _retPortForOutPool |
std::vector< bool > | _initNodeUpdated |
bool | _convergenceReachedWithOtherCalc |
FakeNodeForOptimizerLoop * | _nodeForSpecialCases |
std::vector< AnyInputPort * > | _interceptorsForOutPool |
std::map< InputPort *, std::vector< InputPort * > > | _interceptors |
outputports interceptors leaving current scope. More... | |
AnyOutputPort | _algoResultPort |
Protected Attributes inherited from YACS::ENGINE::DynParaLoop | |
Node * | _node |
Node * | _initNode |
Node * | _finalizeNode |
unsigned | _nbOfEltConsumed |
std::vector< int > | _execIds |
AnyInputPort | _nbOfBranches |
AnyOutputPort | _splittedPort |
std::vector< Node * > | _execNodes |
std::vector< Node * > | _execInitNodes |
std::vector< Node * > | _execFinalizeNodes |
int | _initializingCounter |
int | _unfinishedCounter |
int | _failedCounter |
Static Protected Attributes | |
static const int | NOT_RUNNING_BRANCH_ID =-1973012217 |
static const int | NOT_INITIALIZED_BRANCH_ID =-1973 |
static const char | NAME_OF_ALGO_INIT_PORT [] = "algoInit" |
static const char | NAME_OF_OUT_POOL_INPUT [] = "evalResults" |
static const char | NAME_OF_ALGO_RESULT_PORT [] = "algoResults" |
Static Protected Attributes inherited from YACS::ENGINE::DynParaLoop | |
static const char | NAME_OF_SPLITTED_SEQ_OUT [] = "evalSamples" |
static const char | OLD_NAME_OF_SPLITTED_SEQ_OUT [] = "SmplPrt" |
static const char | NAME_OF_NUMBER_OF_BRANCHES [] ="nbBranches" |
Static Protected Attributes inherited from YACS::ENGINE::ComposedNode | |
static const char | SEP_CHAR_BTW_LEVEL [] ="." |
static const unsigned char | FED_ST = 2 |
static const unsigned char | FREE_ST = 0 |
static const unsigned char | FED_DS_ST = 1 |
Static Protected Attributes inherited from YACS::ENGINE::Node | |
static const char | SEP_CHAR_IN_PORT [] ="." |
static int | _total = 0 |
Private Member Functions | |
TypeCode * | checkTypeCode (TypeCode *tc, const char *portName) |
Friends | |
class | FakeNodeForOptimizerLoop |
Additional Inherited Members | |
Static Public Member Functions inherited from YACS::ENGINE::ComposedNode | |
static ComposedNode * | getLowestCommonAncestor (Node *node1, Node *node2) throw (Exception) |
Retrieves the lowest common ancestor of 2 nodes. More... | |
static std::string | getLowestCommonAncestorStr (const std::string &node1, const std::string &node2) |
Public Attributes inherited from YACS::ENGINE::Node | |
YACS::Colour | _colour |
Static Public Attributes inherited from YACS::ENGINE::Node | |
static std::map< int, Node * > | idMap |
Protected Types inherited from YACS::ENGINE::DynParaLoop | |
enum | TypeOfNode { INIT_NODE = 5, WORK_NODE = 6, FINALIZE_NODE = 7 } |
Static Protected Member Functions inherited from YACS::ENGINE::ComposedNode | |
static bool | splitNamesBySep (const std::string &globalName, const char separator[], std::string &firstPart, std::string &lastPart, bool priority) throw (Exception) |
Splits name globalName in 2 parts using separator. More... | |
class to build optimization loops
Definition at line 56 of file OptimizerLoop.hxx.
OptimizerLoop::OptimizerLoop | ( | const std::string & | name, |
const std::string & | algLibWthOutExt, | ||
const std::string & | symbolNameToOptimizerAlgBaseInstanceFactory, | ||
bool | algInitOnFile, | ||
bool | initAlgo = true , |
||
Proc * | procForTypes = NULL |
||
) |
Definition at line 98 of file OptimizerLoop.cxx.
References setAlgorithm().
Referenced by simpleClone().
OptimizerLoop::OptimizerLoop | ( | const OptimizerLoop & | other, |
ComposedNode * | father, | ||
bool | editionOnly | ||
) |
Definition at line 113 of file OptimizerLoop.cxx.
References _retPortForOutPool, YACS::ENGINE::ComposedNode::edAddLink(), YACS::ENGINE::InPort::edSetOutPort(), getOutPort(), and YACS::ENGINE::ComposedNode::getPortName().
OptimizerLoop::~OptimizerLoop | ( | ) |
Definition at line 127 of file OptimizerLoop.cxx.
References _alg, _loader, _nodeForSpecialCases, YACS::ENGINE::DynParaLoop::cleanDynGraph(), cleanInterceptors(), and YACS::ENGINE::RefCounter::decrRef().
|
virtual |
Reimplemented from YACS::ENGINE::DynParaLoop.
Definition at line 694 of file OptimizerLoop.cxx.
References YACS::ENGINE::Visitor::visitOptimizerLoop().
|
protectedvirtual |
Reimplemented from YACS::ENGINE::DynParaLoop.
Definition at line 474 of file OptimizerLoop.cxx.
References _retPortForOutPool, YACS::ENGINE::DynParaLoop::buildDelegateOf(), and YACS::ENGINE::DataPort::getName().
|
protectedvirtual |
Reimplemented from YACS::ENGINE::DynParaLoop.
Definition at line 487 of file OptimizerLoop.cxx.
References _algoResultPort, YACS::ENGINE::DynParaLoop::buildDelegateOf(), YACS::ENGINE::DataPort::getName(), and YACS::ENGINE::OutputPort::NAME.
|
virtual |
Check validity for the node.
Throw an exception if the node is not valid
Reimplemented from YACS::ENGINE::DynParaLoop.
Definition at line 801 of file OptimizerLoop.cxx.
References _alg, _alglib, YACS::ENGINE::Node::_errorDetails, _symbol, YACS::ENGINE::DynParaLoop::checkBasicConsistency(), and DEBTRACE.
|
protectedvirtual |
check control flow links
starts | If different of 0, must aggregate at leat 1 element. |
end | : |
alreadyFed | in/out parameter. Indicates if 'end' ports is already and surely set or fed by an another port. |
direction | If true : forward direction else backward direction. |
info | : informations collectedduring the check |
Reimplemented from YACS::ENGINE::DynParaLoop.
Definition at line 516 of file OptimizerLoop.cxx.
References _retPortForOutPool, YACS::ENGINE::DynParaLoop::checkCFLinks(), and YACS::ENGINE::ComposedNode::solveObviousOrDelegateCFLinks().
|
protectedvirtual |
start | : start port |
end | : end port |
cross | indicates if start -> end link is a DS link behind. |
fw | out parameter. |
fwCross | out parameter storing links where a cross has been detected. |
bw | out parameter where backward links are stored. |
info | : collected information |
Reimplemented from YACS::ENGINE::DynParaLoop.
Definition at line 504 of file OptimizerLoop.cxx.
References _retPortForOutPool, and YACS::ENGINE::DynParaLoop::checkControlDependancy().
|
protectedvirtual |
Reimplemented from YACS::ENGINE::DynParaLoop.
Definition at line 524 of file OptimizerLoop.cxx.
References YACS::ENGINE::DynParaLoop::checkLinkPossibility().
Implements YACS::ENGINE::ComposedNode.
Definition at line 470 of file OptimizerLoop.cxx.
Definition at line 743 of file OptimizerLoop.cxx.
References YACS::ENGINE::ComposedNode::getName().
Referenced by setAlgorithm().
|
protected |
Definition at line 547 of file OptimizerLoop.cxx.
References _interceptors, and _interceptorsForOutPool.
Referenced by init(), and ~OptimizerLoop().
|
inline |
Definition at line 86 of file OptimizerLoop.hxx.
Referenced by YACS::HMI::EditionOptimizerLoop::onModifyInitFile(), and YACS::HMI::EditionOptimizerLoop::update().
|
inline |
Definition at line 87 of file OptimizerLoop.hxx.
Referenced by YACS::HMI::EditionOptimizerLoop::update().
|
inline |
Definition at line 85 of file OptimizerLoop.hxx.
Referenced by YACS::HMI::CommandSetAlgo::localExecute(), YACS::HMI::CommandSetAlgo::localReverse(), and YACS::HMI::EditionOptimizerLoop::update().
|
virtual |
Update the node state.
Called by InGate::exNotifyFromPrecursor
Reimplemented from YACS::ENGINE::Node.
Definition at line 161 of file OptimizerLoop.cxx.
References _alg, _algoInitPort, _algoResultPort, YACS::ENGINE::DynParaLoop::_execFinalizeNodes, YACS::ENGINE::DynParaLoop::_execIds, YACS::ENGINE::DynParaLoop::_execInitNodes, YACS::ENGINE::DynParaLoop::_execNodes, YACS::ENGINE::DynParaLoop::_finalizeNode, YACS::ENGINE::Node::_inGate, YACS::ENGINE::DynParaLoop::_initializingCounter, YACS::ENGINE::DynParaLoop::_initNode, _initNodeUpdated, _myPool, YACS::ENGINE::Node::_name, YACS::ENGINE::DynParaLoop::_nbOfBranches, YACS::ENGINE::DynParaLoop::_node, _nodeForSpecialCases, YACS::ENGINE::Node::_state, YACS::ENGINE::DynParaLoop::cloneAndPlaceNodesCoherently(), YACS::ENGINE::Pool::destroyAll(), YACS::DISABLED, YACS::ENGINE::InGate::exIsReady(), FakeNodeForOptimizerLoop, YACS::ENGINE::OptimizerAlgBase::finishProxy(), YACS::ENGINE::ComposedNode::getAllOutPortsLeavingCurrentScope(), YACS::ENGINE::OptimizerAlgBase::getError(), YACS::ENGINE::AnyInputPort::getIntValue(), YACS::ENGINE::Pool::getNextSampleWithHighestPriority(), YACS::ENGINE::AnyInputPort::getValue(), YACS::ENGINE::OptimizerAlgBase::hasError(), CORBAEngineTest::i, YACS::ENGINE::OptimizerAlgBase::initializeProxy(), initInterceptors(), launchMaxOfSamples(), NOT_INITIALIZED_BRANCH_ID, YACS::ENGINE::DynParaLoop::prepareInputsFromOutOfScope(), YACS::ENGINE::OptimizerAlgBase::setNbOfBranches(), YACS::ENGINE::Node::setState(), YACS::ENGINE::OptimizerAlgBase::startProxy(), and YACS::TOACTIVATE.
YACS::Event OptimizerLoop::finalize | ( | ) |
Definition at line 410 of file OptimizerLoop.cxx.
References _alg, _algoResultPort, YACS::ENGINE::DynParaLoop::_execFinalizeNodes, YACS::ENGINE::DynParaLoop::_execIds, YACS::ENGINE::DynParaLoop::_finalizeNode, YACS::ENGINE::DynParaLoop::_nbOfBranches, YACS::ENGINE::DynParaLoop::_node, YACS::ENGINE::DynParaLoop::_unfinishedCounter, DEBTRACE, YACS::DONE, YACS::FINISH, YACS::ENGINE::OptimizerAlgBase::finishProxy(), YACS::ENGINE::OptimizerAlgBase::getAlgoResultProxy(), YACS::ENGINE::ComposedNode::getAllRecursiveConstituents(), YACS::ENGINE::AnyInputPort::getIntValue(), CORBAEngineTest::i, YACS::NOEVENT, NOT_INITIALIZED_BRANCH_ID, NOT_RUNNING_BRANCH_ID, YACS::ENGINE::AnyOutputPort::put(), YACS::ENGINE::Node::setState(), and YASSERT.
Referenced by updateStateOnFinishedEventFrom().
|
virtual |
Return the name of the algorithm library.
Definition at line 792 of file OptimizerLoop.cxx.
References _alglib.
Referenced by YACS::HMI::EditionOptimizerLoop::onModifyLib(), YACS::HMI::EditionOptimizerLoop::update(), and YACS::ENGINE::VisitorSaveSchema::visitOptimizerLoop().
Get an input port given its name.
Contrary to YACS::ENGINE::ComposedNode::getOutputPort, this method is NOT recursive and so the leaf of type ElementaryNode aggregating this InputPort is directly invoked.
Reimplemented from YACS::ENGINE::DynParaLoop.
Definition at line 266 of file OptimizerLoop.cxx.
References YACS::ENGINE::DynParaLoop::getInputPort().
|
virtual |
redefined on derived class of ComposedNode. by default a ComposedNode has no port by itself
Reimplemented from YACS::ENGINE::DynParaLoop.
Definition at line 284 of file OptimizerLoop.cxx.
References _algoInitPort, _retPortForOutPool, YACS::ENGINE::DynParaLoop::getLocalInputPorts(), and PMMLBasicsTestLauncher::ret.
|
virtual |
redefined on derived class of ComposedNode. by default a ComposedNode has no port by itself
Reimplemented from YACS::ENGINE::DynParaLoop.
Definition at line 826 of file OptimizerLoop.cxx.
References _algoResultPort, YACS::ENGINE::DynParaLoop::getLocalOutputPorts(), and PMMLBasicsTestLauncher::ret.
|
virtual |
Reimplemented from YACS::ENGINE::DynParaLoop.
Definition at line 261 of file OptimizerLoop.cxx.
References YACS::ENGINE::DynParaLoop::getNumberOfInputPorts().
|
virtual |
Reimplemented from YACS::ENGINE::DynParaLoop.
Definition at line 814 of file OptimizerLoop.cxx.
References YACS::ENGINE::DynParaLoop::getNumberOfOutputPorts().
Reimplemented from YACS::ENGINE::DynParaLoop.
Definition at line 833 of file OptimizerLoop.cxx.
References YACS::ENGINE::DynParaLoop::getOutPort().
Referenced by OptimizerLoop().
|
virtual |
Get an output port given its name.
Contrary to YACS::ENGINE::ComposedNode::getInputPort, this method is recursive and go down hierarchy step by step to complete its work.
Reimplemented from YACS::ENGINE::DynParaLoop.
Definition at line 840 of file OptimizerLoop.cxx.
References YACS::ENGINE::DynParaLoop::getOutputPort().
Referenced by initInterceptors().
|
virtual |
Implements YACS::ENGINE::Node.
Definition at line 296 of file OptimizerLoop.cxx.
References YACS::ENGINE::DynParaLoop::_execFinalizeNodes, YACS::ENGINE::DynParaLoop::_execInitNodes, YACS::ENGINE::DynParaLoop::_execNodes, YACS::ENGINE::DynParaLoop::_node, _nodeForSpecialCases, YACS::ENGINE::Node::_state, YACS::ACTIVATED, YACS::ENGINE::ElementaryNode::getReadyTasks(), and YACS::TOACTIVATE.
|
virtual |
Reimplemented from YACS::ENGINE::DynParaLoop.
Definition at line 276 of file OptimizerLoop.cxx.
References _algoInitPort, _retPortForOutPool, YACS::ENGINE::DynParaLoop::getSetOfInputPort(), and PMMLBasicsTestLauncher::ret.
|
virtual |
Reimplemented from YACS::ENGINE::DynParaLoop.
Definition at line 819 of file OptimizerLoop.cxx.
References _algoResultPort, YACS::ENGINE::DynParaLoop::getSetOfOutputPort(), and PMMLBasicsTestLauncher::ret.
|
inlinevirtual |
Definition at line 96 of file OptimizerLoop.hxx.
Referenced by YACS::HMI::EditionOptimizerLoop::onModifyEntry(), YACS::HMI::EditionOptimizerLoop::update(), and YACS::ENGINE::VisitorSaveSchema::visitOptimizerLoop().
|
virtual |
initialisation of all input and output ports and gates, for execution
Reimplemented from YACS::ENGINE::DynParaLoop.
Definition at line 150 of file OptimizerLoop.cxx.
References _algoInitPort, _algoResultPort, _convergenceReachedWithOtherCalc, _retPortForOutPool, YACS::ENGINE::DynParaLoop::cleanDynGraph(), cleanInterceptors(), YACS::ENGINE::OutputPort::exInit(), YACS::ENGINE::InputPort::exInit(), and YACS::ENGINE::DynParaLoop::init().
|
protected |
Perform initialization of interceptors. WARNING _execNodes have to be created before.
Definition at line 620 of file OptimizerLoop.cxx.
References _algoResultPort, YACS::ENGINE::DynParaLoop::_execInitNodes, YACS::ENGINE::DynParaLoop::_execNodes, YACS::ENGINE::DynParaLoop::_initNode, _interceptors, _interceptorsForOutPool, YACS::ENGINE::DynParaLoop::_node, _retPortForOutPool, YACS::ENGINE::OutPort::addInPort(), YACS::ENGINE::AnyInputPort::clone(), YACS::ENGINE::InputPort::clone(), YACS::ENGINE::Node::clone(), YACS::ENGINE::OutputPort::edAddInputPort(), YACS::ENGINE::InPort::edSetOutPort(), YACS::ENGINE::ComposedNode::getAllOutPortsLeavingCurrentScope(), YACS::ENGINE::Port::getNode(), YACS::ENGINE::Node::getOutPortName(), getOutputPort(), YACS::ENGINE::InputPort::getPublicRepresentant(), YACS::ENGINE::OutputPort::getSetOfPhyLinks(), CORBAEngineTest::i, and YACS::ENGINE::ComposedNode::isInMyDescendance().
Referenced by exUpdateState().
|
protected |
Returns if a dynamic branch is available.
branchId | Out param. Only usable if returned value is equal to false. |
Definition at line 606 of file OptimizerLoop.cxx.
References YACS::ENGINE::DynParaLoop::_execIds, CORBAEngineTest::i, YACS::ENGINE::ComposedNode::isFinished(), NOT_INITIALIZED_BRANCH_ID, and NOT_RUNNING_BRANCH_ID.
Referenced by launchMaxOfSamples().
|
protected |
Definition at line 594 of file OptimizerLoop.cxx.
References YACS::ENGINE::DynParaLoop::_execIds, CORBAEngineTest::i, NOT_INITIALIZED_BRANCH_ID, and NOT_RUNNING_BRANCH_ID.
Referenced by updateStateOnFinishedEventFrom().
|
protected |
Definition at line 560 of file OptimizerLoop.cxx.
References YACS::ENGINE::DynParaLoop::_execIds, YACS::ENGINE::DynParaLoop::_execInitNodes, YACS::ENGINE::DynParaLoop::_execNodes, YACS::ENGINE::DynParaLoop::_initializingCounter, YACS::ENGINE::DynParaLoop::_initNode, _initNodeUpdated, _myPool, YACS::ENGINE::DynParaLoop::_nbOfEltConsumed, YACS::ENGINE::Pool::getNextSampleWithHighestPriority(), CORBAEngineTest::i, isFullyBusy(), YACS::ENGINE::Pool::markIdAsInUse(), NOT_INITIALIZED_BRANCH_ID, and YACS::ENGINE::DynParaLoop::putValueOnBranch().
Referenced by exUpdateState(), and updateStateOnFinishedEventFrom().
|
protectedvirtual |
Load the algorithm from the dynamic library.
Reimplemented in YACS::ENGINE::SalomeOptimizerLoop.
Definition at line 758 of file OptimizerLoop.cxx.
References _alg, _alglib, YACS::ENGINE::Node::_errorDetails, _loader, _myPool, _symbol, YACS::ENGINE::Node::modified(), YACS::Exception::what(), and YASSERT.
Referenced by YACS::ENGINE::SalomeOptimizerLoop::loadAlgorithm(), and setAlgorithm().
|
protected |
Typically called when _alg has decided that convergence has been reached. In this case the links leaving the current scope are activated and filled with value of the branch specified by 'branchId' that is the branch in which the convergence has been reached.
Definition at line 687 of file OptimizerLoop.cxx.
References _interceptors.
Referenced by updateStateOnFinishedEventFrom().
|
virtual |
|
virtual |
Set the algorithm library name and factory name (symbol in library) to create the algorithm and change it if the node is not connected.
throw an exception if the node is connected
Definition at line 703 of file OptimizerLoop.cxx.
References _alg, _alglib, _algoInitPort, _algoResultPort, _retPortForOutPool, YACS::ENGINE::DynParaLoop::_splittedPort, _symbol, checkTypeCode(), YACS::ENGINE::RefCounter::decrRef(), YACS::ENGINE::InPort::edGetNumberOfLinks(), YACS::ENGINE::OutPort::edGetNumberOfOutLinks(), YACS::ENGINE::DataPort::edSetType(), YACS::ENGINE::Node::getProc(), YACS::ENGINE::OptimizerAlgBase::getTCForAlgoInitProxy(), YACS::ENGINE::OptimizerAlgBase::getTCForAlgoResultProxy(), YACS::ENGINE::OptimizerAlgBase::getTCForInProxy(), YACS::ENGINE::OptimizerAlgBase::getTCForOutProxy(), loadAlgorithm(), YACS::ENGINE::Node::modified(), NAME_OF_ALGO_INIT_PORT, NAME_OF_ALGO_RESULT_PORT, NAME_OF_OUT_POOL_INPUT, YACS::ENGINE::DynParaLoop::NAME_OF_SPLITTED_SEQ_OUT, YACS::ENGINE::AnyInputPort::put(), and YACS::ENGINE::OptimizerAlgBase::setProc().
Referenced by YACS::HMI::CommandSetAlgo::localExecute(), YACS::HMI::CommandSetAlgo::localReverse(), OptimizerLoop(), YACS::ENGINE::SalomeOptimizerLoop::SalomeOptimizerLoop(), YACS::ENGINE::SalomeOptimizerLoop::simpleClone(), and simpleClone().
|
protectedvirtual |
Implements YACS::ENGINE::Node.
Reimplemented in YACS::ENGINE::SalomeOptimizerLoop.
Definition at line 137 of file OptimizerLoop.cxx.
References _alglib, _symbol, YACS::ENGINE::Node::getProc(), OptimizerLoop(), and setAlgorithm().
|
inlinevirtual |
Reimplemented from YACS::ENGINE::ComposedNode.
Reimplemented in YACS::ENGINE::SalomeOptimizerLoop.
Definition at line 101 of file OptimizerLoop.hxx.
|
protectedvirtual |
Method used to notify the node that a child node has failed.
Notify the slave thread of the error, update the current state and return the change state
node | : the child node that has failed |
Reimplemented from YACS::ENGINE::DynParaLoop.
Definition at line 459 of file OptimizerLoop.cxx.
References _alg, _myPool, DEBTRACE, YACS::ENGINE::Pool::destroyAll(), YACS::ENGINE::OptimizerAlgBase::finishProxy(), YACS::ENGINE::Node::getErrorReport(), YACS::ENGINE::Node::getName(), YACS::ENGINE::OptimizerAlgBase::setError(), and YACS::ENGINE::DynParaLoop::updateStateOnFailedEventFrom().
|
virtual |
Implements YACS::ENGINE::ComposedNode.
Definition at line 317 of file OptimizerLoop.cxx.
References _alg, _convergenceReachedWithOtherCalc, YACS::ENGINE::Node::_errorDetails, YACS::ENGINE::DynParaLoop::_execIds, YACS::ENGINE::DynParaLoop::_execNodes, YACS::ENGINE::DynParaLoop::_finalizeNode, YACS::ENGINE::DynParaLoop::_initializingCounter, YACS::ENGINE::DynParaLoop::_initNode, _interceptorsForOutPool, _myPool, YACS::ENGINE::DynParaLoop::_nbOfEltConsumed, YACS::ENGINE::DynParaLoop::_unfinishedCounter, YACS::ABORT, YACS::ENGINE::Pool::destroyCurrentCase(), YACS::DONE, YACS::ENGINE::Pool::empty(), YACS::ERROR, YACS::ENGINE::Node::exForwardFailed(), YACS::FAILED, finalize(), YACS::ENGINE::DynParaLoop::FINALIZE_NODE, YACS::FINISH, YACS::ENGINE::OptimizerAlgBase::finishProxy(), YACS::ENGINE::OptimizerAlgBase::getError(), YACS::ENGINE::DynParaLoop::getIdentityOfNotifyerNode(), YACS::ENGINE::Pool::getNextSampleWithHighestPriority(), YACS::ENGINE::Node::getState(), YACS::ENGINE::OptimizerAlgBase::hasError(), CORBAEngineTest::i, YACS::ENGINE::DynParaLoop::INIT_NODE, YACS::ENGINE::ComposedNode::isFinished(), isFullyLazy(), launchMaxOfSamples(), YACS::NOEVENT, NOT_INITIALIZED_BRANCH_ID, NOT_RUNNING_BRANCH_ID, pushValueOutOfScopeForCase(), YACS::ENGINE::Pool::putOutSampleAt(), YACS::ENGINE::Pool::setCurrentId(), YACS::ENGINE::Node::setState(), YACS::ENGINE::OptimizerAlgBase::takeDecisionProxy(), YACS::ENGINE::DynParaLoop::WORK_NODE, and YASSERT.
|
friend |
Definition at line 58 of file OptimizerLoop.hxx.
Referenced by exUpdateState().
|
protected |
Definition at line 67 of file OptimizerLoop.hxx.
Referenced by checkBasicConsistency(), YACS::ENGINE::FakeNodeForOptimizerLoop::execute(), exUpdateState(), finalize(), YACS::ENGINE::SalomeOptimizerLoop::loadAlgorithm(), loadAlgorithm(), setAlgorithm(), updateStateOnFailedEventFrom(), updateStateOnFinishedEventFrom(), and ~OptimizerLoop().
|
protected |
Definition at line 62 of file OptimizerLoop.hxx.
|
protected |
Definition at line 64 of file OptimizerLoop.hxx.
Referenced by checkBasicConsistency(), getAlgLib(), YACS::ENGINE::SalomeOptimizerLoop::loadAlgorithm(), loadAlgorithm(), setAlgorithm(), YACS::ENGINE::SalomeOptimizerLoop::simpleClone(), and simpleClone().
|
protected |
Definition at line 65 of file OptimizerLoop.hxx.
Referenced by exUpdateState(), getLocalInputPorts(), getSetOfInputPort(), init(), and setAlgorithm().
|
protected |
Definition at line 75 of file OptimizerLoop.hxx.
Referenced by buildDelegateOf(), YACS::ENGINE::FakeNodeForOptimizerLoop::execute(), exUpdateState(), finalize(), getLocalOutputPorts(), getSetOfOutputPort(), init(), initInterceptors(), and setAlgorithm().
|
protected |
Definition at line 70 of file OptimizerLoop.hxx.
Referenced by init(), and updateStateOnFinishedEventFrom().
|
protected |
Definition at line 69 of file OptimizerLoop.hxx.
Referenced by exUpdateState(), and launchMaxOfSamples().
|
protected |
outputports interceptors leaving current scope.
Definition at line 74 of file OptimizerLoop.hxx.
Referenced by cleanInterceptors(), initInterceptors(), and pushValueOutOfScopeForCase().
|
protected |
Definition at line 72 of file OptimizerLoop.hxx.
Referenced by cleanInterceptors(), initInterceptors(), and updateStateOnFinishedEventFrom().
|
protected |
Definition at line 66 of file OptimizerLoop.hxx.
Referenced by loadAlgorithm(), and ~OptimizerLoop().
|
protected |
Definition at line 61 of file OptimizerLoop.hxx.
Referenced by exUpdateState(), launchMaxOfSamples(), YACS::ENGINE::SalomeOptimizerLoop::loadAlgorithm(), loadAlgorithm(), updateStateOnFailedEventFrom(), and updateStateOnFinishedEventFrom().
|
protected |
Definition at line 71 of file OptimizerLoop.hxx.
Referenced by exUpdateState(), getReadyTasks(), and ~OptimizerLoop().
|
protected |
Definition at line 68 of file OptimizerLoop.hxx.
Referenced by buildDelegateOf(), checkCFLinks(), checkControlDependancy(), getLocalInputPorts(), getSetOfInputPort(), init(), initInterceptors(), OptimizerLoop(), and setAlgorithm().
|
protected |
Definition at line 63 of file OptimizerLoop.hxx.
Referenced by checkBasicConsistency(), YACS::ENGINE::SalomeOptimizerLoop::loadAlgorithm(), loadAlgorithm(), setAlgorithm(), YACS::ENGINE::SalomeOptimizerLoop::simpleClone(), and simpleClone().
|
staticprotected |
Definition at line 137 of file OptimizerLoop.hxx.
Referenced by setAlgorithm().
|
staticprotected |
Definition at line 139 of file OptimizerLoop.hxx.
Referenced by setAlgorithm().
|
staticprotected |
Definition at line 138 of file OptimizerLoop.hxx.
Referenced by setAlgorithm().
|
staticprotected |
Definition at line 136 of file OptimizerLoop.hxx.
Referenced by exUpdateState(), finalize(), isFullyBusy(), isFullyLazy(), launchMaxOfSamples(), and updateStateOnFinishedEventFrom().
|
staticprotected |
Definition at line 135 of file OptimizerLoop.hxx.
Referenced by finalize(), isFullyBusy(), isFullyLazy(), and updateStateOnFinishedEventFrom().