From 4a72418e4caf0618ca056fc8caa77b7e047e705c Mon Sep 17 00:00:00 2001 From: Vincent Payet Date: Mon, 13 Nov 2023 15:54:02 +0100 Subject: [PATCH 01/12] [DEV] Set thetaInf value to match constraint value --- src/solver/simulation/common-eco-adq.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/solver/simulation/common-eco-adq.cpp b/src/solver/simulation/common-eco-adq.cpp index 4d8f4a1f11..9812e614d7 100644 --- a/src/solver/simulation/common-eco-adq.cpp +++ b/src/solver/simulation/common-eco-adq.cpp @@ -383,7 +383,7 @@ void BuildThermalPartOfWeeklyProblem(Data::Study& study, for (uint areaIdx = 0; areaIdx < nbPays; ++areaIdx) { auto& area = *study.areas.byIndex[areaIdx]; - area.thermal.list.each([&](const Data::ThermalCluster& cluster) + area.thermal.list.each([&](Data::ThermalCluster& cluster) { auto& Pt = problem.PaliersThermiquesDuPays[areaIdx] .PuissanceDisponibleEtCout[cluster.index]; @@ -395,10 +395,15 @@ void BuildThermalPartOfWeeklyProblem(Data::Study& study, Pt.PuissanceDisponibleDuPalierThermique[hourInWeek] = cluster.series.getCoefficient(year, hourInYear); - Pt.PuissanceMinDuPalierThermique[hourInWeek] - = (Pt.PuissanceDisponibleDuPalierThermique[hourInWeek] < cluster.PthetaInf[hourInYear]) - ? Pt.PuissanceDisponibleDuPalierThermique[hourInWeek] - : cluster.PthetaInf[hourInYear]; + if (Pt.PuissanceDisponibleDuPalierThermique[hourInWeek] < cluster.PthetaInf[hourInYear]) + { + Pt.PuissanceMinDuPalierThermique[hourInWeek] = Pt.PuissanceDisponibleDuPalierThermique[hourInWeek]; + cluster.PthetaInf[hourInYear] = Pt.PuissanceDisponibleDuPalierThermique[hourInWeek]; + } + else + { + Pt.PuissanceMinDuPalierThermique[hourInWeek] = cluster.PthetaInf[hourInYear]; + } }); } } From 1b64e0cc66be075ae7e3f9bd94d7c8df8a867146 Mon Sep 17 00:00:00 2001 From: Vincent Payet Date: Wed, 15 Nov 2023 14:28:38 +0100 Subject: [PATCH 02/12] [DEV] Revert thetainf changes --- src/solver/simulation/common-eco-adq.cpp | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/solver/simulation/common-eco-adq.cpp b/src/solver/simulation/common-eco-adq.cpp index 9812e614d7..4d8f4a1f11 100644 --- a/src/solver/simulation/common-eco-adq.cpp +++ b/src/solver/simulation/common-eco-adq.cpp @@ -383,7 +383,7 @@ void BuildThermalPartOfWeeklyProblem(Data::Study& study, for (uint areaIdx = 0; areaIdx < nbPays; ++areaIdx) { auto& area = *study.areas.byIndex[areaIdx]; - area.thermal.list.each([&](Data::ThermalCluster& cluster) + area.thermal.list.each([&](const Data::ThermalCluster& cluster) { auto& Pt = problem.PaliersThermiquesDuPays[areaIdx] .PuissanceDisponibleEtCout[cluster.index]; @@ -395,15 +395,10 @@ void BuildThermalPartOfWeeklyProblem(Data::Study& study, Pt.PuissanceDisponibleDuPalierThermique[hourInWeek] = cluster.series.getCoefficient(year, hourInYear); - if (Pt.PuissanceDisponibleDuPalierThermique[hourInWeek] < cluster.PthetaInf[hourInYear]) - { - Pt.PuissanceMinDuPalierThermique[hourInWeek] = Pt.PuissanceDisponibleDuPalierThermique[hourInWeek]; - cluster.PthetaInf[hourInYear] = Pt.PuissanceDisponibleDuPalierThermique[hourInWeek]; - } - else - { - Pt.PuissanceMinDuPalierThermique[hourInWeek] = cluster.PthetaInf[hourInYear]; - } + Pt.PuissanceMinDuPalierThermique[hourInWeek] + = (Pt.PuissanceDisponibleDuPalierThermique[hourInWeek] < cluster.PthetaInf[hourInYear]) + ? Pt.PuissanceDisponibleDuPalierThermique[hourInWeek] + : cluster.PthetaInf[hourInYear]; }); } } From 43dcc0560257ed87381e36c78eca806031534f65 Mon Sep 17 00:00:00 2001 From: Vincent Payet Date: Wed, 15 Nov 2023 16:17:38 +0100 Subject: [PATCH 03/12] [DEV] Add pmin to thermal cluster --- src/libs/antares/study/parts/thermal/cluster.cpp | 1 + src/libs/antares/study/parts/thermal/cluster.h | 1 + src/libs/antares/study/study.cpp | 3 +++ src/solver/simulation/common-eco-adq.cpp | 1 + 4 files changed, 6 insertions(+) diff --git a/src/libs/antares/study/parts/thermal/cluster.cpp b/src/libs/antares/study/parts/thermal/cluster.cpp index 72548e03fe..7efa494102 100644 --- a/src/libs/antares/study/parts/thermal/cluster.cpp +++ b/src/libs/antares/study/parts/thermal/cluster.cpp @@ -137,6 +137,7 @@ Data::ThermalCluster::ThermalCluster(Area* parent) : forcedLaw(thermalLawUniform), plannedLaw(thermalLawUniform), PthetaInf(HOURS_PER_YEAR, 0), + pMin(HOURS_PER_YEAR, 0), costsTimeSeries(1, CostsTimeSeries()) { // assert diff --git a/src/libs/antares/study/parts/thermal/cluster.h b/src/libs/antares/study/parts/thermal/cluster.h index a75ce10a00..19f0bec423 100644 --- a/src/libs/antares/study/parts/thermal/cluster.h +++ b/src/libs/antares/study/parts/thermal/cluster.h @@ -348,6 +348,7 @@ class ThermalCluster final : public Cluster, public std::enable_shared_from_this ** PthetaInf[hour] */ std::vector PthetaInf; + mutable std::vector pMin; //! Data for the preprocessor PreproThermal* prepro = nullptr; diff --git a/src/libs/antares/study/study.cpp b/src/libs/antares/study/study.cpp index dfaf427287..740d7e3a99 100644 --- a/src/libs/antares/study/study.cpp +++ b/src/libs/antares/study/study.cpp @@ -1536,8 +1536,11 @@ void Study::computePThetaInfForThermalClusters() const // Alias du cluster courant auto& cluster = area.thermal.list.byIndex[j]; for (uint k = 0; k < HOURS_PER_YEAR; k++) + { cluster->PthetaInf[k] = cluster->modulation[Data::thermalMinGenModulation][k] * cluster->unitCount * cluster->nominalCapacity; + cluster->pMin[k] = cluster->PthetaInf[k]; + } } } } diff --git a/src/solver/simulation/common-eco-adq.cpp b/src/solver/simulation/common-eco-adq.cpp index 4d8f4a1f11..defcaf96ad 100644 --- a/src/solver/simulation/common-eco-adq.cpp +++ b/src/solver/simulation/common-eco-adq.cpp @@ -399,6 +399,7 @@ void BuildThermalPartOfWeeklyProblem(Data::Study& study, = (Pt.PuissanceDisponibleDuPalierThermique[hourInWeek] < cluster.PthetaInf[hourInYear]) ? Pt.PuissanceDisponibleDuPalierThermique[hourInWeek] : cluster.PthetaInf[hourInYear]; + cluster.pMin[hourInYear] = Pt.PuissanceMinDuPalierThermique[hourInWeek]; }); } } From 80c544bdfbc4c182e31344c445e98d6be2bb6b1d Mon Sep 17 00:00:00 2001 From: Vincent Payet Date: Thu, 16 Nov 2023 11:42:53 +0100 Subject: [PATCH 04/12] [DEV] Add pmin to resultatsHoraires --- src/libs/antares/study/parts/thermal/cluster.cpp | 1 - src/libs/antares/study/parts/thermal/cluster.h | 1 - src/libs/antares/study/study.cpp | 3 --- src/solver/simulation/common-eco-adq.cpp | 2 +- src/solver/simulation/sim_alloc_probleme_hebdo.cpp | 3 +++ src/solver/simulation/sim_structure_probleme_economique.h | 2 ++ src/solver/variable/economy/profitByPlant.h | 3 ++- 7 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/libs/antares/study/parts/thermal/cluster.cpp b/src/libs/antares/study/parts/thermal/cluster.cpp index 7efa494102..72548e03fe 100644 --- a/src/libs/antares/study/parts/thermal/cluster.cpp +++ b/src/libs/antares/study/parts/thermal/cluster.cpp @@ -137,7 +137,6 @@ Data::ThermalCluster::ThermalCluster(Area* parent) : forcedLaw(thermalLawUniform), plannedLaw(thermalLawUniform), PthetaInf(HOURS_PER_YEAR, 0), - pMin(HOURS_PER_YEAR, 0), costsTimeSeries(1, CostsTimeSeries()) { // assert diff --git a/src/libs/antares/study/parts/thermal/cluster.h b/src/libs/antares/study/parts/thermal/cluster.h index 19f0bec423..a75ce10a00 100644 --- a/src/libs/antares/study/parts/thermal/cluster.h +++ b/src/libs/antares/study/parts/thermal/cluster.h @@ -348,7 +348,6 @@ class ThermalCluster final : public Cluster, public std::enable_shared_from_this ** PthetaInf[hour] */ std::vector PthetaInf; - mutable std::vector pMin; //! Data for the preprocessor PreproThermal* prepro = nullptr; diff --git a/src/libs/antares/study/study.cpp b/src/libs/antares/study/study.cpp index 740d7e3a99..dfaf427287 100644 --- a/src/libs/antares/study/study.cpp +++ b/src/libs/antares/study/study.cpp @@ -1536,11 +1536,8 @@ void Study::computePThetaInfForThermalClusters() const // Alias du cluster courant auto& cluster = area.thermal.list.byIndex[j]; for (uint k = 0; k < HOURS_PER_YEAR; k++) - { cluster->PthetaInf[k] = cluster->modulation[Data::thermalMinGenModulation][k] * cluster->unitCount * cluster->nominalCapacity; - cluster->pMin[k] = cluster->PthetaInf[k]; - } } } } diff --git a/src/solver/simulation/common-eco-adq.cpp b/src/solver/simulation/common-eco-adq.cpp index defcaf96ad..e5377bdd6e 100644 --- a/src/solver/simulation/common-eco-adq.cpp +++ b/src/solver/simulation/common-eco-adq.cpp @@ -399,7 +399,7 @@ void BuildThermalPartOfWeeklyProblem(Data::Study& study, = (Pt.PuissanceDisponibleDuPalierThermique[hourInWeek] < cluster.PthetaInf[hourInYear]) ? Pt.PuissanceDisponibleDuPalierThermique[hourInWeek] : cluster.PthetaInf[hourInYear]; - cluster.pMin[hourInYear] = Pt.PuissanceMinDuPalierThermique[hourInWeek]; + problem.ResultatsHoraires[area.index].pMinThermique[hourInYear] = Pt.PuissanceMinDuPalierThermique[hourInWeek]; }); } } diff --git a/src/solver/simulation/sim_alloc_probleme_hebdo.cpp b/src/solver/simulation/sim_alloc_probleme_hebdo.cpp index c4da3fbc36..1229c7a040 100644 --- a/src/solver/simulation/sim_alloc_probleme_hebdo.cpp +++ b/src/solver/simulation/sim_alloc_probleme_hebdo.cpp @@ -458,6 +458,9 @@ void SIM_AllocateAreas(PROBLEME_HEBDO& problem, .assign(NombreDePasDeTemps, 0.); problem.ResultatsHoraires[k].debordementsHoraires .assign(NombreDePasDeTemps, 0.); + problem.ResultatsHoraires[k].pMinThermique + .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 3d15844242..309ea07661 100644 --- a/src/solver/simulation/sim_structure_probleme_economique.h +++ b/src/solver/simulation/sim_structure_probleme_economique.h @@ -458,6 +458,8 @@ struct RESULTATS_HORAIRES std::vector ProductionThermique; // index is pdtHebdo std::vector<::ShortTermStorage::RESULTS> ShortTermStorage; + + std::vector pMinThermique; }; struct COUTS_DE_TRANSPORT diff --git a/src/solver/variable/economy/profitByPlant.h b/src/solver/variable/economy/profitByPlant.h index cae240fa2d..20f6da9b67 100644 --- a/src/solver/variable/economy/profitByPlant.h +++ b/src/solver/variable/economy/profitByPlant.h @@ -278,9 +278,10 @@ class ProfitByPlant : public Variable::IVariable, NextT, VC double hourlyClusterProduction = thermal[area->index].thermalClustersProductions[clusterIndex]; uint tsIndex = cluster->series.timeseriesNumbers[0][state.year]; + auto& pMin = state.problemeHebdo->ResultatsHoraires[area->index].pMinThermique; // Thermal cluster profit pValuesForTheCurrentYear[numSpace][cluster->areaWideIndex].hour[hourInTheYear] - = (hourlyClusterProduction - cluster->PthetaInf[hourInTheYear]) + = (hourlyClusterProduction - pMin[hourInTheYear]) * (-areaMarginalCosts[hourInTheWeek] - cluster->getMarginalCost(tsIndex, hourInTheYear)); } From 18f03c2cac9a410afcdabb385850110c308a9131 Mon Sep 17 00:00:00 2001 From: Vincent Payet Date: Thu, 16 Nov 2023 13:54:28 +0100 Subject: [PATCH 05/12] [DEV] Add move pmin to PRODUCTION_THERMIQUE_OPTIMAL --- src/solver/simulation/common-eco-adq.cpp | 2 +- src/solver/simulation/sim_alloc_probleme_hebdo.cpp | 4 ++-- src/solver/simulation/sim_structure_probleme_economique.h | 3 +-- src/solver/variable/economy/profitByPlant.h | 4 +++- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/solver/simulation/common-eco-adq.cpp b/src/solver/simulation/common-eco-adq.cpp index e5377bdd6e..2166bc6e42 100644 --- a/src/solver/simulation/common-eco-adq.cpp +++ b/src/solver/simulation/common-eco-adq.cpp @@ -399,7 +399,7 @@ void BuildThermalPartOfWeeklyProblem(Data::Study& study, = (Pt.PuissanceDisponibleDuPalierThermique[hourInWeek] < cluster.PthetaInf[hourInYear]) ? Pt.PuissanceDisponibleDuPalierThermique[hourInWeek] : cluster.PthetaInf[hourInYear]; - problem.ResultatsHoraires[area.index].pMinThermique[hourInYear] = Pt.PuissanceMinDuPalierThermique[hourInWeek]; + problem.ResultatsHoraires[area.index].ProductionThermique[cluster.index].pMinThermique[hourInYear] = Pt.PuissanceMinDuPalierThermique[hourInWeek]; }); } } diff --git a/src/solver/simulation/sim_alloc_probleme_hebdo.cpp b/src/solver/simulation/sim_alloc_probleme_hebdo.cpp index 1229c7a040..eb176bb812 100644 --- a/src/solver/simulation/sim_alloc_probleme_hebdo.cpp +++ b/src/solver/simulation/sim_alloc_probleme_hebdo.cpp @@ -458,8 +458,6 @@ void SIM_AllocateAreas(PROBLEME_HEBDO& problem, .assign(NombreDePasDeTemps, 0.); problem.ResultatsHoraires[k].debordementsHoraires .assign(NombreDePasDeTemps, 0.); - problem.ResultatsHoraires[k].pMinThermique - .assign(NombreDePasDeTemps, 0.); problem.PaliersThermiquesDuPays[k].PuissanceDisponibleEtCout.resize(nbPaliers); problem.ResultatsHoraires[k].ProductionThermique.resize(NombreDePasDeTemps); @@ -497,6 +495,8 @@ void SIM_AllocateAreas(PROBLEME_HEBDO& problem, } for (unsigned j = 0; j < NombreDePasDeTemps; j++) { + problem.ResultatsHoraires[k].ProductionThermique[j].pMinThermique + .assign(NombreDePasDeTemps, 0.); problem.ResultatsHoraires[k].ProductionThermique[j].ProductionThermiqueDuPalier .assign(nbPaliers, 0.); problem.ResultatsHoraires[k].ProductionThermique[j].ProductionThermiqueDuPalierUp diff --git a/src/solver/simulation/sim_structure_probleme_economique.h b/src/solver/simulation/sim_structure_probleme_economique.h index 309ea07661..e5ddfd1e6a 100644 --- a/src/solver/simulation/sim_structure_probleme_economique.h +++ b/src/solver/simulation/sim_structure_probleme_economique.h @@ -425,6 +425,7 @@ struct PRODUCTION_THERMIQUE_OPTIMALE std::vector NombreDeGroupesQuiTombentEnPanneDuPalier; + std::vector pMinThermique; }; struct RESULTATS_HORAIRES @@ -458,8 +459,6 @@ struct RESULTATS_HORAIRES std::vector ProductionThermique; // index is pdtHebdo std::vector<::ShortTermStorage::RESULTS> ShortTermStorage; - - std::vector pMinThermique; }; struct COUTS_DE_TRANSPORT diff --git a/src/solver/variable/economy/profitByPlant.h b/src/solver/variable/economy/profitByPlant.h index 20f6da9b67..9be907971f 100644 --- a/src/solver/variable/economy/profitByPlant.h +++ b/src/solver/variable/economy/profitByPlant.h @@ -278,7 +278,9 @@ class ProfitByPlant : public Variable::IVariable, NextT, VC double hourlyClusterProduction = thermal[area->index].thermalClustersProductions[clusterIndex]; uint tsIndex = cluster->series.timeseriesNumbers[0][state.year]; - auto& pMin = state.problemeHebdo->ResultatsHoraires[area->index].pMinThermique; + auto& pMin = state.problemeHebdo->ResultatsHoraires[area->index] + .ProductionThermique[cluster->index].pMinThermique; + // Thermal cluster profit pValuesForTheCurrentYear[numSpace][cluster->areaWideIndex].hour[hourInTheYear] = (hourlyClusterProduction - pMin[hourInTheYear]) From f92982fde3932013922d7330bc1171b54048c0e4 Mon Sep 17 00:00:00 2001 From: Vincent Payet Date: Thu, 16 Nov 2023 14:56:34 +0100 Subject: [PATCH 06/12] [DEV] Use PuissanceMinDuPalierThermique --- src/solver/simulation/common-eco-adq.cpp | 1 - src/solver/simulation/sim_alloc_probleme_hebdo.cpp | 2 -- src/solver/simulation/sim_structure_probleme_economique.h | 2 -- src/solver/variable/economy/profitByPlant.h | 5 +++-- 4 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/solver/simulation/common-eco-adq.cpp b/src/solver/simulation/common-eco-adq.cpp index 2166bc6e42..4d8f4a1f11 100644 --- a/src/solver/simulation/common-eco-adq.cpp +++ b/src/solver/simulation/common-eco-adq.cpp @@ -399,7 +399,6 @@ void BuildThermalPartOfWeeklyProblem(Data::Study& study, = (Pt.PuissanceDisponibleDuPalierThermique[hourInWeek] < cluster.PthetaInf[hourInYear]) ? Pt.PuissanceDisponibleDuPalierThermique[hourInWeek] : cluster.PthetaInf[hourInYear]; - problem.ResultatsHoraires[area.index].ProductionThermique[cluster.index].pMinThermique[hourInYear] = Pt.PuissanceMinDuPalierThermique[hourInWeek]; }); } } diff --git a/src/solver/simulation/sim_alloc_probleme_hebdo.cpp b/src/solver/simulation/sim_alloc_probleme_hebdo.cpp index eb176bb812..37494d2d0d 100644 --- a/src/solver/simulation/sim_alloc_probleme_hebdo.cpp +++ b/src/solver/simulation/sim_alloc_probleme_hebdo.cpp @@ -495,8 +495,6 @@ void SIM_AllocateAreas(PROBLEME_HEBDO& problem, } for (unsigned j = 0; j < NombreDePasDeTemps; j++) { - problem.ResultatsHoraires[k].ProductionThermique[j].pMinThermique - .assign(NombreDePasDeTemps, 0.); problem.ResultatsHoraires[k].ProductionThermique[j].ProductionThermiqueDuPalier .assign(nbPaliers, 0.); problem.ResultatsHoraires[k].ProductionThermique[j].ProductionThermiqueDuPalierUp diff --git a/src/solver/simulation/sim_structure_probleme_economique.h b/src/solver/simulation/sim_structure_probleme_economique.h index e5ddfd1e6a..8468ce77ee 100644 --- a/src/solver/simulation/sim_structure_probleme_economique.h +++ b/src/solver/simulation/sim_structure_probleme_economique.h @@ -424,8 +424,6 @@ struct PRODUCTION_THERMIQUE_OPTIMALE std::vector NombreDeGroupesQuiSArretentDuPalier; std::vector NombreDeGroupesQuiTombentEnPanneDuPalier; - - std::vector pMinThermique; }; struct RESULTATS_HORAIRES diff --git a/src/solver/variable/economy/profitByPlant.h b/src/solver/variable/economy/profitByPlant.h index 9be907971f..844fc688a4 100644 --- a/src/solver/variable/economy/profitByPlant.h +++ b/src/solver/variable/economy/profitByPlant.h @@ -278,8 +278,9 @@ class ProfitByPlant : public Variable::IVariable, NextT, VC double hourlyClusterProduction = thermal[area->index].thermalClustersProductions[clusterIndex]; uint tsIndex = cluster->series.timeseriesNumbers[0][state.year]; - auto& pMin = state.problemeHebdo->ResultatsHoraires[area->index] - .ProductionThermique[cluster->index].pMinThermique; + auto& pMin = state.problemeHebdo->PaliersThermiquesDuPays[area->index] + .PuissanceDisponibleEtCout[cluster->index] + .PuissanceMinDuPalierThermique; // Thermal cluster profit pValuesForTheCurrentYear[numSpace][cluster->areaWideIndex].hour[hourInTheYear] From b86cbaf4f5b216249eca39a3f1086b7560ef1318 Mon Sep 17 00:00:00 2001 From: Vincent Payet Date: Thu, 16 Nov 2023 17:42:16 +0100 Subject: [PATCH 07/12] [DEV] Check if PuissanceDisponibleEtCout is empty --- src/solver/variable/economy/profitByPlant.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/solver/variable/economy/profitByPlant.h b/src/solver/variable/economy/profitByPlant.h index 844fc688a4..4d353531b4 100644 --- a/src/solver/variable/economy/profitByPlant.h +++ b/src/solver/variable/economy/profitByPlant.h @@ -278,13 +278,16 @@ class ProfitByPlant : public Variable::IVariable, NextT, VC double hourlyClusterProduction = thermal[area->index].thermalClustersProductions[clusterIndex]; uint tsIndex = cluster->series.timeseriesNumbers[0][state.year]; - auto& pMin = state.problemeHebdo->PaliersThermiquesDuPays[area->index] + + double pMin = 0; + if (!state.problemeHebdo->PaliersThermiquesDuPays[area->index].PuissanceDisponibleEtCout.empty()) + pMin = state.problemeHebdo->PaliersThermiquesDuPays[area->index] .PuissanceDisponibleEtCout[cluster->index] - .PuissanceMinDuPalierThermique; + .PuissanceMinDuPalierThermique[hourInTheYear]; // Thermal cluster profit pValuesForTheCurrentYear[numSpace][cluster->areaWideIndex].hour[hourInTheYear] - = (hourlyClusterProduction - pMin[hourInTheYear]) + = (hourlyClusterProduction - pMin) * (-areaMarginalCosts[hourInTheWeek] - cluster->getMarginalCost(tsIndex, hourInTheYear)); } From 29c206cf8776c7a8c3503747f056a5ab73605e21 Mon Sep 17 00:00:00 2001 From: Vincent Payet Date: Fri, 17 Nov 2023 12:22:43 +0100 Subject: [PATCH 08/12] [DEV] if syntax --- src/solver/variable/economy/profitByPlant.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/solver/variable/economy/profitByPlant.h b/src/solver/variable/economy/profitByPlant.h index 4d353531b4..681f5db099 100644 --- a/src/solver/variable/economy/profitByPlant.h +++ b/src/solver/variable/economy/profitByPlant.h @@ -281,9 +281,11 @@ class ProfitByPlant : public Variable::IVariable, NextT, VC double pMin = 0; if (!state.problemeHebdo->PaliersThermiquesDuPays[area->index].PuissanceDisponibleEtCout.empty()) + { pMin = state.problemeHebdo->PaliersThermiquesDuPays[area->index] - .PuissanceDisponibleEtCout[cluster->index] - .PuissanceMinDuPalierThermique[hourInTheYear]; + .PuissanceDisponibleEtCout[cluster->index] + .PuissanceMinDuPalierThermique[hourInTheYear]; + } // Thermal cluster profit pValuesForTheCurrentYear[numSpace][cluster->areaWideIndex].hour[hourInTheYear] From aa833fa36547bd9524aa311ba7aa725eee618cc9 Mon Sep 17 00:00:00 2001 From: Vincent Payet Date: Fri, 17 Nov 2023 15:33:21 +0100 Subject: [PATCH 09/12] [DEV] use PMinOfClusters --- src/solver/variable/economy/profitByPlant.h | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/solver/variable/economy/profitByPlant.h b/src/solver/variable/economy/profitByPlant.h index 681f5db099..d0b1883a93 100644 --- a/src/solver/variable/economy/profitByPlant.h +++ b/src/solver/variable/economy/profitByPlant.h @@ -277,15 +277,16 @@ class ProfitByPlant : public Variable::IVariable, NextT, VC auto* cluster = state.area->thermal.clusters[clusterIndex]; double hourlyClusterProduction = thermal[area->index].thermalClustersProductions[clusterIndex]; + double pMin = thermal[area->index].PMinOfClusters[clusterIndex]; uint tsIndex = cluster->series.timeseriesNumbers[0][state.year]; - double pMin = 0; - if (!state.problemeHebdo->PaliersThermiquesDuPays[area->index].PuissanceDisponibleEtCout.empty()) - { - pMin = state.problemeHebdo->PaliersThermiquesDuPays[area->index] - .PuissanceDisponibleEtCout[cluster->index] - .PuissanceMinDuPalierThermique[hourInTheYear]; - } + /* double pMin = 0; */ + /* if (!state.problemeHebdo->PaliersThermiquesDuPays[area->index].PuissanceDisponibleEtCout.empty()) */ + /* { */ + /* pMin = state.problemeHebdo->PaliersThermiquesDuPays[area->index] */ + /* .PuissanceDisponibleEtCout[cluster->index] */ + /* .PuissanceMinDuPalierThermique[hourInTheYear]; */ + /* } */ // Thermal cluster profit pValuesForTheCurrentYear[numSpace][cluster->areaWideIndex].hour[hourInTheYear] From 8e5afac641c349e087f08699da34fab78690db23 Mon Sep 17 00:00:00 2001 From: Vincent Payet Date: Fri, 17 Nov 2023 16:04:53 +0100 Subject: [PATCH 10/12] [DEV] Clean comments --- src/solver/variable/economy/profitByPlant.h | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/solver/variable/economy/profitByPlant.h b/src/solver/variable/economy/profitByPlant.h index d0b1883a93..02a471fab8 100644 --- a/src/solver/variable/economy/profitByPlant.h +++ b/src/solver/variable/economy/profitByPlant.h @@ -280,14 +280,6 @@ class ProfitByPlant : public Variable::IVariable, NextT, VC double pMin = thermal[area->index].PMinOfClusters[clusterIndex]; uint tsIndex = cluster->series.timeseriesNumbers[0][state.year]; - /* double pMin = 0; */ - /* if (!state.problemeHebdo->PaliersThermiquesDuPays[area->index].PuissanceDisponibleEtCout.empty()) */ - /* { */ - /* pMin = state.problemeHebdo->PaliersThermiquesDuPays[area->index] */ - /* .PuissanceDisponibleEtCout[cluster->index] */ - /* .PuissanceMinDuPalierThermique[hourInTheYear]; */ - /* } */ - // Thermal cluster profit pValuesForTheCurrentYear[numSpace][cluster->areaWideIndex].hour[hourInTheYear] = (hourlyClusterProduction - pMin) From 85808475c5c0e1f64c0094a738f10a7f950b69d7 Mon Sep 17 00:00:00 2001 From: Vincent Payet Date: Mon, 20 Nov 2023 10:24:17 +0100 Subject: [PATCH 11/12] [DEV] use PuissanceMinDuPalierThermique --- src/solver/variable/economy/profitByPlant.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/solver/variable/economy/profitByPlant.h b/src/solver/variable/economy/profitByPlant.h index 02a471fab8..681f5db099 100644 --- a/src/solver/variable/economy/profitByPlant.h +++ b/src/solver/variable/economy/profitByPlant.h @@ -277,9 +277,16 @@ class ProfitByPlant : public Variable::IVariable, NextT, VC auto* cluster = state.area->thermal.clusters[clusterIndex]; double hourlyClusterProduction = thermal[area->index].thermalClustersProductions[clusterIndex]; - double pMin = thermal[area->index].PMinOfClusters[clusterIndex]; uint tsIndex = cluster->series.timeseriesNumbers[0][state.year]; + double pMin = 0; + if (!state.problemeHebdo->PaliersThermiquesDuPays[area->index].PuissanceDisponibleEtCout.empty()) + { + pMin = state.problemeHebdo->PaliersThermiquesDuPays[area->index] + .PuissanceDisponibleEtCout[cluster->index] + .PuissanceMinDuPalierThermique[hourInTheYear]; + } + // Thermal cluster profit pValuesForTheCurrentYear[numSpace][cluster->areaWideIndex].hour[hourInTheYear] = (hourlyClusterProduction - pMin) From a5c284d92f4aab2d119ed74706635a39a5e1e466 Mon Sep 17 00:00:00 2001 From: Florian OMNES <26088210+flomnes@users.noreply.github.com> Date: Mon, 20 Nov 2023 12:57:23 +0100 Subject: [PATCH 12/12] Revert "[DEV] use PuissanceMinDuPalierThermique" This reverts commit 85808475c5c0e1f64c0094a738f10a7f950b69d7. --- src/solver/variable/economy/profitByPlant.h | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/solver/variable/economy/profitByPlant.h b/src/solver/variable/economy/profitByPlant.h index 681f5db099..02a471fab8 100644 --- a/src/solver/variable/economy/profitByPlant.h +++ b/src/solver/variable/economy/profitByPlant.h @@ -277,16 +277,9 @@ class ProfitByPlant : public Variable::IVariable, NextT, VC auto* cluster = state.area->thermal.clusters[clusterIndex]; double hourlyClusterProduction = thermal[area->index].thermalClustersProductions[clusterIndex]; + double pMin = thermal[area->index].PMinOfClusters[clusterIndex]; uint tsIndex = cluster->series.timeseriesNumbers[0][state.year]; - double pMin = 0; - if (!state.problemeHebdo->PaliersThermiquesDuPays[area->index].PuissanceDisponibleEtCout.empty()) - { - pMin = state.problemeHebdo->PaliersThermiquesDuPays[area->index] - .PuissanceDisponibleEtCout[cluster->index] - .PuissanceMinDuPalierThermique[hourInTheYear]; - } - // Thermal cluster profit pValuesForTheCurrentYear[numSpace][cluster->areaWideIndex].hour[hourInTheYear] = (hourlyClusterProduction - pMin)