From 60eff8edf35f7d8a939d45929b9e4793ff510a6e Mon Sep 17 00:00:00 2001 From: h-fournier Date: Mon, 24 Jun 2024 09:35:33 +0200 Subject: [PATCH] =?UTF-8?q?Add=20a=20column=20for=20each=20group=20fo=20ea?= =?UTF-8?q?ch=20reserve=20for=20the=20participation=20to=20the=20reserves:?= =?UTF-8?q?=20Specs=20:=20On=20ajoutera=20la=20participation=20=C3=A0=20ch?= =?UTF-8?q?aque=20r=C3=A9serves=20via=20la=20d=C3=A9finition=20de=20nouvel?= =?UTF-8?q?les=20colonnes=20pour=20chaque=20type=20de=20production=20(nucl?= =?UTF-8?q?=C3=A9aire,=20charbon=E2=80=A6)=20("=5F").?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../antares/study/parts/common/cluster_list.h | 15 +- .../study/parts/common/cluster_list.cpp | 36 +- src/solver/variable/CMakeLists.txt | 1 + .../antares/solver/variable/economy/all.h | 8 +- .../economy/reserveParticipationByGroup.h | 328 ++++++++++++++++++ .../vCardReserveParticipationByGroup.h | 133 +++++++ .../include/antares/solver/variable/info.h | 27 +- .../include/antares/solver/variable/state.h | 6 +- src/solver/variable/state.cpp | 13 +- 9 files changed, 539 insertions(+), 28 deletions(-) create mode 100644 src/solver/variable/include/antares/solver/variable/economy/reserveParticipationByGroup.h create mode 100644 src/solver/variable/include/antares/solver/variable/economy/vCardReserveParticipationByGroup.h diff --git a/src/libs/antares/study/include/antares/study/parts/common/cluster_list.h b/src/libs/antares/study/include/antares/study/parts/common/cluster_list.h index 978ee182db..780faf2997 100644 --- a/src/libs/antares/study/include/antares/study/parts/common/cluster_list.h +++ b/src/libs/antares/study/include/antares/study/parts/common/cluster_list.h @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -99,11 +100,21 @@ class ClusterList /*! ** @brief Get the cluster and reserve names for a given index of reserveParticipation - ** @param area The area where to took for the reserveParticipation + ** @param area The area where to look for the reserveParticipation ** @param index Global index of the reserveParicipation ** @return the cluster and reserve names */ - std::pair reserveParticipationAt( + std::pair reserveParticipationClusterAt( + const Area* area, + unsigned int index) const; + + /*! + ** @brief Get the group and reserve names for a given index of reserveParticipation + ** @param area The area where to look for the reserveParticipation + ** @param index Global index of the reserveParicipation + ** @return the group and reserve names + */ + std::pair reserveParticipationGroupAt( const Area* area, unsigned int index) const; diff --git a/src/libs/antares/study/parts/common/cluster_list.cpp b/src/libs/antares/study/parts/common/cluster_list.cpp index 212e195aa5..dfc11f688e 100644 --- a/src/libs/antares/study/parts/common/cluster_list.cpp +++ b/src/libs/antares/study/parts/common/cluster_list.cpp @@ -56,9 +56,8 @@ std::shared_ptr ClusterList::enabledClusterAt(unsigned int i } template -std::pair ClusterList::reserveParticipationAt( - const Area* area, - unsigned int index) const +std::pair + ClusterList::reserveParticipationClusterAt(const Area* area, unsigned int index) const { int globalReserveParticipationIdx = 0; @@ -93,8 +92,35 @@ std::pair ClusterList::reservePa } } - throw std::out_of_range( - "This reserve participation index has not been found in all the reserve participations"); + throw std::out_of_range("This cluster reserve participation index has not been found in all " + "the reserve participations"); +} + +template +std::pair + ClusterList::reserveParticipationGroupAt(const Area* area, unsigned int index) const +{ + int column = 0; + for (auto [reserveName, _] : area->allCapacityReservations.areaCapacityReservationsUp) + { + for (int indexGroup = 0; indexGroup < Data::groupMax; indexGroup++) + { + if (column == index) + return {static_cast(indexGroup), reserveName}; + column++; + } + } + for (auto [reserveName, _] : area->allCapacityReservations.areaCapacityReservationsDown) + { + for (int indexGroup = 0; indexGroup < Data::groupMax; indexGroup++) + { + if (column == index) + return {static_cast(indexGroup), reserveName}; + column++; + } + } + throw std::out_of_range("This group reserve participation index has not been found in all the " + "reserve participations"); } template diff --git a/src/solver/variable/CMakeLists.txt b/src/solver/variable/CMakeLists.txt index ec62c3d176..292ce8ed35 100644 --- a/src/solver/variable/CMakeLists.txt +++ b/src/solver/variable/CMakeLists.txt @@ -130,6 +130,7 @@ set(SRC_VARIABLE_ECONOMY include/antares/solver/variable/economy/reserveParticipationCost.h include/antares/solver/variable/economy/reserveParticipationByDispatchablePlant.h include/antares/solver/variable/economy/vCardReserveParticipationByDispatchablePlant.h + include/antares/solver/variable/economy/reserveParticipationByGroup.h # Links include/antares/solver/variable/economy/links/flowLinear.h diff --git a/src/solver/variable/include/antares/solver/variable/economy/all.h b/src/solver/variable/include/antares/solver/variable/economy/all.h index a2e14e0c0b..150f0afb5e 100644 --- a/src/solver/variable/include/antares/solver/variable/economy/all.h +++ b/src/solver/variable/include/antares/solver/variable/economy/all.h @@ -75,6 +75,7 @@ #include "nbOfDispatchedUnitsByPlant.h" #include "profitByPlant.h" #include "reserveParticipationByDispatchablePlant.h" +#include "reserveParticipationByGroup.h" // By RES plant #include "productionByRenewablePlant.h" @@ -172,9 +173,10 @@ typedef // Prices >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> + >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> VariablesPerArea; /*! diff --git a/src/solver/variable/include/antares/solver/variable/economy/reserveParticipationByGroup.h b/src/solver/variable/include/antares/solver/variable/economy/reserveParticipationByGroup.h new file mode 100644 index 0000000000..e03a2bd5cb --- /dev/null +++ b/src/solver/variable/include/antares/solver/variable/economy/reserveParticipationByGroup.h @@ -0,0 +1,328 @@ +/* +** Copyright 2007-2023 RTE +** Authors: Antares_Simulator Team +** +** This file is part of Antares_Simulator. +** +** Antares_Simulator is free software: you can redistribute it and/or modify +** it under the terms of the GNU General Public License as published by +** the Free Software Foundation, either version 3 of the License, or +** (at your option) any later version. +** +** There are special exceptions to the terms and conditions of the +** license as they are applied to this software. View the full text of +** the exceptions in file COPYING.txt in the directory of this software +** distribution +** +** Antares_Simulator is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with Antares_Simulator. If not, see . +** +** SPDX-License-Identifier: licenceRef-GPL3_WITH_RTE-Exceptions +*/ +#ifndef __SOLVER_VARIABLE_ECONOMY_ReserveParticipationByGroup_H__ +#define __SOLVER_VARIABLE_ECONOMY_ReserveParticipationByGroup_H__ + +#include "../variable.h" +#include "./vCardReserveParticipationByGroup.h" + +namespace Antares +{ +namespace Solver +{ +namespace Variable +{ +namespace Economy +{ + +/*! +** \brief Reserve participation for all groups for all reserves of the area +*/ +template +class ReserveParticipationByGroup : public Variable::IVariable, + NextT, + VCardReserveParticipationByGroup> +{ +public: + //! Type of the next static variable + typedef NextT NextType; + //! VCard + typedef VCardReserveParticipationByGroup VCardType; + //! Ancestor + typedef Variable::IVariable, NextT, VCardType> AncestorType; + + //! List of expected results + typedef typename VCardType::ResultsType ResultsType; + + typedef VariableAccessor VariableAccessorType; + + enum + { + //! How many items have we got + count = 1 + NextT::count, + }; + + template + struct Statistics + { + enum + { + count + = ((VCardType::categoryDataLevel & CDataLevel && VCardType::categoryFileLevel & CFile) + ? (NextType::template Statistics::count + + VCardType::columnCount * ResultsType::count) + : NextType::template Statistics::count), + }; + }; + +public: + ReserveParticipationByGroup() : pValuesForTheCurrentYear(NULL), pSize(0) + { + } + + ~ReserveParticipationByGroup() + { + for (unsigned int numSpace = 0; numSpace < pNbYearsParallel; numSpace++) + delete[] pValuesForTheCurrentYear[numSpace]; + delete[] pValuesForTheCurrentYear; + } + + void initializeFromStudy(Data::Study& study) + { + // Next + NextType::initializeFromStudy(study); + } + + void initializeFromArea(Data::Study* study, Data::Area* area) + { + // Get the number of years in parallel + pNbYearsParallel = study->maxNbYearsInParallel; + pValuesForTheCurrentYear = new VCardType::IntermediateValuesBaseType[pNbYearsParallel]; + + // Get the area + pSize = 0; + for (auto res : area->allCapacityReservations.areaCapacityReservationsUp) + { + pSize += Antares::Data::groupMax; + } + for (auto res : area->allCapacityReservations.areaCapacityReservationsDown) + { + pSize += Antares::Data::groupMax; + } + if (pSize) + { + AncestorType::pResults.resize(pSize); + + for (unsigned int numSpace = 0; numSpace < pNbYearsParallel; numSpace++) + pValuesForTheCurrentYear[numSpace] + = new VCardType::IntermediateValuesDeepType[pSize]; + + // Minimum power values of the cluster for the whole year - from the solver in the + // accurate mode not to be displayed in the output \todo think of a better place like + // the DispatchableMarginForAllAreas done at the beginning of the year + + for (unsigned int numSpace = 0; numSpace < pNbYearsParallel; numSpace++) + for (unsigned int i = 0; i != pSize; ++i) + pValuesForTheCurrentYear[numSpace][i].initializeFromStudy(*study); + + for (unsigned int i = 0; i != pSize; ++i) + { + AncestorType::pResults[i].initializeFromStudy(*study); + AncestorType::pResults[i].reset(); + } + } + else + { + for (unsigned int numSpace = 0; numSpace < pNbYearsParallel; numSpace++) + { + pValuesForTheCurrentYear[numSpace] = nullptr; + } + AncestorType::pResults.clear(); + } + // Next + NextType::initializeFromArea(study, area); + } + + size_t getMaxNumberColumns() const + { + return pSize * ResultsType::count; + } + + void initializeFromLink(Data::Study* study, Data::AreaLink* link) + { + // Next + NextType::initializeFromAreaLink(study, link); + } + + void simulationBegin() + { + // Next + NextType::simulationBegin(); + } + + void simulationEnd() + { + NextType::simulationEnd(); + } + + void yearBegin(unsigned int year, unsigned int numSpace) + { + // Reset the values for the current year + for (unsigned int i = 0; i != pSize; ++i) + pValuesForTheCurrentYear[numSpace][i].reset(); + + // Next variable + NextType::yearBegin(year, numSpace); + } + + void yearEndBuildForEachThermalCluster(State& state, uint year, unsigned int numSpace) + { + // Next variable + NextType::yearEndBuildForEachThermalCluster(state, year, numSpace); + } + + void yearEndBuild(State& state, unsigned int year) + { + // Next variable + NextType::yearEndBuild(state, year); + } + + void yearEnd(unsigned int year, unsigned int numSpace) + { + // Merge all results for all thermal clusters + { + for (unsigned int i = 0; i < pSize; ++i) + { + // Compute all statistics for the current year (daily,weekly,monthly) + pValuesForTheCurrentYear[numSpace][i].computeStatisticsForTheCurrentYear(); + } + } + // Next variable + NextType::yearEnd(year, numSpace); + } + + void computeSummary(std::map& numSpaceToYear, + unsigned int nbYearsForCurrentSummary) + { + for (unsigned int numSpace = 0; numSpace < nbYearsForCurrentSummary; ++numSpace) + { + for (unsigned int i = 0; i < pSize; ++i) + { + // Merge all those values with the global results + AncestorType::pResults[i].merge(numSpaceToYear[numSpace], + pValuesForTheCurrentYear[numSpace][i]); + } + } + + // Next variable + NextType::computeSummary(numSpaceToYear, nbYearsForCurrentSummary); + } + + void hourBegin(unsigned int hourInTheYear) + { + // Next variable + NextType::hourBegin(hourInTheYear); + } + + void hourForEachArea(State& state, unsigned int numSpace) + { + auto& area = state.area; + auto& thermal = state.thermal; + int column = 0; + for (auto [reserveName, _] : area->allCapacityReservations.areaCapacityReservationsUp) + { + for (int indexGroup = 0; indexGroup < Antares::Data::groupMax; indexGroup++) + { + pValuesForTheCurrentYear[numSpace][column].hour[state.hourInTheYear] + += state.thermalReserveParticipationPerGroupForYear + [state.hourInTheYear][static_cast(indexGroup)] + [reserveName]; + column++; + } + } + for (auto [reserveName, _] : area->allCapacityReservations.areaCapacityReservationsDown) + { + for (int indexGroup = 0; indexGroup < Antares::Data::groupMax; indexGroup++) + { + pValuesForTheCurrentYear[numSpace][column].hour[state.hourInTheYear] + += state.thermalReserveParticipationPerGroupForYear + [state.hourInTheYear][static_cast(indexGroup)] + [reserveName]; + column++; + } + } + // Next variable + NextType::hourForEachArea(state, numSpace); + } + + Antares::Memory::Stored::ConstReturnType retrieveRawHourlyValuesForCurrentYear( + unsigned int, + unsigned int numSpace) const + { + return pValuesForTheCurrentYear[numSpace]->hour; + } + + void localBuildAnnualSurveyReport(SurveyResults& results, + int fileLevel, + int precision, + unsigned int numSpace) const + { + // Initializing external pointer on current variable non applicable status + results.isCurrentVarNA = AncestorType::isNonApplicable; + + if (AncestorType::isPrinted[0]) + { + assert(NULL != results.data.area); + const auto& thermal = results.data.area->thermal; + + // Write the data for the current year + int column = 0; + for (auto res : results.data.area->allCapacityReservations.areaCapacityReservationsUp) + { + for (int indexGroup = 0; indexGroup < Antares::Data::groupMax; indexGroup++) + { + // Write the data for the current year + Yuni::String caption = res.first; + caption << "_" << Data::ThermalCluster::GroupName(static_cast(indexGroup)); + results.variableCaption = caption; // VCardType::Caption(); + results.variableUnit = VCardType::Unit(); + pValuesForTheCurrentYear[numSpace][column].template buildAnnualSurveyReport( + results, fileLevel, precision); + column++; + } + } + for (auto res : results.data.area->allCapacityReservations.areaCapacityReservationsDown) + { + for (int indexGroup = 0; indexGroup < Antares::Data::groupMax; indexGroup++) + { + // Write the data for the current year + Yuni::String caption = res.first; + caption << "_" << Data::ThermalCluster::GroupName(static_cast(indexGroup)); + results.variableCaption = caption; // VCardType::Caption(); + results.variableUnit = VCardType::Unit(); + pValuesForTheCurrentYear[numSpace][column].template buildAnnualSurveyReport( + results, fileLevel, precision); + column++; + } + } + } + } + +private: + //! Intermediate values for each year + typename VCardType::IntermediateValuesType pValuesForTheCurrentYear; + size_t pSize; + unsigned int pNbYearsParallel; + +}; // class ReserveParticipationByGroup + +} // namespace Economy +} // namespace Variable +} // namespace Solver +} // namespace Antares + +#endif // __SOLVER_VARIABLE_ECONOMY_ReserveParticipationByGroup_H__ \ No newline at end of file diff --git a/src/solver/variable/include/antares/solver/variable/economy/vCardReserveParticipationByGroup.h b/src/solver/variable/include/antares/solver/variable/economy/vCardReserveParticipationByGroup.h new file mode 100644 index 0000000000..6ea3ed84cd --- /dev/null +++ b/src/solver/variable/include/antares/solver/variable/economy/vCardReserveParticipationByGroup.h @@ -0,0 +1,133 @@ +/* +** Copyright 2007-2023 RTE +** Authors: Antares_Simulator Team +** +** This file is part of Antares_Simulator. +** +** Antares_Simulator is free software: you can redistribute it and/or modify +** it under the terms of the GNU General Public License as published by +** the Free Software Foundation, either version 3 of the License, or +** (at your option) any later version. +** +** There are special exceptions to the terms and conditions of the +** license as they are applied to this software. View the full text of +** the exceptions in file COPYING.txt in the directory of this software +** distribution +** +** Antares_Simulator is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with Antares_Simulator. If not, see . +** +** SPDX-License-Identifier: licenceRef-GPL3_WITH_RTE-Exceptions +*/ +#ifndef __SOLVER_VARIABLE_ECONOMY_VCardReserveParticipationByGroup_H__ +#define __SOLVER_VARIABLE_ECONOMY_VCardReserveParticipationByGroup_H__ + +#include "../storage/results.h" + +namespace Antares +{ +namespace Solver +{ +namespace Variable +{ +namespace Economy +{ +struct VCardReserveParticipationByGroup +{ + //! Caption + static std::string Caption() + { + return "GROUP PARTICIPATION TO RESERVE"; + } + //! Unit + static std::string Unit() + { + return "MWh"; + } + + //! The short description of the variable + static std::string Description() + { + return "Reserve Participation from a group to a reserve"; + } + + //! The expected results + typedef Results> + ResultsType; + + //! The VCard to look for for calculating spatial aggregates + typedef VCardReserveParticipationByGroup VCardForSpatialAggregate; + + enum + { + //! Data Level + categoryDataLevel = Category::area, + //! File level (provided by the type of the results) + categoryFileLevel = ResultsType::categoryFile & (Category::id | Category::va), + //! Precision (views) + precision = Category::all, + //! Indentation (GUI) + nodeDepthForGUI = +0, + //! Decimal precision + decimal = 0, + //! Number of columns used by the variable + columnCount = Category::dynamicColumns, + //! The Spatial aggregation + spatialAggregate = Category::spatialAggregateSum, + spatialAggregateMode = Category::spatialAggregateEachYear, + spatialAggregatePostProcessing = 0, + //! Intermediate values + hasIntermediateValues = 1, + //! Can this variable be non applicable (0 : no, 1 : yes) + isPossiblyNonApplicable = 0, + }; + + typedef IntermediateValues IntermediateValuesDeepType; + typedef IntermediateValues* IntermediateValuesBaseType; + typedef IntermediateValuesBaseType* IntermediateValuesType; + + // typedef IntermediateValues IntermediateValuesType; + +}; // class VCard + +static std::string thermalDispatchableGroupToString(Data::ThermalDispatchableGroup idx) +{ + switch (idx) + { + case 0: + return "NUCLEAR"; + case 1: + return "LIGNITE"; + case 2: + return "COAL"; + case 3: + return "GAS"; + case 4: + return "OIL"; + case 5: + return "MIX. FUEL"; + case 6: + return "MISC. DTG"; + case 7: + return "MISC. DTG 2"; + case 8: + return "MISC. DTG 3"; + case 9: + return "MISC. DTG 4"; + + default: + return ""; + } +} +} // namespace Economy +} // namespace Variable +} // namespace Solver +} // namespace Antares + +#endif //__SOLVER_VARIABLE_ECONOMY_VCardReserveParticipationByDispatchablePlant_H__ \ No newline at end of file diff --git a/src/solver/variable/include/antares/solver/variable/info.h b/src/solver/variable/include/antares/solver/variable/info.h index 7d3642c26b..2b3874aa14 100644 --- a/src/solver/variable/include/antares/solver/variable/info.h +++ b/src/solver/variable/include/antares/solver/variable/info.h @@ -23,6 +23,7 @@ #include #include "./economy/vCardReserveParticipationByDispatchablePlant.h" +#include "./economy/vCardReserveParticipationByGroup.h" namespace Antares { @@ -372,8 +373,13 @@ struct VariableAccessor if (typeid(VCardT) == typeid(Economy::VCardReserveParticipationByDispatchablePlant)) { auto [clusterName, reserveName] - = thermal.list.reserveParticipationAt(results.data.area, i); + = thermal.list.reserveParticipationClusterAt(results.data.area, i); results.variableCaption = reserveName + "_" + clusterName; + } else if (typeid(VCardT) == typeid(Economy::VCardReserveParticipationByGroup)) + { + auto [groupName, reserveName] + = thermal.list.reserveParticipationGroupAt(results.data.area, i); + results.variableCaption = reserveName + "_" + Economy::thermalDispatchableGroupToString(groupName); } else results.variableCaption = thermal.list.enabledClusterAt(i)->name(); @@ -389,7 +395,7 @@ struct VariableAccessor auto& thermal = results.data.area->thermal; auto [clusterName, reserveName] - = thermal.list.reserveParticipationAt(results.data.area, reserveParticipationIdx); + = thermal.list.reserveParticipationClusterAt(results.data.area, reserveParticipationIdx); results.variableCaption = clusterName + " - " + reserveName; return true; } @@ -444,11 +450,22 @@ struct VariableAccessor bool res; if (*results.isPrinted) { + const Data::PartThermal& thermal = results.data.area->thermal; for (uint i = 0; i != container.size(); ++i) { - if (typeid(VCardType) - == typeid(Economy::VCardReserveParticipationByDispatchablePlant)) - res = setClusterReserveCaption(results, i); + if (typeid(VCardType) == typeid(Economy::VCardReserveParticipationByDispatchablePlant)) + { + auto [clusterName, reserveName] + = thermal.list.reserveParticipationClusterAt(results.data.area, i); + results.variableCaption = reserveName + "_" + clusterName; + res = true; + } else if (typeid(VCardType) == typeid(Economy::VCardReserveParticipationByGroup)) + { + auto [groupName, reserveName] + = thermal.list.reserveParticipationGroupAt(results.data.area, i); + results.variableCaption = reserveName + "_" + Economy::thermalDispatchableGroupToString(groupName); + res = true; + } else res = setClusterCaption(results, fileLevel, i); if (!res) diff --git a/src/solver/variable/include/antares/solver/variable/state.h b/src/solver/variable/include/antares/solver/variable/state.h index a9d349bab5..0735d28e23 100644 --- a/src/solver/variable/include/antares/solver/variable/state.h +++ b/src/solver/variable/include/antares/solver/variable/state.h @@ -59,10 +59,6 @@ class ThermalState std::vector unitCountLastHour; std::vector productionLastHour; std::vector pminOfAGroup; - - //! Track the number of thermalGroup different types participating to the reserves - std::vector nbThermalGroupsForReserves; - }; StateForAnArea& operator[](size_t areaIndex); @@ -190,7 +186,7 @@ class State double thermalClusterProductionForYear[Variable::maxHoursInAYear]; //! Reserve Participation for all thermal group types (nuclear / coal / ...) for the whole year //! per reserve - std::map> + std::map> thermalReserveParticipationPerGroupForYear[Variable::maxHoursInAYear]; //! Reserve Participation for all clusters per reserve diff --git a/src/solver/variable/state.cpp b/src/solver/variable/state.cpp index 39a4f76f20..ceac1f6ddf 100644 --- a/src/solver/variable/state.cpp +++ b/src/solver/variable/state.cpp @@ -58,7 +58,6 @@ void ThermalState::StateForAnArea::initializeFromArea(const Data::Area& area) unitCountLastHour.resize(count, 0); productionLastHour.resize(count, 0); pminOfAGroup.resize(count, 0); - nbThermalGroupsForReserves.resize(Antares::Data::groupMax, 0); } State::State(Data::Study& s) : @@ -252,14 +251,12 @@ void State::initFromThermalClusterIndexProduction(const uint clusterAreaWideInde thermalClusterReserveParticipationCostForYear[hourInTheYear] += participation * thermalCluster->reserveCost(res); - thermalReserveParticipationPerGroupForYear[hourInTheYear][res][thermalCluster->groupID] + thermalReserveParticipationPerGroupForYear[hourInTheYear][thermalCluster->groupID][res] += participation; - thermalReserveParticipationPerClusterForYear[hourInTheYear][thermalCluster->name()][res] - += participation; - - thermal[area->index].nbThermalGroupsForReserves[thermalCluster->groupID]++; - + thermalReserveParticipationPerClusterForYear[hourInTheYear] + [thermalCluster->name()][res] + += participation; } } else @@ -440,7 +437,7 @@ void State::yearEndBuildCalculateReserveParticipationCosts( for (auto res : clusterReserves) { - file << "Hour " << h + 1 << " : cluster " << thermalCluster->name() << " is participating to reserve " << res << " for " << thermalReserveParticipationPerGroupForYear[h][res][thermalCluster->groupID] << " mw\n"; + file << "Hour " << h + 1 << " : cluster " << thermalCluster->name() << " is participating to reserve " << res << " for " << thermalReserveParticipationPerGroupForYear[h][thermalCluster->groupID][res] << " mw\n"; } } file.close();