-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix mingen issues with several modifications #2395
base: develop
Are you sure you want to change the base?
Changes from all commits
cb98071
58aec04
fa1653a
27aa0bd
2c96b63
38473a4
b01a028
28999d9
a138d8b
39793d9
b050671
ac97a13
862c092
de425d1
8c4508b
53f4417
606fde2
dec51f4
c9848a8
ba54eed
69d4ef7
792b1f6
f04faf9
0f1e82b
4245407
0b08645
6398513
53bdf5f
a67c089
4189a3e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,7 +53,7 @@ void H2O_J_InitialiserLesBornesdesVariables(DONNEES_MENSUELLES* DonneesMensuelle | |
int Var = CorrespondanceDesVariables.NumeroDeVariableTurbine[Pdt]; | ||
Xmax[Var] = TurbineMax[Pdt]; | ||
|
||
Xmin[Var] = std::min(TurbineMax[Pdt], std::max(TurbineCible[Pdt], TurbineMin[Pdt])); | ||
Xmin[Var] = std::min(TurbineMax[Pdt], TurbineMin[Pdt]); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So we no longer need to use const std::vector<double>& TurbineCible = DonneesMensuelles->TurbineCible; There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. About : Xmax[Var] = TurbineMax[Pdt];
Xmin[Var] = std::min(TurbineMax[Pdt], TurbineMin[Pdt]); It's strange that we give the lower bound of variable Turbine like this. Xmin[Var] = TurbineMin[Pdt];
Xmax[Var] = TurbineMax[Pdt]; It seems that TurbineMax is not necessarily greater than TurbineMin for every day, which is strange. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree, since there is a precheck for each hour in |
||
|
||
AdresseOuPlacerLaValeurDesVariablesOptimisees[Var] = &(Turbine[Pdt]); | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,8 +51,6 @@ AdqPatchPostProcessList::AdqPatchPostProcessList(const AdqPatchParams& adqPatchP | |
// Here a post process particular to adq patch | ||
post_process_list.push_back( | ||
std::make_unique<DTGmarginForAdqPatchPostProcessCmd>(problemeHebdo_, areas, thread_number)); | ||
post_process_list.push_back( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In the current PR presentation, it's said that the re-computation of hydro levels after weekly optimization should be removed. What we should do :
|
||
std::make_unique<HydroLevelsUpdatePostProcessCmd>(problemeHebdo_, areas, true, false)); | ||
post_process_list.push_back( | ||
std::make_unique<InterpolateWaterValuePostProcessCmd>(problemeHebdo_, areas, calendar)); | ||
post_process_list.push_back( | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -132,16 +132,16 @@ int OPT_DecompteDesVariablesEtDesContraintesDuProblemeAOptimiser(PROBLEME_HEBDO* | |
char Pump = problemeHebdo->CaracteristiquesHydrauliques[pays].PresenceDePompageModulable; | ||
char TurbEntreBornes = problemeHebdo->CaracteristiquesHydrauliques[pays] | ||
.TurbinageEntreBornes; | ||
char MonitorHourlyLev = problemeHebdo->CaracteristiquesHydrauliques[pays] | ||
.SuiviNiveauHoraire; | ||
|
||
if (!Pump && !TurbEntreBornes && !MonitorHourlyLev | ||
if (!Pump && !TurbEntreBornes | ||
&& problemeHebdo->CaracteristiquesHydrauliques[pays].PresenceDHydrauliqueModulable) | ||
{ | ||
ProblemeAResoudre->NombreDeContraintes++; | ||
} | ||
|
||
if (Pump && !TurbEntreBornes && !MonitorHourlyLev) | ||
ProblemeAResoudre->NombreDeContraintes += nombreDePasDeTempsPourUneOptimisation; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. About : ProblemeAResoudre->NombreDeContraintes += nombreDePasDeTempsPourUneOptimisation; This instruction suddenly appears. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No the estimation of variables & constraints is incorrect. There was an underestimation, which lead to segfaults. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This file contains no comment that relates a count increment to a set of constraints. But this will be for another PR. |
||
|
||
if (Pump && !TurbEntreBornes) | ||
{ | ||
ProblemeAResoudre->NombreDeContraintes += 2; /* 2 constraints bounding the overall | ||
energy generated over the period (10a in | ||
|
@@ -154,14 +154,14 @@ int OPT_DecompteDesVariablesEtDesContraintesDuProblemeAOptimiser(PROBLEME_HEBDO* | |
period (10c in the reference document) */ | ||
} | ||
|
||
if (!Pump && TurbEntreBornes && !MonitorHourlyLev) | ||
if (!Pump && TurbEntreBornes) | ||
{ | ||
ProblemeAResoudre->NombreDeContraintes++; | ||
|
||
ProblemeAResoudre->NombreDeContraintes++; | ||
} | ||
|
||
if (Pump && TurbEntreBornes && !MonitorHourlyLev) | ||
if (Pump && TurbEntreBornes) | ||
{ | ||
ProblemeAResoudre->NombreDeContraintes++; | ||
|
||
|
@@ -170,7 +170,7 @@ int OPT_DecompteDesVariablesEtDesContraintesDuProblemeAOptimiser(PROBLEME_HEBDO* | |
ProblemeAResoudre->NombreDeContraintes++; | ||
} | ||
|
||
if (!Pump && TurbEntreBornes && MonitorHourlyLev) | ||
if (!Pump && TurbEntreBornes) | ||
{ | ||
ProblemeAResoudre->NombreDeContraintes++; | ||
|
||
|
@@ -179,7 +179,7 @@ int OPT_DecompteDesVariablesEtDesContraintesDuProblemeAOptimiser(PROBLEME_HEBDO* | |
ProblemeAResoudre->NombreDeContraintes += nombreDePasDeTempsPourUneOptimisation; | ||
} | ||
|
||
if (Pump && TurbEntreBornes && MonitorHourlyLev) | ||
if (Pump && TurbEntreBornes) | ||
{ | ||
ProblemeAResoudre->NombreDeContraintes++; | ||
|
||
|
@@ -189,7 +189,7 @@ int OPT_DecompteDesVariablesEtDesContraintesDuProblemeAOptimiser(PROBLEME_HEBDO* | |
|
||
ProblemeAResoudre->NombreDeContraintes += nombreDePasDeTempsPourUneOptimisation; | ||
} | ||
if (Pump && !TurbEntreBornes && MonitorHourlyLev) | ||
if (Pump && !TurbEntreBornes) | ||
{ | ||
ProblemeAResoudre->NombreDeContraintes += 2; /* 2 constraints bounding the overall | ||
energy generated over the period (10a in | ||
|
@@ -205,12 +205,6 @@ int OPT_DecompteDesVariablesEtDesContraintesDuProblemeAOptimiser(PROBLEME_HEBDO* | |
variations (14a in the reference | ||
document) */ | ||
} | ||
if (!Pump && !TurbEntreBornes && MonitorHourlyLev) | ||
{ | ||
const std::string areaName(problemeHebdo->NomsDesPays[pays]); | ||
throw FatalError("Level explicit modeling requires flexible generation in area " | ||
+ areaName); | ||
} | ||
} | ||
|
||
// Short term storage | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -275,26 +275,19 @@ void OPT_InitialiserLesCoutsLineaire(PROBLEME_HEBDO* problemeHebdo, | |
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should update the comment that explains the cost we give to the hydro overflow |
||
*/ | ||
|
||
ProblemeAResoudre->CoutLineaire[var] = problemeHebdo->CoutDeDebordement[pays]; | ||
if (!problemeHebdo->CaracteristiquesHydrauliques[pays].AccurateWaterValue) | ||
{ | ||
ProblemeAResoudre->CoutLineaire[var] = problemeHebdo | ||
->CoutDeDefaillanceNegative[pays]; | ||
|
||
ProblemeAResoudre->CoutLineaire[var] += problemeHebdo | ||
->CaracteristiquesHydrauliques[pays] | ||
.WeeklyWaterValueStateRegular; | ||
} | ||
else | ||
{ | ||
ProblemeAResoudre->CoutLineaire[var] = problemeHebdo | ||
->CoutDeDefaillanceNegative[pays]; | ||
} | ||
} | ||
|
||
var = variableManager.HydroLevel(pays, pdtJour); | ||
if (var >= 0 && var < ProblemeAResoudre->NombreDeVariables) | ||
{ | ||
ProblemeAResoudre->CoutLineaire[var] = 0; | ||
ProblemeAResoudre->CoutLineaire[var] = problemeHebdo->CoutDeRemplissage[pays]; | ||
} | ||
|
||
var = variableManager.PositiveUnsuppliedEnergy(pays, pdtJour); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -152,6 +152,10 @@ void SIM_InitialisationProblemeHebdo(Data::Study& study, | |
|
||
problem.CoutDeDefaillanceNegative[i] = area.thermal.spilledEnergyCost; | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It seems that removing the weekly truncation involves removing the whole block : double weekGenerationTarget = 1.;
double marginGen = 1.;
if (area.hydro.reservoirManagement && area.hydro.useHeuristicTarget
&& not area.hydro.useLeeway)
{
double weekTarget_tmp = 0.;
for (uint j = 0; j < 7; ++j)
{
uint day = study.calendar.hours[PasDeTempsDebut + j * 24].dayYear;
weekTarget_tmp += hydroVentilationResults[k]
HydrauliqueModulableQuotidien[day];
}
if (weekTarget_tmp != 0.)
{
weekGenerationTarget = weekTarget_tmp;
}
marginGen = weekGenerationTarget;
} As well as the truncation coefficient There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You mean that since There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Exactly. |
||
// Hydraulic | ||
problem.CoutDeDebordement[i] = area.hydro.overflowCost; | ||
problem.CoutDeRemplissage[i] = area.hydro.levelCost; | ||
|
||
problem.DefaillanceNegativeUtiliserPMinThermique[i] = (anoOtherDispatchPower | ||
& area.nodalOptimization) | ||
!= 0; | ||
|
@@ -181,17 +185,13 @@ void SIM_InitialisationProblemeHebdo(Data::Study& study, | |
.useHeuristicTarget | ||
|| area.hydro.useLeeway); | ||
|
||
problem.CaracteristiquesHydrauliques[i].SuiviNiveauHoraire | ||
= area.hydro.reservoirManagement && (problem.OptimisationAuPasHebdomadaire) | ||
&& (!area.hydro.useHeuristicTarget | ||
|| problem.CaracteristiquesHydrauliques[i].PresenceDePompageModulable); | ||
problem.CaracteristiquesHydrauliques[i].SuiviNiveauHoraire = area.hydro.reservoirManagement; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. About SuiviNiveauHoraire : if this boolean equals reservoirManagement, let's call it reservoirManagement and avoid a parameter to be named in two different ways. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree, if we go on with this change, we'll simply remove |
||
|
||
problem.CaracteristiquesHydrauliques[i].DirectLevelAccess = false; | ||
problem.CaracteristiquesHydrauliques[i].AccurateWaterValue = false; | ||
if (problem.WaterValueAccurate && area.hydro.useWaterValue) | ||
{ | ||
problem.CaracteristiquesHydrauliques[i].AccurateWaterValue = true; | ||
problem.CaracteristiquesHydrauliques[i].SuiviNiveauHoraire = true; | ||
problem.CaracteristiquesHydrauliques[i].DirectLevelAccess = true; | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whatever the purpose of this change is (it could be so that CI completes and generates artefacts), we'll have not to forget reverting it.