Antares Simulator
Power System Simulator
Loading...
Searching...
No Matches
Library.h
1
2/*
3 * Copyright 2007-2024, RTE (https://www.rte-france.com)
4 * See AUTHORS.txt
5 * SPDX-License-Identifier: MPL-2.0
6 * This file is part of Antares-Simulator,
7 * Adequacy and Performance assessment for interconnected energy networks.
8 *
9 * Antares_Simulator is free software: you can redistribute it and/or modify
10 * it under the terms of the Mozilla Public Licence 2.0 as published by
11 * the Mozilla Foundation, either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * Antares_Simulator is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * Mozilla Public Licence 2.0 for more details.
18 *
19 * You should have received a copy of the Mozilla Public Licence 2.0
20 * along with Antares_Simulator. If not, see <https://opensource.org/license/mpl-2-0/>.
21 */
22
23#pragma once
24#include <iostream>
25#include <string>
26#include <vector>
27
28namespace Antares::IO::Inputs::YmlModel
29{
30// Define structures
32{
33 std::string id;
34 bool time_dependent;
35 bool scenario_dependent;
36};
37
38enum class ValueType
39{
40 CONTINUOUS,
41 INTEGER,
42 BOOL
43};
44
45inline std::string toString(const ValueType& value_type)
46{
47 using namespace std::string_literals;
48 switch (value_type)
49 {
50 case ValueType::CONTINUOUS:
51 return "CONTINUOUS"s;
52 case ValueType::INTEGER:
53 return "INTEGER"s;
54 case ValueType::BOOL:
55 return "BOOL"s;
56 default:
57 return "UNKNOWN"s;
58 }
59}
60
62{
63 std::string id;
64 std::string lower_bound;
65 std::string upper_bound;
66 ValueType variable_type;
67 bool time_dependent;
68 bool scenario_dependent;
69};
70
71struct Port
72{
73 std::string id;
74 std::string type;
75};
76
78{
79 std::string port;
80 std::string field;
81 std::string definition;
82};
83
85{
86 std::string id;
87 std::string expression;
88};
89
90struct Model
91{
92 std::string id;
93 std::string description;
94 std::vector<Parameter> parameters;
95 std::vector<Variable> variables;
96 std::vector<Port> ports;
97 std::vector<PortFieldDefinition> port_field_definitions;
98 std::vector<Constraint> constraints;
99 std::vector<Constraint> binding_constraints;
100 std::string objective;
101};
102
104{
105 std::string id;
106 std::string description;
107 // Small optimization: we only need the name of the fields
108 // No need for an intermediate struct "field" with just a string "name" member
109 std::vector<std::string> fields;
110};
111
113{
114 std::string id;
115 std::string description;
116 std::vector<PortType> port_types;
117 std::vector<Model> models;
118};
119} // namespace Antares::IO::Inputs::YmlModel