Skip to content

Commit

Permalink
Add a column for each group fo each reserve for the participation to …
Browse files Browse the repository at this point in the history
…the reserves:

Specs : On ajoutera la participation à chaque réserves via la définition de nouvelles colonnes pour chaque type de production (nucléaire, charbon…) ("<Reserve-name>_<group-name>").
  • Loading branch information
h-fournier committed Jun 24, 2024
1 parent 1fbd4cf commit 60eff8e
Show file tree
Hide file tree
Showing 9 changed files with 539 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <antares/writer/i_writer.h>
#include <antares/study/area/capacityReservation.h>
#include <antares/study/parts/common/cluster.h>
#include <antares/study/parts/thermal/cluster.h>

#include <algorithm>
#include <vector>
Expand Down Expand Up @@ -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<Data::ClusterName, Data::ReserveName> reserveParticipationAt(
std::pair<Data::ClusterName, Data::ReserveName> 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<Data::ThermalDispatchableGroup, Data::ReserveName> reserveParticipationGroupAt(
const Area* area,
unsigned int index) const;

Expand Down
36 changes: 31 additions & 5 deletions src/libs/antares/study/parts/common/cluster_list.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,8 @@ std::shared_ptr<ClusterT> ClusterList<ClusterT>::enabledClusterAt(unsigned int i
}

template<class ClusterT>
std::pair<Data::ClusterName, Data::ReserveName> ClusterList<ClusterT>::reserveParticipationAt(
const Area* area,
unsigned int index) const
std::pair<Data::ClusterName, Data::ReserveName>
ClusterList<ClusterT>::reserveParticipationClusterAt(const Area* area, unsigned int index) const
{
int globalReserveParticipationIdx = 0;

Expand Down Expand Up @@ -93,8 +92,35 @@ std::pair<Data::ClusterName, Data::ReserveName> ClusterList<ClusterT>::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<class ClusterT>
std::pair<Data::ThermalDispatchableGroup, Data::ReserveName>
ClusterList<ClusterT>::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<Data::ThermalDispatchableGroup>(indexGroup), reserveName};
column++;
}
}
for (auto [reserveName, _] : area->allCapacityReservations.areaCapacityReservationsDown)
{
for (int indexGroup = 0; indexGroup < Data::groupMax; indexGroup++)
{
if (column == index)
return {static_cast<Data::ThermalDispatchableGroup>(indexGroup), reserveName};
column++;
}
}
throw std::out_of_range("This group reserve participation index has not been found in all the "
"reserve participations");
}

template<class ClusterT>
Expand Down
1 change: 1 addition & 0 deletions src/solver/variable/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
#include "nbOfDispatchedUnitsByPlant.h"
#include "profitByPlant.h"
#include "reserveParticipationByDispatchablePlant.h"
#include "reserveParticipationByGroup.h"

// By RES plant
#include "productionByRenewablePlant.h"
Expand Down Expand Up @@ -172,9 +173,10 @@ typedef // Prices
<ProfitByPlant
<ReserveParticipationCost // Participation cost to the reserves
<ReserveParticipationByDispatchablePlant // Participation per cluster
// Links
<Variable::Economy::Links // All links
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
<ReserveParticipationByGroup // Participation per thermal group
// Links
<Variable::Economy::Links // All links
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
VariablesPerArea;

/*!
Expand Down
Loading

0 comments on commit 60eff8e

Please sign in to comment.