Antares Simulator
Power System Simulator
EvaluationContext.h
1 #pragma once
2 
3 #include <map>
4 #include <span>
5 #include <stdexcept>
6 #include <string>
7 
8 #include "antares/study/system-model/component.h"
9 
11 {
12 class IScenario;
13 class ILinearProblemData;
14 } // namespace Antares::Optimisation::LinearProblemApi
15 
16 namespace Antares::Optimisation
17 {
18 
25 {
26 public:
39 
47  [[nodiscard]] double getSystemParameterValueAsDouble(const std::string& key) const;
48 
49  [[nodiscard]] std::string getSystemParameterValue(const std::string& key) const;
50 
51  [[nodiscard]] double getParameterValue(const std::string& key,
52  unsigned int year,
53  unsigned int hour) const;
54  std::span<const double> getParameterValue(const std::string& key,
55  unsigned int year,
56  unsigned int firstHour,
57  unsigned int lastHour) const;
58 
59  [[nodiscard]] Optimisation::VariabilityType getParameterType(const std::string& key) const;
60 
61  [[nodiscard]] ModelerStudy::SystemModel::ParameterTypeAndValue getParameter(
62  const std::string& key) const;
63 
64  [[nodiscard]] const Optimisation::LinearProblemApi::ILinearProblemData& data() const;
65 
66  [[nodiscard]] const Optimisation::LinearProblemApi::IScenario& scenario() const;
67 
68  template<class T>
70  {
71  using T::T;
72  };
73 
74 private:
75  const ModelerStudy::SystemModel::Component* component_;
78 };
79 } // namespace Antares::Optimisation
Represents the context for evaluating expressions.
Definition: EvaluationContext.h:25
double getSystemParameterValueAsDouble(const std::string &key) const
Retrieves the value of a parameter.
Definition: EvaluationContext.cpp:57
EvaluationContext(const ModelerStudy::SystemModel::Component *component, const Optimisation::LinearProblemApi::ILinearProblemData *data, const Optimisation::LinearProblemApi::IScenario *scenario)
Constructs an evaluation context with the specified parameter and variable values.
Definition: EvaluationContext.cpp:30
Interface for linear problem data. Provides a method to retrieve data for a specific dataset,...
Definition: ILinearProblemData.h:114
Interface for scenarios in the linear problem API. A scenario is an association of years to their res...
Definition: IScenario.h:36
Namespace for the classes related to the linear problem API.
Definition: SimulationTableGenerator.h:41
Definition: VariableNode.h:9
VariabilityType
Represents the time and scenario variation of a value.
Definition: variabilityType.h:29