]> SALOME platform Git repositories - modules/yacs.git/blobdiff - src/engine/ElementaryNode.cxx
Salome HOME
Optimized algo for PlayGround
[modules/yacs.git] / src / engine / ElementaryNode.cxx
index 129deaa1d701bbbc0466d8e007ea257854cb7697..dff7963cca3a7bb5817652d10cb22db12938ab42 100644 (file)
@@ -47,11 +47,13 @@ using namespace std;
 ElementaryNode::ElementaryNode(const std::string& name):
   Node(name),
   _createDatastreamPorts(false),
-  _multi_port_node(false)
+  _multi_port_node(false),
+  _weight()
 {
+  _weight.setDefaultElementary();
 }
 
-ElementaryNode::ElementaryNode(const ElementaryNode& other, ComposedNode *father):Node(other,father)
+ElementaryNode::ElementaryNode(const ElementaryNode& other, ComposedNode *father):Node(other,father), _weight(other._weight)
 {
   _createDatastreamPorts = other._createDatastreamPorts;
   _multi_port_node = other._multi_port_node;
@@ -892,3 +894,10 @@ void ElementaryNode::getCoupledNodes(std::set<Task*>& coupledSet)
     }
 }
 
+void ElementaryNode::setWeight(double elementaryWeight)
+{
+  if(elementaryWeight<=0.)
+    throw Exception("ElementaryNode::setWeight : invalid input value !");
+  _weight.setElementaryWeight(elementaryWeight);
+}
+