Skip to content
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

Output the delta in number of active groups by cluster #2490

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/libs/antares/study/include/antares/study/parameters.h
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,12 @@ class Parameters final
bool storeTimeseriesNumbers;
//@}

//! \name Delta Cluster
//@{
//! Output the delta of groups inside clusters for each hour of each mode
bool exportRawOptimizationResults;
//@}

/*!
** \brief Read-only mode
**
Expand Down
1 change: 1 addition & 0 deletions src/libs/antares/study/load.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ void Study::parameterFiller(const StudyLoadOptions& options)
parameters.timeSeriesToArchive = 0;
parameters.storeTimeseriesNumbers = false;
parameters.synthesis = false;
parameters.exportRawOptimizationResults = false;
}

if (options.loadOnlyNeeded && !parameters.timeSeriesToGenerate)
Expand Down
6 changes: 6 additions & 0 deletions src/libs/antares/study/parameters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,8 @@ void Parameters::reset()
// readonly
readonly = false;
synthesis = true;
// Outputing the delta of the number of groups that are on inside each clusters
exportRawOptimizationResults = false;

// Hydro heuristic policy
hydroHeuristicPolicy.hhPolicy = hhpAccommodateRuleCurves;
Expand Down Expand Up @@ -623,6 +625,10 @@ static bool SGDIntLoadFamily_Output(Parameters& d,
{
return value.to<bool>(d.synthesis);
}
if (key == "export-raw-optimization-results")
{
return value.to<bool>(d.exportRawOptimizationResults);
}
if (key == "hydro-debug")
{
return value.to<bool>(d.hydroDebug);
Expand Down
1 change: 1 addition & 0 deletions src/solver/optimisation/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ set(RTESOLVER_OPT
opt_appel_solveur_quadratique.cpp
opt_gestion_second_membre_cas_lineaire.cpp
opt_optimisation_lineaire.cpp
opt_export_raw_optimization_results.cpp
opt_chainage_intercos.cpp
include/antares/solver/optimisation/opt_fonctions.h
opt_pilotage_optimisation_lineaire.cpp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,5 +114,5 @@ void OPT_DecompteDesVariablesEtDesContraintesCoutsDeDemarrage(PROBLEME_HEBDO*);
void OPT_InitialiserNombreMinEtMaxDeGroupesCoutsDeDemarrage(PROBLEME_HEBDO*);
void OPT_AjusterLeNombreMinDeGroupesDemarresCoutsDeDemarrage(PROBLEME_HEBDO*);
double OPT_SommeDesPminThermiques(const PROBLEME_HEBDO*, int, uint);

void OPT_ExportRawOptimizationResults(PROBLEME_HEBDO*, Solver::IResultWriter&, std::string);
#endif /* __SOLVER_OPTIMISATION_FUNCTIONS_H__ */
657 changes: 657 additions & 0 deletions src/solver/optimisation/opt_export_raw_optimization_results.cpp

Large diffs are not rendered by default.

15 changes: 9 additions & 6 deletions src/solver/optimisation/opt_optimisation_lineaire.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,19 +224,22 @@ bool OPT_OptimisationLineaire(const OptimizationOptions& options,
writer,
PREMIERE_OPTIMISATION,
simulationObserver);

std::string filename = "beforeHeuristic";
OPT_ExportRawOptimizationResults(problemeHebdo, writer, filename);
// We only need the 2nd optimization when NOT solving with integer variables
// We also skip the 2nd optimization in the hidden 'Expansion' mode
// and if the 1st one failed.
if (ret && !problemeHebdo->Expansion && !problemeHebdo->OptimisationAvecVariablesEntieres)
{
// We need to adjust some stuff before running the 2nd optimisation
runThermalHeuristic(problemeHebdo);
return runWeeklyOptimization(options,
problemeHebdo,
writer,
DEUXIEME_OPTIMISATION,
simulationObserver);
ret = runWeeklyOptimization(options,
problemeHebdo,
writer,
DEUXIEME_OPTIMISATION,
simulationObserver);
filename = "afterHeuristic";
OPT_ExportRawOptimizationResults(problemeHebdo, writer, filename);
}
return ret;
}
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,7 @@ struct PROBLEME_HEBDO
bool exportMPSOnError = false;
bool ExportStructure = false;
bool NamedProblems = false;
bool exportRawOptimizationResults = false;

uint32_t HeureDansLAnnee = 0;
bool LeProblemeADejaEteInstancie = false;
Expand Down
1 change: 1 addition & 0 deletions src/solver/simulation/sim_calcul_economique.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -975,4 +975,5 @@ void SIM_RenseignementProblemeHebdo(const Study& study,
problem.CaracteristiquesHydrauliques[k].ContrainteDePmaxHydrauliqueHoraireRef
= problem.CaracteristiquesHydrauliques[k].ContrainteDePmaxHydrauliqueHoraire;
}
problem.exportRawOptimizationResults = parameters.exportRawOptimizationResults;
}
Loading