Show Table of Contents
18.4. Solver Configuration
In Solver and BestSolutionChangedEvent, the method
getTimeMillisSpend() has been renamed to getTimeMillisSpent().
Previously in *.java:
... = solver.getTimeMillisSpend();
Now in *.java:
... = solver.getTimeMillisSpent();
Previously in *.java:
public void bestSolutionChanged(BestSolutionChangedEvent event) {
... = event.getTimeMillisSpend();
}
Now in *.java:
public void bestSolutionChanged(BestSolutionChangedEvent event) {
... = event.getTimeMillisSpent();
}
The solver phase
<bruteForce> has been replaced by <exhaustiveSearch>'s BRUTE_FORCE type.
Previously in
*SolverConfig.xml and *BenchmarkConfig.xml:
<bruteForce/>
Now in
*SolverConfig.xml and *BenchmarkConfig.xml:
<exhaustiveSearch>
<exhaustiveSearchType>BRUTE_FORCE</exhaustiveSearchType>
</exhaustiveSearch>
The methods
setPlanningProblem(Solution) and solve() have been merged as the method solve(Solution).
Previously in *.java:
solver.setPlanningProblem(planningProblem); solver.solve();
Now in *.java:
solver.solve(planningProblem);
Note
You still need to use
solver.getBestSolution() to retrieve the best solution. That is intentional due to real-time planning and to support pare to optimization in the future.
The class
XmlSolverFactory (which was not part of the public API) has been removed and replaced by static methods on SolverFactory (which are part of the public API).
Previously in *.java:
SolverFactory solverFactory = new XmlSolverFactory("...solverConfig.xml");
Now in *.java:
SolverFactory solverFactory = SolverFactory.createFromXmlResource("...solverConfig.xml");
Previously in *.java:
SolverFactory solverFactory = new XmlSolverFactory().configure(inputStream);
Now in *.java:
SolverFactory solverFactory = SolverFactory.createFromXmlInputStream(inputStream);
Previously in *.java:
SolverFactory solverFactory = new XmlSolverFactory().configure(reader);
Now in *.java:
SolverFactory solverFactory = SolverFactory.createFromXmlReader(reader);
Note
If you used the method
addXstreamAnnotations(), take a look at the non-public API class XStreamXmlSolverFactory.
The following changes have been made to the Custom SolverPhase:
- The interface
CustomSolverPhaseCommandhas been renamed toCustomPhaseCommand. - The element
<customSolverPhase>has been renamed to<customPhase>. - The element
<customSolverPhaseCommandClass>has been renamed to>customPhaseCommandClass>.
Previously in *.java:
public class ToOriginalMachineSolutionInitializer implements CustomSolverPhaseCommand {
...
}
Now in *.java:
public class ToOriginalMachineSolutionInitializer implements CustomPhaseCommand {
...
}
Previously in
*SolverConfig.xml and *BenchmarkConfig.xml:
<customSolverPhase> <customSolverPhaseCommandClass>...ToOriginalMachineSolutionInitializer</customSolverPhaseCommandClass> </customSolverPhase>
Now in
*SolverConfig.xml and *BenchmarkConfig.xml:
<customPhase> <customPhaseCommandClass>....ToOriginalMachineSolutionInitializer</customPhaseCommandClass> </customPhase>
The method
ScoreDefinition.getLevelCount() has been renamed to ScoreDefinition.getLevelsSize().

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.