Skip to content

Commit

Permalink
Apply identical fix for criterion file
Browse files Browse the repository at this point in the history
  • Loading branch information
flomnes committed Feb 23, 2023
1 parent 4fd89d1 commit 66e4f0e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
6 changes: 4 additions & 2 deletions src/solver/optimisation/opt_appel_solveur_lineaire.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -386,11 +386,13 @@ bool OPT_AppelDuSimplexe(PROBLEME_HEBDO* problemeHebdo,
void OPT_EcrireResultatFonctionObjectiveAuFormatTXT(
double optimalSolutionCost,
OptPeriodStringGenerator& optPeriodStringGenerator,
int optimizationNumber)
int optimizationNumber,
const std::optional<unsigned int> 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 << "'";
Expand Down
7 changes: 6 additions & 1 deletion src/solver/optimisation/opt_fonctions.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
#ifndef __SOLVER_OPTIMISATION_FUNCTIONS_H__
#define __SOLVER_OPTIMISATION_FUNCTIONS_H__

#include <optional>

#include "../config.h"
#include "opt_structure_probleme_a_resoudre.h"
#include "../simulation/sim_structure_donnees.h"
Expand Down Expand Up @@ -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<unsigned int>);

/*------------------------------*/

Expand Down
9 changes: 7 additions & 2 deletions src/solver/optimisation/opt_optimisation_lineaire.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
*/

#include "../simulation/simulation.h"
#include "../simulation/adequacy_patch_runtime_data.h"

#include "opt_fonctions.h"

Expand Down Expand Up @@ -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);
}
}

Expand Down

0 comments on commit 66e4f0e

Please sign in to comment.