Antares Simulator
Power System Simulator
adq-patch-params.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 #pragma once
22 
23 #include <string>
24 #include <vector>
25 
26 #include <yuni/core/string.h>
27 
28 #include <antares/inifile/inifile.h>
29 #include <antares/study/fwd.h>
30 #include "antares/exception/LoadingError.hpp"
31 
32 namespace Antares::Error
33 {
35 {
36 public:
38 };
39 
41 {
42 public:
44 };
45 
47 {
48 public:
50 };
51 
52 } // namespace Antares::Error
53 
54 namespace Antares::Data::AdequacyPatch
55 {
57 const double defaultThresholdToRunCurtailmentSharing = 0.0;
59 const double defaultThresholdDisplayLocalMatchingRuleViolations = 0.0;
61 const int defaultValueThresholdVarBoundsRelaxation = 3;
62 
66 enum AdequacyPatchMode
67 {
69  virtualArea = 0,
71  physicalAreaOutsideAdqPatch = 1,
73  physicalAreaInsideAdqPatch = 2
74 }; // enum AdequacyPatchMode
75 
79 enum class AdqPatchPTO
80 {
82  isDens = 0,
84  isLoad
85 
86 }; // enum AdqPatchPTO
87 
88 class CurtailmentSharing final
89 {
90 public:
92  AdqPatchPTO priceTakingOrder;
94  double thresholdRun;
103 
104  bool updateFromKeyValue(const Yuni::String& key, const Yuni::String& value);
105  void addProperties(IniFile::Section* section) const;
106 
107  void reset();
108 
109 private:
110  void resetThresholds();
111 };
112 
114 {
115  bool enabled;
120 
121  // TODO VP: remove this comment
122  // This parameters does nothing right now, it will be implemented later in 9.3.x
123  bool redispatch = false;
124 
125  CurtailmentSharing curtailmentSharing;
126 
127  void reset();
128  void addExcludedVariables(std::vector<std::string>&) const;
129  bool updateFromKeyValue(const Yuni::String& key, const Yuni::String& value);
130  void saveToINI(IniFile& ini) const;
131  bool checkAdqPatchParams(const SimulationMode simulationMode,
132  const AreaList& areas,
133  const bool includeHurdleCostParameters) const;
134 
135  void checkAdqPatchSimulationModeEconomyOnly(const SimulationMode simulationMode) const;
136  void checkAdqPatchContainsAdqPatchArea(const Antares::Data::AreaList& areas) const;
137  void checkAdqPatchIncludeHurdleCost(const bool includeHurdleCost) const;
138 };
139 
140 } // namespace Antares::Data::AdequacyPatch
Definition: adq-patch-params.h:89
AdqPatchPTO priceTakingOrder
PTO (Price Taking Order) for adequacy patch. User can choose between DENS and Load.
Definition: adq-patch-params.h:92
double thresholdDisplayViolations
Threshold to display Local Matching Rule violations.
Definition: adq-patch-params.h:96
int thresholdVarBoundsRelaxation
CSR Variables relaxation threshold.
Definition: adq-patch-params.h:98
bool includeHurdleCost
Include hurdle cost in CSR cost function.
Definition: adq-patch-params.h:100
bool checkCsrCostFunction
Check CSR cost function prior & after CSR optimization.
Definition: adq-patch-params.h:102
double thresholdRun
Threshold to initiate curtailment sharing rule.
Definition: adq-patch-params.h:94
A list of areas.
Definition: area.h:365
Definition: adq-patch-params.h:41
Definition: LoadingError.hpp:30
Definition: adq-patch-params.h:35
A single section, with all its keys.
Definition: inifile.h:67
Data for an INI file.
Definition: inifile.h:34
Definition: adq-patch-params.h:114
bool setToZeroOutsideInsideLinks
Definition: adq-patch-params.h:119