26 #include <antares/expressions/nodes/PortFieldNode.h>
27 #include "antares/study/system-model/connection.h"
30 #include "variabilityType.h"
32 namespace Antares::ModelerStudy::SystemModel
51 const Model* model =
nullptr;
52 std::map<std::string, ParameterTypeAndValue> parameter_values;
53 std::string scenario_group_id;
60 parameter_values.clear();
61 scenario_group_id.clear();
74 const std::string& Id()
const
79 const Model* getModel()
const
84 const std::map<std::string, ParameterTypeAndValue>& getParameterValues()
const
86 return data_.parameter_values;
89 std::string getParameterValue(
const std::string& parameter_id)
const
91 if (!data_.parameter_values.contains(parameter_id))
93 throw std::invalid_argument(
"Parameter '" + parameter_id +
"' not found in component '"
96 return data_.parameter_values.at(parameter_id).value;
99 std::string getScenarioGroupId()
const
101 return data_.scenario_group_id;
104 void addComponentConnection(
const std::string localPortId,
ConnectionEnd&& connection);
105 std::vector<ConnectionEnd> componentConnectionsViaPort(
const std::string& portId)
const;
108 const std::string& fieldId)
const;
110 const Expression& expressionAtPortField(
const std::string& portId,
111 const std::string& fieldId)
const;
113 void addAreaConnection(
const std::string& localPortId,
const std::string& areaId);
115 std::optional<std::string> areaConnectedToPort(
const std::string& portId)
const;
117 const std::map<std::string, std::string>& portToAreaConnections()
const;
119 unsigned int Index()
const
128 std::map<std::string, std::vector<ConnectionEnd>> componentConnectionEnds_;
129 std::map<std::string, std::string> portToAreaConnections_;
140 std::map<std::string, ParameterTypeAndValue> parameter_values);
Base class for nodes in a syntax tree.
Definition: Node.h:30
Definition: component.h:134
ComponentBuilder & withScenarioGroupId(const std::string &scenario_group_id)
Sets the ID of the scenario group to which the component belongs.
Definition: component.cpp:236
ComponentBuilder & withModel(const Model *model)
Sets the model of the component.
Definition: component.cpp:204
Component build()
Builds and returns the Component object.
Definition: component.cpp:247
ComponentBuilder & withId(std::string_view id)
Sets the ID of the component.
Definition: component.cpp:192
ComponentBuilder & withParameterValues(std::map< std::string, ParameterTypeAndValue > parameter_values)
Sets the parameter values of the component. The parameters included should be all of the model's para...
Definition: component.cpp:223
Definition: component.h:48
Definition: component.h:69
Definition: connection.h:48
Definition: expression.h:37
VariabilityType
Represents the time and scenario variation of a value.
Definition: variabilityType.h:29
Definition: component.h:37