Antares Simulator
Power System Simulator
Loading...
Searching...
No Matches
EvaluationContext.h
1#pragma once
2
3#include <map>
4#include <stdexcept>
5#include <string>
6#include <vector>
7
12
13namespace Antares::Expressions::Visitors
14{
15enum class ParameterType : unsigned int
16{
17 CONSTANT = 0,
18 TIMESERIE = 1
19};
20
21// this struct contains more or less the same infos as the one in system.h
23{
24 std::string id;
25 ParameterType type;
26 std::string value;
27};
28
35{
36public:
44 explicit EvaluationContext(std::map<std::string, ParameterTypeAndValue> system_parameters,
45 std::map<std::string, double> variables,
47
55 double getVariableValue(const std::string& key) const;
56
64 double getSystemParameterValueAsDouble(const std::string& key) const;
65 std::string getSystemParameterValue(const std::string& key) const;
66
67 double getParameterValue(const std::string& key,
68 const std::string& scenarioGroup,
69 const unsigned scenario,
70 unsigned int hour) const;
71
72 ParameterType getParameterType(const std::string& key) const;
73 ParameterTypeAndValue getParameter(const std::string& key) const;
74
75 template<class T>
77 {
78 using T::T;
79 };
80
81private:
85 std::map<std::string, ParameterTypeAndValue> parameters_types_and_values_;
86
90 std::map<std::string, double> variables_;
92};
93
94} // namespace Antares::Expressions::Visitors
Represents the context for evaluating expressions.
Definition EvaluationContext.h:35
double getVariableValue(const std::string &key) const
Retrieves the value of a variable.
Definition EvaluationContext.cpp:15
EvaluationContext(std::map< std::string, ParameterTypeAndValue > system_parameters, std::map< std::string, double > variables, Optimisation::LinearProblemApi::ILinearProblemData &data)
Constructs an evaluation context with the specified parameter and variable values.
Definition EvaluationContext.cpp:6
double getSystemParameterValueAsDouble(const std::string &key) const
Retrieves the value of a parameter.
Definition EvaluationContext.cpp:38
Namespace for the classes related to the linear problem API.
Definition EvaluationContext.h:9