Skip to content

Commit

Permalink
Add overflow cost
Browse files Browse the repository at this point in the history
  • Loading branch information
flomnes committed Sep 11, 2024
1 parent ac97a13 commit 862c092
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,8 @@ class PartHydro

std::vector<std::optional<double>> deltaBetweenFinalAndInitialLevels;

double overflowCost = 0.;

private:
static bool checkReservoirLevels(const Study& study);
static bool checkProperties(Study& study);
Expand Down
16 changes: 15 additions & 1 deletion src/libs/antares/study/parts/hydro/container.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ void PartHydro::reset()
allocation.clear();
// allocation.fromArea(<current area>, 1.); // Area::reset()

overflowCost = 0.;

if (prepro)
{
prepro->reset();
Expand Down Expand Up @@ -330,6 +332,12 @@ bool PartHydro::LoadFromFolder(Study& study, const AnyString& folder)
&& ret;
}

if (IniFile::Section* section = ini.find("overflow cost"))
{
ret = loadProperties(study, section->firstProperty, buffer, &PartHydro::overflowCost)
&& ret;
}

return ret;
}

Expand Down Expand Up @@ -500,6 +508,7 @@ bool PartHydro::SaveToFolder(const AreaList& areas, const AnyString& folder)
IniFile::Section* sLeewayLow;
IniFile::Section* sLeewayUp;
IniFile::Section* spumpingEfficiency;
IniFile::Section* sOverflowCost;

AllSections(IniFile& ini):
s(ini.addSection("inter-daily-breakdown")),
Expand All @@ -516,7 +525,8 @@ bool PartHydro::SaveToFolder(const AreaList& areas, const AnyString& folder)
sPowerToLevel(ini.addSection("power to level")),
sLeewayLow(ini.addSection("leeway low")),
sLeewayUp(ini.addSection("leeway up")),
spumpingEfficiency(ini.addSection("pumping efficiency"))
spumpingEfficiency(ini.addSection("pumping efficiency")),
sOverflowCost(ini.addSection("overflow cost"))
{
}
};
Expand Down Expand Up @@ -572,6 +582,10 @@ bool PartHydro::SaveToFolder(const AreaList& areas, const AnyString& folder)
{
allSections.sPowerToLevel->add(area.id, true);
}
if (area.hydro.overflowCost)
{
allSections.sOverflowCost->add(area.id, area.hydro.overflowCost);
}

// max hours gen
buffer.clear() << folder << SEP << "common" << SEP << "capacity" << SEP
Expand Down
11 changes: 1 addition & 10 deletions src/solver/optimisation/opt_gestion_des_couts_cas_lineaire.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -275,22 +275,13 @@ void OPT_InitialiserLesCoutsLineaire(PROBLEME_HEBDO* problemeHebdo,
*/

ProblemeAResoudre->CoutLineaire[var] = problemeHebdo->CoutDeDebordement[pays];
if (!problemeHebdo->CaracteristiquesHydrauliques[pays].AccurateWaterValue)
{
ProblemeAResoudre->CoutLineaire[var] = abs(problemeHebdo
->CoutDeDefaillanceNegative[pays])
* 1.10;

ProblemeAResoudre->CoutLineaire[var] += problemeHebdo
->CaracteristiquesHydrauliques[pays]
.WeeklyWaterValueStateRegular;
}
else
{
ProblemeAResoudre->CoutLineaire[var] = abs(problemeHebdo
->CoutDeDefaillanceNegative[pays])
* 1.10;
}
}

var = variableManager.HydroLevel(pays, pdtJour);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,8 @@ struct PROBLEME_HEBDO
std::vector<double> CoutDeDefaillanceNegative;
std::vector<double> CoutDeDefaillanceEnReserve;

std::vector<double> CoutDeDebordement;

std::vector<PALIERS_THERMIQUES> PaliersThermiquesDuPays;
std::vector<ENERGIES_ET_PUISSANCES_HYDRAULIQUES> CaracteristiquesHydrauliques;

Expand Down
2 changes: 2 additions & 0 deletions src/solver/simulation/sim_alloc_probleme_hebdo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ void SIM_AllocationProblemeDonneesGenerales(PROBLEME_HEBDO& problem,
problem.CoutDeDefaillanceNegative.assign(nbPays, 0);
problem.CoutDeDefaillanceEnReserve.assign(nbPays, 0);

problem.CoutDeDebordement.assign(nbPays, 0);

problem.NumeroDeContrainteEnergieHydraulique.assign(nbPays, 0);
problem.NumeroDeContrainteMinEnergieHydraulique.assign(nbPays, 0);
problem.NumeroDeContrainteMaxEnergieHydraulique.assign(nbPays, 0);
Expand Down
2 changes: 2 additions & 0 deletions src/solver/simulation/sim_calcul_economique.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@ void SIM_InitialisationProblemeHebdo(Data::Study& study,

problem.CoutDeDefaillanceNegative[i] = area.thermal.spilledEnergyCost;

problem.CoutDeDebordement[i] = area.hydro.overflowCost;

problem.CoutDeDefaillanceEnReserve[i] = area.thermal.unsuppliedEnergyCost;

problem.DefaillanceNegativeUtiliserPMinThermique[i] = (anoOtherDispatchPower
Expand Down

0 comments on commit 862c092

Please sign in to comment.