diff --git a/src/solver/optimisation/opt_appel_solveur_lineaire.cpp b/src/solver/optimisation/opt_appel_solveur_lineaire.cpp index be6ad34bdd..be8b1d1843 100644 --- a/src/solver/optimisation/opt_appel_solveur_lineaire.cpp +++ b/src/solver/optimisation/opt_appel_solveur_lineaire.cpp @@ -386,11 +386,13 @@ bool OPT_AppelDuSimplexe(PROBLEME_HEBDO* problemeHebdo, void OPT_EcrireResultatFonctionObjectiveAuFormatTXT( double optimalSolutionCost, OptPeriodStringGenerator& optPeriodStringGenerator, - int optimizationNumber) + int optimizationNumber, + const std::optional optAdqPatchNumber) { Yuni::Clob buffer; auto study = Data::Study::Current::Get(); - auto filename = createCriterionFilename(optPeriodStringGenerator, optimizationNumber); + auto filename + = createCriterionFilename(optPeriodStringGenerator, optimizationNumber, optAdqPatchNumber); auto writer = study->resultWriter; logs.info() << "Solver Criterion File: `" << filename << "'"; diff --git a/src/solver/optimisation/opt_fonctions.h b/src/solver/optimisation/opt_fonctions.h index eeb5d6ed45..f94839b4ea 100644 --- a/src/solver/optimisation/opt_fonctions.h +++ b/src/solver/optimisation/opt_fonctions.h @@ -27,6 +27,8 @@ #ifndef __SOLVER_OPTIMISATION_FUNCTIONS_H__ #define __SOLVER_OPTIMISATION_FUNCTIONS_H__ +#include + #include "../config.h" #include "opt_structure_probleme_a_resoudre.h" #include "../simulation/sim_structure_donnees.h" @@ -91,7 +93,10 @@ void OPT_DecompteDesVariablesEtDesContraintesDuProblemeAOptimiser(PROBLEME_HEBDO void OPT_AugmenterLaTailleDeLaMatriceDesContraintes(PROBLEME_ANTARES_A_RESOUDRE*); void OPT_LiberationMemoireDuProblemeAOptimiser(PROBLEME_HEBDO*); -void OPT_EcrireResultatFonctionObjectiveAuFormatTXT(double, OptPeriodStringGenerator&, int); +void OPT_EcrireResultatFonctionObjectiveAuFormatTXT(double, + OptPeriodStringGenerator&, + int, + const std::optional); /*------------------------------*/ diff --git a/src/solver/optimisation/opt_optimisation_lineaire.cpp b/src/solver/optimisation/opt_optimisation_lineaire.cpp index 96e0b46014..246f077187 100644 --- a/src/solver/optimisation/opt_optimisation_lineaire.cpp +++ b/src/solver/optimisation/opt_optimisation_lineaire.cpp @@ -26,6 +26,7 @@ */ #include "../simulation/simulation.h" +#include "../simulation/adequacy_patch_runtime_data.h" #include "opt_fonctions.h" @@ -118,8 +119,12 @@ bool OPT_OptimisationLineaire(PROBLEME_HEBDO* problemeHebdo, uint numSpace) { double optimalSolutionCost = OPT_ObjectiveFunctionResult(problemeHebdo, NumeroDeLIntervalle, optimizationNumber); - OPT_EcrireResultatFonctionObjectiveAuFormatTXT( - optimalSolutionCost, *optPeriodStringGenerator, optimizationNumber); + auto adqPatchOptNumber + = getAdqPatchOptmizationNumber(problemeHebdo->adequacyPatchRuntimeData.get()); + OPT_EcrireResultatFonctionObjectiveAuFormatTXT(optimalSolutionCost, + *optPeriodStringGenerator, + optimizationNumber, + adqPatchOptNumber); } }