From 0fff6cdc0bcd11472cf6dca736170f916ef08f41 Mon Sep 17 00:00:00 2001 From: Florian OMNES Date: Tue, 28 Jan 2025 10:34:35 +0100 Subject: [PATCH 1/3] Remove recently introduced build warnings --- .../antares/study/parts/thermal/constant_cost_provider.cpp | 6 +++--- src/solver/simulation/common-hydro-remix.cpp | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/libs/antares/study/parts/thermal/constant_cost_provider.cpp b/src/libs/antares/study/parts/thermal/constant_cost_provider.cpp index 0f7133f19d..b7b7f9b580 100644 --- a/src/libs/antares/study/parts/thermal/constant_cost_provider.cpp +++ b/src/libs/antares/study/parts/thermal/constant_cost_provider.cpp @@ -27,19 +27,19 @@ ConstantCostProvider::ConstantCostProvider(const ThermalCluster& cluster): { } -double ConstantCostProvider::getOperatingCost(uint serieIndex, uint hourInTheYear) const +double ConstantCostProvider::getOperatingCost(uint /*serieIndex*/, uint hourInTheYear) const { const auto* modCost = cluster.modulation[thermalModulationCost]; return cluster.marginalCost * modCost[hourInTheYear]; } -double ConstantCostProvider::getMarginalCost(uint serieIndex, uint hourInTheYear) const +double ConstantCostProvider::getMarginalCost(uint /*serieIndex*/, uint hourInTheYear) const { const double mod = cluster.modulation[Data::thermalModulationCost][hourInTheYear]; return cluster.marginalCost * mod; } -double ConstantCostProvider::getMarketBidCost(uint hourInTheYear, uint year) const +double ConstantCostProvider::getMarketBidCost(uint hourInTheYear, uint /*year*/) const { const double mod = cluster.modulation[thermalModulationMarketBid][hourInTheYear]; return cluster.marketBidCost * mod; diff --git a/src/solver/simulation/common-hydro-remix.cpp b/src/solver/simulation/common-hydro-remix.cpp index 13f8e5d49d..59d5653818 100644 --- a/src/solver/simulation/common-hydro-remix.cpp +++ b/src/solver/simulation/common-hydro-remix.cpp @@ -242,7 +242,7 @@ std::vector extractLoadForCurrentWeek(const Data::Area& area, const unsigned int firstHourOfWeek) { std::vector load_to_return(HOURS_IN_WEEK, 0.); - for (int h = 0; h < HOURS_IN_WEEK; h++) + for (unsigned int h = 0; h < HOURS_IN_WEEK; h++) { load_to_return[h] = area.load.series.getColumn(year)[h + firstHourOfWeek]; } @@ -255,7 +255,7 @@ std::vector extractHydroPmin(const Data::Area& area, { // area->hydro.series->mingen.timeSeries std::vector hydroPmin(HOURS_IN_WEEK, 0.); - for (int h = 0; h < HOURS_IN_WEEK; h++) + for (unsigned int h = 0; h < HOURS_IN_WEEK; h++) { hydroPmin[h] = area.hydro.series->mingen.getColumn(year)[h + firstHourOfWeek]; } From bc11cb8e59d84e36595c7f445733e18bc04ae858 Mon Sep 17 00:00:00 2001 From: Florian OMNES Date: Tue, 28 Jan 2025 13:54:42 +0100 Subject: [PATCH 2/3] Use attribute --- .../study/parts/thermal/constant_cost_provider.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/libs/antares/study/parts/thermal/constant_cost_provider.cpp b/src/libs/antares/study/parts/thermal/constant_cost_provider.cpp index b7b7f9b580..341df63db1 100644 --- a/src/libs/antares/study/parts/thermal/constant_cost_provider.cpp +++ b/src/libs/antares/study/parts/thermal/constant_cost_provider.cpp @@ -27,19 +27,21 @@ ConstantCostProvider::ConstantCostProvider(const ThermalCluster& cluster): { } -double ConstantCostProvider::getOperatingCost(uint /*serieIndex*/, uint hourInTheYear) const +double ConstantCostProvider::getOperatingCost([[maybe_unused]] uint serieIndex, + uint hourInTheYear) const { const auto* modCost = cluster.modulation[thermalModulationCost]; return cluster.marginalCost * modCost[hourInTheYear]; } -double ConstantCostProvider::getMarginalCost(uint /*serieIndex*/, uint hourInTheYear) const +double ConstantCostProvider::getMarginalCost([[maybe_unused]] uint serieIndex, + uint hourInTheYear) const { const double mod = cluster.modulation[Data::thermalModulationCost][hourInTheYear]; return cluster.marginalCost * mod; } -double ConstantCostProvider::getMarketBidCost(uint hourInTheYear, uint /*year*/) const +double ConstantCostProvider::getMarketBidCost(uint hourInTheYear, [[maybe_unused]] uint year) const { const double mod = cluster.modulation[thermalModulationMarketBid][hourInTheYear]; return cluster.marketBidCost * mod; From 7bce06193583f18baae40b8049bb213c82949766 Mon Sep 17 00:00:00 2001 From: Florian OMNES Date: Thu, 30 Jan 2025 13:04:58 +0100 Subject: [PATCH 3/3] Review --- .../study/parts/thermal/constant_cost_provider.cpp | 8 +++----- src/solver/simulation/common-hydro-remix.cpp | 4 ++-- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/libs/antares/study/parts/thermal/constant_cost_provider.cpp b/src/libs/antares/study/parts/thermal/constant_cost_provider.cpp index 341df63db1..b7b7f9b580 100644 --- a/src/libs/antares/study/parts/thermal/constant_cost_provider.cpp +++ b/src/libs/antares/study/parts/thermal/constant_cost_provider.cpp @@ -27,21 +27,19 @@ ConstantCostProvider::ConstantCostProvider(const ThermalCluster& cluster): { } -double ConstantCostProvider::getOperatingCost([[maybe_unused]] uint serieIndex, - uint hourInTheYear) const +double ConstantCostProvider::getOperatingCost(uint /*serieIndex*/, uint hourInTheYear) const { const auto* modCost = cluster.modulation[thermalModulationCost]; return cluster.marginalCost * modCost[hourInTheYear]; } -double ConstantCostProvider::getMarginalCost([[maybe_unused]] uint serieIndex, - uint hourInTheYear) const +double ConstantCostProvider::getMarginalCost(uint /*serieIndex*/, uint hourInTheYear) const { const double mod = cluster.modulation[Data::thermalModulationCost][hourInTheYear]; return cluster.marginalCost * mod; } -double ConstantCostProvider::getMarketBidCost(uint hourInTheYear, [[maybe_unused]] uint year) const +double ConstantCostProvider::getMarketBidCost(uint hourInTheYear, uint /*year*/) const { const double mod = cluster.modulation[thermalModulationMarketBid][hourInTheYear]; return cluster.marketBidCost * mod; diff --git a/src/solver/simulation/common-hydro-remix.cpp b/src/solver/simulation/common-hydro-remix.cpp index 59d5653818..6efe145983 100644 --- a/src/solver/simulation/common-hydro-remix.cpp +++ b/src/solver/simulation/common-hydro-remix.cpp @@ -242,7 +242,7 @@ std::vector extractLoadForCurrentWeek(const Data::Area& area, const unsigned int firstHourOfWeek) { std::vector load_to_return(HOURS_IN_WEEK, 0.); - for (unsigned int h = 0; h < HOURS_IN_WEEK; h++) + for (unsigned int h = 0; h < HOURS_IN_WEEK; ++h) { load_to_return[h] = area.load.series.getColumn(year)[h + firstHourOfWeek]; } @@ -255,7 +255,7 @@ std::vector extractHydroPmin(const Data::Area& area, { // area->hydro.series->mingen.timeSeries std::vector hydroPmin(HOURS_IN_WEEK, 0.); - for (unsigned int h = 0; h < HOURS_IN_WEEK; h++) + for (unsigned int h = 0; h < HOURS_IN_WEEK; ++h) { hydroPmin[h] = area.hydro.series->mingen.getColumn(year)[h + firstHourOfWeek]; }