Skip to content

Commit

Permalink
Fixing hydro debug (#2176)
Browse files Browse the repository at this point in the history
Recall : **Hydro allocation** is done at the beginning of each MC year,
and ends with a quantity of hydro energy for each day of the year. These
daily quantities are to be used as daily hydro generations in the
optimization problem.

The **hydro debug** functionality allows to print (if asked by user) on
disk a **report** about **hydro allocation results**.

This hydro allocation report is broken (a crash comes up). It was broken
since January 2023 (a commit can be supplied if needed).

This PR to fix this crash.
  • Loading branch information
guilpier-code authored Jun 19, 2024
1 parent 76237a6 commit 9794966
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/solver/hydro/management/daily.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,7 @@ inline void HydroManagement::prepareDailyOptimalGenerations(

if (debugData)
{
dayYear = 0;
for (uint month = 0; month != 12; ++month)
{
auto daysPerMonth = calendar_.months[month].days;
Expand All @@ -371,6 +372,7 @@ inline void HydroManagement::prepareDailyOptimalGenerations(
auto dYear = day + dayYear;
debugData->DailyTargetGen[dYear] = dailyTargetGen[dYear];
}
dayYear += daysPerMonth;
}
}

Expand Down

0 comments on commit 9794966

Please sign in to comment.