19.5. Optimization

19.5.1. Termination

All child elements of <termination> have been renamed:

  • The element <maximumTimeMillisSpend> has been renamed to <millisecondsSpentLimit>
  • The element <maximumSecondsSpend> has been renamed to <secondsSpentLimit>
  • The element <maximumMinutesSpend> has been renamed to <minutesSpentLimit>
  • The element <maximumHoursSpend> has been renamed to <hoursSpentLimit>
  • The element <scoreAttained> has been renamed to <bestScoreLimit>
  • The element <maximumStepCount> has been renamed to <stepCountLimit>
  • The element <maximumUnimprovedStepCount> has been renamed to <unimprovedStepCountLimit>

Configuration in *SolverConfig.xml and *BenchmarkConfig.xml has changed from:

<termination>
  <maximumTimeMillisSpend>...</maximumTimeMillisSpend>
  <maximumSecondsSpend>...</maximumSecondsSpend>
  <maximumMinutesSpend>...</maximumMinutesSpend>
  <maximumHoursSpend>...</maximumHoursSpend>
  <scoreAttained>...</scoreAttained>
  <maximumStepCount>...</maximumStepCount>
  <maximumUnimprovedStepCount>...</maximumUnimprovedStepCount>
</termination>

to:

<termination>
  <millisecondsSpentLimit>...</millisecondsSpentLimit>
  <secondsSpentLimit>...</secondsSpentLimit>
  <minutesSpentLimit>...</minutesSpentLimit>
  <hoursSpentLimit>...</hoursSpentLimit>
  <bestScoreLimit>...</bestScoreLimit>
  <stepCountLimit>...</stepCountLimit>
  <unimprovedStepCountLimit>...</unimprovedStepCountLimit>
</termination>

19.5.2. Events

Classes BestSolutionChangedEvent and SolverEventListener moved from package impl.event to api.solver.event. They are now part of the public api.

Previously in *.java :

import org.optaplanner.core.impl.event.BestSolutionChangedEvent;
import org.optaplanner.core.impl.event.SolverEventListener;

Now in *.java :

import org.optaplanner.core.api.solver.event.BestSolutionChangedEvent;
import org.optaplanner.core.api.solver.event.SolverEventListener;

19.5.4. Score Calculator

The interface SimpleScoreCalculator has been renamed to EasyScoreCalculator to avoid confusion with SimpleScore and SimpleScore: it can return other Score types. The package name has also changed.

Previously in *.java :

import org.optaplanner.core.impl.score.director.simple.SimpleScoreCalculator;

public class CloudBalancingEasyScoreCalculator implements SimpleScoreCalculator<CloudBalance> {
    ...
}

Now in *.java :

import org.optaplanner.core.impl.score.director.easy.EasyScoreCalculator;

public class CloudBalancingEasyScoreCalculator implements EasyScoreCalculator<CloudBalance> {
    ...
}

Previously in *SolverConfig.xml and *BenchmarkConfig.xml :

<simpleScoreCalculatorClass>org.optaplanner.examples.cloudbalancing.solver.score.CloudBalancingEasyScoreCalculator<simpleScoreCalculatorClass>

Now in *SolverConfig.xml and *BenchmarkConfig.xml :

<easyScoreCalculatorClass>org.optaplanner.examples.cloudbalancing.solver.score.CloudBalancingEasyScoreCalculator

The BendableScore configuration has changed: …​LevelCount has been renamed to …​LevelsSize.

Previously in *SolverConfig.xml and *BenchmarkConfig.xml :

<scoreDirectorFactory>
  <scoreDefinitionType>BENDABLE</scoreDefinitionType>
  <bendableHardLevelCount>2</bendableHardLevelCount>
  <bendableSoftLevelCount>3</bendableSoftLevelCount>
  ...
</scoreDirectorFactory>

Now in *SolverConfig.xml and *BenchmarkConfig.xml :

<scoreDirectorFactory>
  <scoreDefinitionType>BENDABLE</scoreDefinitionType>
  <bendableHardLevelsSize>2</bendableHardLevelsSize>
  <bendableSoftLevelsSize>3</bendableSoftLevelsSize>
  ...
</scoreDirectorFactory>