20 #ifndef __OPTIMIZERLOOP_HXX__
21 #define __OPTIMIZERLOOP_HXX__
77 OptimizerLoop(
const std::string& name,
const std::string& algLibWthOutExt,
78 const std::string& symbolNameToOptimizerAlgBaseInstanceFactory,
79 bool algInitOnFile,
bool initAlgo=
true,
Proc * procForTypes = NULL);
82 void init(
bool start=
true);
84 int getNumberOfInputPorts()
const;
88 InputPort *getInputPort(
const std::string& name)
const ;
89 std::list<InputPort *> getSetOfInputPort()
const;
90 std::list<InputPort *> getLocalInputPorts()
const;
91 void selectRunnableTasks(std::vector<Task *>& tasks);
92 void getReadyTasks(std::vector<Task *>& tasks);
94 void checkNoCyclePassingThrough(
Node *node) ;
95 virtual void accept(
Visitor *visitor);
96 virtual std::string
getSymbol()
const {
return _symbol; }
97 virtual std::string getAlgLib()
const ;
98 virtual void setAlgorithm(
const std::string& alglib,
const std::string& symbol,
99 bool checkLinks=
true,
Proc * procForTypes = NULL);
100 virtual void checkBasicConsistency()
const ;
101 virtual std::string
typeName() {
return "YACS__ENGINE__OptimizerLoop";}
102 int getNumberOfOutputPorts()
const;
103 std::list<OutputPort *> getSetOfOutputPort()
const;
104 std::list<OutputPort *> getLocalOutputPorts()
const;
105 OutPort *getOutPort(
const std::string& name)
const ;
106 OutputPort *getOutputPort(
const std::string& name)
const ;
110 void buildDelegateOf(
InPort * & port,
OutPort *initialStart,
const std::list<ComposedNode *>& pointsOfView);
111 void buildDelegateOf(std::pair<OutPort *, OutPort *>& port,
InPort *finalTarget,
const std::list<ComposedNode *>& pointsOfView);
112 void checkControlDependancy(
OutPort *start,
InPort *end,
bool cross,
113 std::map <
ComposedNode *, std::list < OutPort * >, SortHierarc >& fw,
114 std::vector<OutPort *>& fwCross,
115 std::map<
ComposedNode *, std::list < OutPort *>, SortHierarc >& bw,
117 void checkCFLinks(
const std::list<OutPort *>& starts,
InputPort *end,
unsigned char& alreadyFed,
bool direction,
LinkInfo& info)
const;
118 void checkLinkPossibility(
OutPort *start,
const std::list<ComposedNode *>& pointsOfViewStart,
119 InPort *end,
const std::list<ComposedNode *>& pointsOfViewEnd) ;
121 void cleanInterceptors();
122 void launchMaxOfSamples(
bool first);
123 bool isFullyLazy()
const;
124 bool isFullyBusy(
unsigned& branchId)
const;
125 void initInterceptors(
unsigned nbOfBr);
126 void pushValueOutOfScopeForCase(
unsigned branchId);
128 virtual void loadAlgorithm();
136 static const char NAME_OF_ALGO_INIT_PORT[];
137 static const char NAME_OF_OUT_POOL_INPUT[];
138 static const char NAME_OF_ALGO_RESULT_PORT[];
#define YACSLIBENGINE_EXPORT
Base class for all composed nodes.
Base class for dynamically (fully or semifully) built graphs.
Base class for all calculation nodes.
Node * simpleClone(ComposedNode *father, bool editionOnly) const
FakeNodeForOptimizerLoop(OptimizerLoop *loop, bool normal, std::string message)
Class that deal with list of semantics links for high level analysis.
Base class for all nodes.
Base class factorizing common methods for all algorithms interfaces.
class to build optimization loops
OutputPort * edGetAlgoResultPort()
virtual std::string getSymbol() const
virtual std::string typeName()
std::map< InputPort *, std::vector< InputPort * > > _interceptors
outputports interceptors leaving current scope.
AnyInputPort _algoInitPort
AnyOutputPort _algoResultPort
bool _convergenceReachedWithOtherCalc
AnyInputPort _retPortForOutPool
static const int NOT_RUNNING_BRANCH_ID
InputPort * edGetPortForOutPool()
FakeNodeForOptimizerLoop * _nodeForSpecialCases
static const int NOT_INITIALIZED_BRANCH_ID
::YACS::BASES::DynLibLoader * _loader
std::vector< AnyInputPort * > _interceptorsForOutPool
std::vector< bool > _initNodeUpdated
InputPort * edGetAlgoInitPort()
Pool used to manage the samples of the optimizer loop plugin.
Base class for all schema objects.
Base class for all type objects.