Skip to content

Commit

Permalink
remove maxhoursinaday
Browse files Browse the repository at this point in the history
  • Loading branch information
payetvin committed Jun 27, 2024
1 parent 4351f0f commit f44d045
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ namespace Solver
namespace Variable
{
constexpr unsigned int maxHoursInAYear = 8785;
constexpr unsigned int maxHoursInADay = 24;

template<int I>
struct PrecisionToPrintfFormat
Expand Down
10 changes: 5 additions & 5 deletions src/solver/variable/storage/intermediate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down Expand Up @@ -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.)
Expand Down Expand Up @@ -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;
}
}

Expand Down Expand Up @@ -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.)
{
Expand Down

0 comments on commit f44d045

Please sign in to comment.