Skip to content

Commit

Permalink
Update statistics print
Browse files Browse the repository at this point in the history
  • Loading branch information
andreaslundell committed Jan 3, 2025
1 parent d138bb0 commit ba88f92
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
7 changes: 6 additions & 1 deletion src/Report.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ void Report::outputIterationDetail(int iterationNumber, std::string iterationDes

if(lineType == E_IterationLineType::DualRepair)
{
combDualCuts = fmt::format("Repairs: {:<4d}", dualCutsAdded);
combDualCuts = fmt::format("Relaxed constraints: {:<4d}", dualCutsAdded);
}
else if(lineType == E_IterationLineType::DualReductionCut)
{
Expand Down Expand Up @@ -154,6 +154,11 @@ void Report::outputIterationDetail(int iterationNumber, std::string iterationDes
env->output->outputInfo(fmt::format("{:>6d}: {:<10s}{:^10.2f}{:^13s}{:>27s}{:>19s}{:<32s}", iterationNumber,
iterationDesc, totalTime, combDualCuts, "", "", ""));
env->output->outputDebug("");

env->output->outputInfo(fmt::format("{} {} {} / {}", std::string(27, ' '),
"Total primal improvements after repair / reduction cut: ",
env->solutionStatistics.numberOfPrimalImprovementsAfterInfeasibilityRepair,
env->solutionStatistics.numberOfPrimalImprovementsAfterReductionCut));
}
else
{
Expand Down
8 changes: 1 addition & 7 deletions src/Tasks/TaskAddPrimalReductionCut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ void TaskAddPrimalReductionCut::run()

cutOffToUse = (1 - factor) * currentLowerBoundForReductionCut + factor * env->results->currentPrimalBound;

env->output->outputInfo(fmt::format(
env->output->outputDebug(fmt::format(
" {} {}", "Cut off difference:", std::abs(currentLowerBoundForReductionCut - cutOffToUse)));

if(std::abs(currentLowerBoundForReductionCut - cutOffToUse) < 1e-6)
Expand All @@ -139,12 +139,6 @@ void TaskAddPrimalReductionCut::run()

env->dualSolver->cutOffToUse = cutOffToUse;

env->output->outputInfo(fmt::format(" {} {}", "Cut off used:", cutOffToUse));
env->output->outputInfo(fmt::format(" {} {}", "Primal improvements after repair:",
env->solutionStatistics.numberOfPrimalImprovementsAfterInfeasibilityRepair));
env->output->outputInfo(fmt::format(" {} {}", "Primal improvements after reduction cut:",
env->solutionStatistics.numberOfPrimalImprovementsAfterReductionCut));

if(env->reformulatedProblem->objectiveFunction->properties.isMinimize)
{
env->results->currentDualBound = SHOT_DBL_MIN;
Expand Down

0 comments on commit ba88f92

Please sign in to comment.