From 6b0ec1ab11d428adb07f3ff4b2993b159eae5977 Mon Sep 17 00:00:00 2001 From: Florian OMNES <26088210+flomnes@users.noreply.github.com> Date: Tue, 21 Nov 2023 16:37:42 +0100 Subject: [PATCH] Fix output variable PROFIT for thermal clusters (#1767) * [DEV] Set thetaInf value to match constraint value * [DEV] Revert thetainf changes * [DEV] Add pmin to thermal cluster * [DEV] Add pmin to resultatsHoraires * [DEV] Add move pmin to PRODUCTION_THERMIQUE_OPTIMAL * [DEV] Use PuissanceMinDuPalierThermique * [DEV] Check if PuissanceDisponibleEtCout is empty * [DEV] if syntax * [DEV] use PMinOfClusters * [DEV] Clean comments * [DEV] use PuissanceMinDuPalierThermique * Revert "[DEV] use PuissanceMinDuPalierThermique" This reverts commit 85808475c5c0e1f64c0094a738f10a7f950b69d7. --------- Co-authored-by: Florian OMNES <26088210+flomnes@users.noreply.github.com> --- src/solver/simulation/sim_alloc_probleme_hebdo.cpp | 1 + src/solver/simulation/sim_structure_probleme_economique.h | 1 - src/solver/variable/economy/profitByPlant.h | 4 +++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/solver/simulation/sim_alloc_probleme_hebdo.cpp b/src/solver/simulation/sim_alloc_probleme_hebdo.cpp index b35d3f8b34..60ec2b21df 100644 --- a/src/solver/simulation/sim_alloc_probleme_hebdo.cpp +++ b/src/solver/simulation/sim_alloc_probleme_hebdo.cpp @@ -459,6 +459,7 @@ void SIM_AllocateAreas(PROBLEME_HEBDO& problem, .assign(NombreDePasDeTemps, 0.); problem.ResultatsHoraires[k].debordementsHoraires .assign(NombreDePasDeTemps, 0.); + problem.PaliersThermiquesDuPays[k].PuissanceDisponibleEtCout.resize(nbPaliers); problem.ResultatsHoraires[k].ProductionThermique.resize(NombreDePasDeTemps); diff --git a/src/solver/simulation/sim_structure_probleme_economique.h b/src/solver/simulation/sim_structure_probleme_economique.h index 49c620d868..e3d334103a 100644 --- a/src/solver/simulation/sim_structure_probleme_economique.h +++ b/src/solver/simulation/sim_structure_probleme_economique.h @@ -423,7 +423,6 @@ struct PRODUCTION_THERMIQUE_OPTIMALE std::vector NombreDeGroupesQuiSArretentDuPalier; std::vector NombreDeGroupesQuiTombentEnPanneDuPalier; - }; struct RESULTATS_HORAIRES diff --git a/src/solver/variable/economy/profitByPlant.h b/src/solver/variable/economy/profitByPlant.h index 5f28f9306c..ed16d434c0 100644 --- a/src/solver/variable/economy/profitByPlant.h +++ b/src/solver/variable/economy/profitByPlant.h @@ -304,9 +304,11 @@ class ProfitByPlant : public Variable::IVariable, NextT, VC double hourlyClusterProduction = thermal[area->index].thermalClustersProductions[clusterIndex]; uint tsIndex = state.timeseriesIndex->ThermiqueParPalier[cluster->areaWideIndex]; + double pMin = thermal[area->index].PMinOfClusters[clusterIndex]; + // Thermal cluster profit pValuesForTheCurrentYear[numSpace][cluster->areaWideIndex].hour[hourInTheYear] - = (hourlyClusterProduction - cluster->PthetaInf[hourInTheYear]) + = (hourlyClusterProduction - pMin) * (-areaMarginalCosts[hourInTheWeek] - cluster->getMarginalCost(tsIndex, hourInTheYear)); }