Antares Simulator
Power System Simulator
Loading...
Searching...
No Matches
Antares::Expressions::Visitors::EvaluationContext Class Reference

Represents the context for evaluating expressions. More...

#include <EvaluationContext.h>

Classes

struct  CouldNotEvaluateConstantParameter
 

Public Member Functions

 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.
 
double getVariableValue (const std::string &key) const
 Retrieves the value of a variable.
 
double getSystemParameterValueAsDouble (const std::string &key) const
 Retrieves the value of a parameter.
 
std::string getSystemParameterValue (const std::string &key) const
 
double getParameterValue (const std::string &key, const std::string &scenarioGroup, const unsigned scenario, unsigned int hour) const
 
ParameterType getParameterType (const std::string &key) const
 
ParameterTypeAndValue getParameter (const std::string &key) const
 

Detailed Description

Represents the context for evaluating expressions.

Stores and provides access to parameter and variable values.

Constructor & Destructor Documentation

◆ EvaluationContext()

Antares::Expressions::Visitors::EvaluationContext::EvaluationContext ( std::map< std::string, ParameterTypeAndValue > system_parameters,
std::map< std::string, double > variables,
Optimisation::LinearProblemApi::ILinearProblemData & data )
explicit

Constructs an evaluation context with the specified parameter and variable values.

Parameters
constant_parametersparameter values.
variablesvariable values.

Member Function Documentation

◆ getSystemParameterValueAsDouble()

double Antares::Expressions::Visitors::EvaluationContext::getSystemParameterValueAsDouble ( const std::string & key) const

Retrieves the value of a parameter.

Parameters
nameThe name of the parameter.
Returns
The value of the parameter.
Exceptions
std::out_of_rangeIf the parameter is not found.

◆ getVariableValue()

double Antares::Expressions::Visitors::EvaluationContext::getVariableValue ( const std::string & key) const

Retrieves the value of a variable.

Parameters
nameThe name of the variable.
Returns
The value of the variable.
Exceptions
std::out_of_rangeIf the variable is not found.

The documentation for this class was generated from the following files: