Antares Simulator
Power System Simulator
ComponentToAreaConnectionFiller.h
1 /*
2  * Copyright 2007-2025, 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/solver/optim-model-filler/TimeDependentLinearExpression.h"
26 #include "antares/solver/simulation/sim_structure_probleme_economique.h"
27 #include "antares/study/system-model/system.h"
28 
29 namespace Antares::Optimisation
30 {
31 namespace LinearProblemApi
32 {
33 class ILinearProblem;
34 class IMipConstraint;
35 } // namespace LinearProblemApi
36 class OptimEntityContainer;
37 } // namespace Antares::Optimisation
38 
39 namespace Antares::Optimization
40 {
41 
51 {
52 public:
54  const PROBLEME_HEBDO* problemeHebdo,
55  Optimisation::OptimEntityContainer& variableContainer,
57  const Optimisation::ScenarioGroupRepository& scenarioGroupRepository);
58  void addVariables(const Optimisation::LinearProblemApi::FillContext& ctx) override;
59  void addConstraints(const Optimisation::LinearProblemApi::FillContext& ctx) override;
60  void addObjectives(const Optimisation::LinearProblemApi::FillContext& ctx) override;
61 
62 private:
63  const PROBLEME_HEBDO* problemeHebdo_;
64  const ModelerStudy::SystemModel::System* modelerSystem_;
65  Optimisation::OptimEntityContainer& optimEntityContainer_;
66 
67  std::map<std::string, unsigned> areaIndices_;
68 
71  const std::string& areaId,
72  unsigned ts) const;
73  void addExpressionToConstraint(
77  const std::string& areaId) const;
78  void addComponentPortContributionToArea(Optimisation::LinearProblemApi::ILinearProblem& pb,
80  const ModelerStudy::SystemModel::Component& component,
81  const std::string& portId,
82  const std::string& areaId);
83 };
84 
85 } // namespace Antares::Optimization
Context for filling linear problem data. Contains temporal information.
Definition: ILinearProblemData.h:35
Interface for linear problem data. Provides a method to retrieve data for a specific dataset,...
Definition: ILinearProblemData.h:114
Definition: OptimEntityContainer.h:46
Definition: scenarioGroupRepo.h:12
Fills the linear problem with constraints and variables related to component-to-area connections.
Definition: ComponentToAreaConnectionFiller.h:51
Definition: TimeDependentLinearExpression.h:31
Definition: VariableNode.h:9
Definition: sim_structure_probleme_economique.h:403