Antares Simulator
Power System Simulator
Loading...
Searching...
No Matches
ComponentFiller.h
1/*
2 * Copyright 2007-2024, RTE (https://www.rte-france.com)
3 * See AUTHORS.txt
4 * SPDX-License-Identifier: MPL-2.0
5 * This file is part of Antares-Simulator,
6 * Adequacy and Performance assessment for interconnected energy networks.
7 *
8 * Antares_Simulator is free software: you can redistribute it and/or modify
9 * it under the terms of the Mozilla Public Licence 2.0 as published by
10 * the Mozilla Foundation, either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * Antares_Simulator is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * Mozilla Public Licence 2.0 for more details.
17 *
18 * You should have received a copy of the Mozilla Public Licence 2.0
19 * along with Antares_Simulator. If not, see <https://opensource.org/license/mpl-2-0/>.
20 */
21
22#pragma once
23
24#include <antares/optimisation/linear-problem-api/linearProblemFiller.h>
25#include <antares/study/system-model/component.h>
26#include "antares/expressions/visitors/EvaluationContext.h"
27#include "antares/solver/optim-model-filler/VariableDictionary.h"
28
29#include "ReadLinearConstraintVisitor.h"
30
31namespace Antares::Study::SystemModel
32{
33class Component;
34class Variable;
35} // namespace Antares::Study::SystemModel
36
37namespace Antares::Expressions::Visitors
38{
39class EvalVisitor;
40}
41
43{
50{
51public:
52 ComponentFiller() = delete;
53 ComponentFiller(ComponentFiller& other) = delete;
55 explicit ComponentFiller(const Study::SystemModel::Component& component);
56
60
61 void addStaticConstraint(Optimisation::LinearProblemApi::ILinearProblem& pb,
62 const LinearConstraint& linear_constraint,
63 const std::string& constraint_id) const;
64
65 void addTimeDependentConstraints(Optimisation::LinearProblemApi::ILinearProblem& pb,
66 const std::vector<LinearConstraint>& linear_constraints,
67 const std::string& constraint_id) const;
68
75
76 VariableDictionary variableDictionary;
77
78private:
79 static bool IsThisConstraintTimeDependent(const Expressions::Nodes::Node* node);
80
81 const Study::SystemModel::Component& component_;
82 const std::map<std::string, Study::SystemModel::Variable>& modelVariable_;
83};
84
86{
87public:
89 VariableDictionary& variableDictionary);
90 void addVariable(double lb,
91 double ub,
92 bool integer,
93 const Dimensions& dim,
94 const PartialKey&) const;
95 void addVariable(const std::vector<double>& lb,
96 double ub,
97 bool integer,
98 const Dimensions& dim,
99 const PartialKey&) const;
100 void addVariable(double lb,
101 const std::vector<double>& ub,
102 bool integer,
103 const Dimensions& dim,
104 const PartialKey&) const;
105 void addVariable(const std::vector<double>& lb,
106 const std::vector<double>& ub,
107 bool integer,
108 const Dimensions& dim,
109 const PartialKey&) const;
110
111 class BoundsSizeMismatch: public std::invalid_argument
112 {
113 using std::invalid_argument::invalid_argument;
114 };
115
116private:
118 VariableDictionary& variableDictionary;
119};
120} // namespace Antares::Optimization
Base class for nodes in a syntax tree.
Definition Node.h:30
Definition ComponentFiller.h:50
Definition VariableDictionary.h:74
Definition PartialKey.h:29
Definition VariableDictionary.h:97
Definition ComponentFiller.h:86
Definition variable.h:25
Definition constraint-slack-analysis.cpp:45
Definition ReadLinearConstraintVisitor.h:47