Skip to content

Commit

Permalink
New hydro remix : renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
guilpier-code committed Jan 8, 2025
1 parent 2309099 commit 1e51fa2
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions src/solver/simulation/shave-peaks-by-remix-hydro.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,14 @@ int find_min_index(const std::vector<double>& TotalGen,
const std::vector<double>& OutHydroGen,
const std::vector<bool>& triedBottom,
const std::vector<double>& HydroPmax,
const std::vector<bool>& filter_hours_remix,
const std::vector<bool>& enabledHours,
double top)
{
double min_val = top;
int min_hour = -1;
for (int h = 0; h < TotalGen.size(); ++h)
{
if (OutUnsupE[h] > 0 && OutHydroGen[h] < HydroPmax[h] && !triedBottom[h]
&& filter_hours_remix[h])
if (OutUnsupE[h] > 0 && OutHydroGen[h] < HydroPmax[h] && !triedBottom[h] && enabledHours[h])
{
if (TotalGen[h] < min_val)
{
Expand All @@ -37,7 +36,7 @@ int find_max_index(const std::vector<double>& TotalGen,
const std::vector<double>& OutHydroGen,
const std::vector<bool>& triedPeak,
const std::vector<double>& HydroPmin,
const std::vector<bool>& filter_hours_remix,
const std::vector<bool>& enabledHours,
double ref_value,
double eps)
{
Expand All @@ -46,7 +45,7 @@ int find_max_index(const std::vector<double>& TotalGen,
for (int h = 0; h < TotalGen.size(); ++h)
{
if (OutHydroGen[h] > HydroPmin[h] && TotalGen[h] >= ref_value + eps && !triedPeak[h]
&& filter_hours_remix[h])
&& enabledHours[h])
{
if (TotalGen[h] > max_val)
{
Expand Down Expand Up @@ -187,12 +186,12 @@ RemixHydroOutput shavePeaksByRemixingHydro(const std::vector<double>& DispatchGe
+ *std::max_element(HydroGen.begin(), HydroGen.end())
+ *std::max_element(UnsupE.begin(), UnsupE.end()) + 1;

std::vector<bool> filter_hours_remix(DispatchGen.size(), false);
for (unsigned int h = 0; h < filter_hours_remix.size(); h++)
std::vector<bool> enabledHours(DispatchGen.size(), false);
for (unsigned int h = 0; h < enabledHours.size(); h++)
{
if (Spillage[h] + DTG_MRG[h] == 0. && HydroGen[h] + UnsupE[h] > 0.)
{
filter_hours_remix[h] = true;
enabledHours[h] = true;
}
}

Expand All @@ -215,7 +214,7 @@ RemixHydroOutput shavePeaksByRemixingHydro(const std::vector<double>& DispatchGe
OutHydroGen,
triedBottom,
HydroPmax,
filter_hours_remix,
enabledHours,
top);
if (hourBottom == -1)
{
Expand All @@ -229,7 +228,7 @@ RemixHydroOutput shavePeaksByRemixingHydro(const std::vector<double>& DispatchGe
OutHydroGen,
triedPeak,
HydroPmin,
filter_hours_remix,
enabledHours,
TotalGen[hourBottom],
eps);
if (hourPeak == -1)
Expand Down

0 comments on commit 1e51fa2

Please sign in to comment.