Skip to content

Commit

Permalink
BUG: Correct stop condition description
Browse files Browse the repository at this point in the history
When OnePlusOneEvolutionaryOptimizerv4::StopOptimization was manually
called the stop description incorrectly indicated that the maximum
number of iterations had been reached. Only over write stop condition
descriptions, when the maximum number of iterations have been
exceeded.
  • Loading branch information
blowekamp committed Jun 15, 2021
1 parent 0ad6ef1 commit 362dd4c
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -265,9 +265,12 @@ OnePlusOneEvolutionaryOptimizerv4<TInternalComputationValueType>::StartOptimizat
this->InvokeEvent(IterationEvent());
itkDebugMacro(<< "Current position: " << this->GetCurrentPosition());
}
m_StopConditionDescription.str("");
m_StopConditionDescription << this->GetNameOfClass() << ": ";
m_StopConditionDescription << "Maximum number of iterations (" << m_MaximumIteration << ") exceeded. ";
if (this->m_CurrentIteration >= m_MaximumIteration)
{
m_StopConditionDescription.str("");
m_StopConditionDescription << this->GetNameOfClass() << ": ";
m_StopConditionDescription << "Maximum number of iterations (" << m_MaximumIteration << ") exceeded. ";
}
this->InvokeEvent(EndEvent());
}

Expand Down

0 comments on commit 362dd4c

Please sign in to comment.