Antares Simulator
Power System Simulator
VariableNode.h
1 #pragma once
2 
3 #include <string>
4 
5 #include <antares/expressions/nodes/Leaf.h>
6 #include <antares/study/system-model/variabilityType.h>
7 
9 {
10 enum class VariabilityType : unsigned int;
11 }
12 
13 namespace Antares::Expressions::Nodes
14 {
15 
19 class VariableNode final: public Leaf<std::string>
20 {
21 public:
22  explicit VariableNode(const std::string& value,
23  unsigned int index,
24  Optimisation::VariabilityType variability = Optimisation::
25  VariabilityType::VARYING_IN_TIME_AND_SCENARIO):
26  Leaf<std::string>(value),
27  variability_(variability),
28  index_(index)
29 
30  {
31  }
32 
33  std::string name() const override
34  {
35  return "VariableNode";
36  }
37 
38  Optimisation::VariabilityType variability() const
39  {
40  return variability_;
41  }
42 
43  unsigned int Index() const
44  {
45  return index_;
46  }
47 
48 private:
49  // Is the variable time-dependent / scenario-dependent ?
50  const Optimisation::VariabilityType variability_;
51  // Local index within the component, starting from 0
52  const unsigned int index_ = 0;
53 };
54 } // namespace Antares::Expressions::Nodes
Represents a leaf node in a syntax tree.
Definition: Leaf.h:34
Represents a variable node in a syntax tree, storing a string value.
Definition: VariableNode.h:20
Definition: VariableNode.h:9
VariabilityType
Represents the time and scenario variation of a value.
Definition: variabilityType.h:29