From f44d04584e8a4916bb7b59b61f9724d2ee6f2208 Mon Sep 17 00:00:00 2001 From: Vincent Payet Date: Thu, 27 Jun 2024 11:47:13 +0200 Subject: [PATCH] remove maxhoursinaday --- .../include/antares/solver/variable/constants.h | 1 - src/solver/variable/storage/intermediate.cpp | 10 +++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/solver/variable/include/antares/solver/variable/constants.h b/src/solver/variable/include/antares/solver/variable/constants.h index 71d5c96d45..b5dbccf747 100644 --- a/src/solver/variable/include/antares/solver/variable/constants.h +++ b/src/solver/variable/include/antares/solver/variable/constants.h @@ -28,7 +28,6 @@ namespace Solver namespace Variable { constexpr unsigned int maxHoursInAYear = 8785; -constexpr unsigned int maxHoursInADay = 24; template struct PrecisionToPrintfFormat diff --git a/src/solver/variable/storage/intermediate.cpp b/src/solver/variable/storage/intermediate.cpp index cb99e3dbc4..4299ed7e23 100644 --- a/src/solver/variable/storage/intermediate.cpp +++ b/src/solver/variable/storage/intermediate.cpp @@ -87,7 +87,7 @@ void IntermediateValues::computeStatisticsForTheCurrentYear() { double d = 0.; // One day - for (j = 0; j != maxHoursInADay; ++j) + for (j = 0; j != HOURS_PER_DAY; ++j) { assert(indx < maxHoursInAYear); d += hour[indx]; @@ -142,7 +142,7 @@ void IntermediateValues::computeStatisticsOrForTheCurrentYear() { day[i] = 0.; // One day - for (j = 0; j != maxHoursInADay; ++j) + for (j = 0; j != HOURS_PER_DAY; ++j) { assert(indx < maxHoursInAYear); if (hour[indx] > 0.) @@ -220,12 +220,12 @@ void IntermediateValues::computeDailyAveragesForCurrentYear() { // Compute sum of hourly values on the current day of year day_sum = 0.; - for (uint h = 0; h != maxHoursInADay; ++h) + for (uint h = 0; h != HOURS_PER_DAY; ++h) { day_sum += hour[indx]; ++indx; } - day[d] = day_sum / maxHoursInADay; + day[d] = day_sum / HOURS_PER_DAY; } } @@ -303,7 +303,7 @@ void IntermediateValues::computeProbabilitiesForTheCurrentYear() { d = 0.; // One day - for (j = 0; j != maxHoursInADay; ++j) + for (j = 0; j != HOURS_PER_DAY; ++j) { if (hour[indx] > 0.) {