Salome HOME
Optimized algo for PlayGround
[modules/yacs.git] / src / engine / DynParaLoop.hxx
index 2ce21b66c89571d717c151fbcb2082a12cbd5a26..93bffd55dac59e5fac63c406e4f27a7208d03162 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2006-2014  CEA/DEN, EDF R&D
+// Copyright (C) 2006-2016  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -56,6 +56,9 @@ namespace YACS
       std::vector<Node *> _execFinalizeNodes;
       int _initializingCounter;
       int _unfinishedCounter;
+      int _failedCounter;
+      ComplexWeight _weight;
+      double _loopWeight;
     protected:
       static const char NAME_OF_SPLITTED_SEQ_OUT[];
       static const char OLD_NAME_OF_SPLITTED_SEQ_OUT[];
@@ -78,6 +81,7 @@ namespace YACS
       int getNumberOfInputPorts() const;
       int getNumberOfOutputPorts() const;
       unsigned getNumberOfEltsConsumed() const { return _nbOfEltConsumed; }
+      int getBranchIDOfNode(Node *node) const;
       std::list<OutputPort *> getSetOfOutputPort() const;
       std::list<OutputPort *> getLocalOutputPorts() const;
       OutputPort *edGetSamplePort() { return &_splittedPort; }
@@ -95,6 +99,9 @@ namespace YACS
       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 { return _execNodes; } // need to use in GUI part for adding observers for clone nodes
+      ComplexWeight * getWeight();
+      void setWeight(double loopWeight);
+      void getWeightRegardingDPL(ComplexWeight *weight) {weight->addWeight(getWeight());}
       bool isMultiplicitySpecified(unsigned& value) const;
       void forceMultiplicity(unsigned value);
       virtual void checkBasicConsistency() const throw(Exception);
@@ -103,6 +110,8 @@ namespace YACS
       Node * getInitNode();
       Node * getExecNode();
       Node * getFinalizeNode();
+      int getMaxLevelOfParallelism() const;
+      void partitionRegardingDPL(const PartDefinition *pd, std::map<ComposedNode *, YACS::BASES::AutoRefCnt<PartDefinition> >& zeMap);
     protected:
       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);
@@ -112,6 +121,8 @@ namespace YACS
                                   std::vector<OutPort *>& fwCross,
                                   std::map< ComposedNode *, std::list < OutPort *>, SortHierarc >& bw,
                                   LinkInfo& info) const;
+      virtual void checkLinkPossibility(OutPort *start, const std::list<ComposedNode *>& pointsOfViewStart,
+                                       InPort *end, const std::list<ComposedNode *>& pointsOfViewEnd) throw(Exception);
     protected:
       void cleanDynGraph();
       void prepareInputsFromOutOfScope(int branchNb);
@@ -119,7 +130,7 @@ namespace YACS
       TypeOfNode getIdentityOfNotifyerNode(const Node *node, unsigned& id);
       InputPort *getDynInputPortByAbsName(int branchNb, const std::string& name, bool initNodeAdmitted);
       virtual void forwardExecStateToOriginalBody(Node *execNode);
-      virtual YACS::Event updateStateOnFailedEventFrom(Node *node);
+      virtual YACS::Event updateStateOnFailedEventFrom(Node *node, const Executor *execInst);
       std::vector<Node *> cloneAndPlaceNodesCoherently(const std::vector<Node *> & origNodes);
       Node * checkConsistencyAndSetNode(Node* &nodeToReplace, Node* DISOWNnode);
       Node * removeNode(Node* &nodeToRemove);