Package org.optaplanner.core.api.solver
Interface SolutionManager<Solution_,Score_ extends Score<Score_>> 
- Type Parameters:
- Solution_- the solution type, the class with the- PlanningSolutionannotation
- Score_- the actual score type
- All Known Implementing Classes:
- DefaultSolutionManager
public interface SolutionManager<Solution_,Score_ extends Score<Score_>> 
A stateless service to help calculate 
Score, ConstraintMatchTotal,
 Indictment, etc.
 
 To create a SolutionManager instance, use create(SolverFactory).
 
These methods are thread-safe unless explicitly stated otherwise.
- 
Method SummaryModifier and TypeMethodDescriptionstatic <Solution_,Score_ extends Score<Score_>> 
 SolutionManager<Solution_,Score_> create(SolverFactory<Solution_> solverFactory) Uses aSolverFactoryto build aSolutionManager.static <Solution_,Score_ extends Score<Score_>, ProblemId_> 
 SolutionManager<Solution_,Score_> create(SolverManager<Solution_, ProblemId_> solverManager) Uses aSolverManagerto build aSolutionManager.default ScoreExplanation<Solution_,Score_> As defined byexplain(Object), usingSolutionUpdatePolicy.UPDATE_ALL.explain(Solution_ solution, SolutionUpdatePolicy solutionUpdatePolicy) Calculates and retrievesConstraintMatchTotals andIndictments necessary for describing the quality of a particular solution.default Score_As defined byupdate(Object, SolutionUpdatePolicy), usingSolutionUpdatePolicy.UPDATE_ALL.update(Solution_ solution, SolutionUpdatePolicy solutionUpdatePolicy) Updates the given solution according to theSolutionUpdatePolicy.
- 
Method Details- 
createstatic <Solution_,Score_ extends Score<Score_>> SolutionManager<Solution_,Score_> create(SolverFactory<Solution_> solverFactory) Uses aSolverFactoryto build aSolutionManager.- Type Parameters:
- Solution_- the solution type, the class with the- PlanningSolutionannotation
- Score_- the actual score type
- Parameters:
- solverFactory- never null
- Returns:
- never null
 
- 
createstatic <Solution_,Score_ extends Score<Score_>, SolutionManager<Solution_,ProblemId_> Score_> create(SolverManager<Solution_, ProblemId_> solverManager) Uses aSolverManagerto build aSolutionManager.- Type Parameters:
- Solution_- the solution type, the class with the- PlanningSolutionannotation
- Score_- the actual score type
- ProblemId_- the ID type of a submitted problem, such as- Longor- UUID
- Parameters:
- solverManager- never null
- Returns:
- never null
 
- 
updateAs defined byupdate(Object, SolutionUpdatePolicy), usingSolutionUpdatePolicy.UPDATE_ALL.
- 
updateUpdates the given solution according to theSolutionUpdatePolicy.- Parameters:
- solution- never null
- solutionUpdatePolicy- never null; if unsure, pick- SolutionUpdatePolicy.UPDATE_ALL
- Returns:
- possibly null if already null and SolutionUpdatePolicydidn't cause its update
- See Also:
 
- 
explainAs defined byexplain(Object), usingSolutionUpdatePolicy.UPDATE_ALL.
- 
explainScoreExplanation<Solution_,Score_> explain(Solution_ solution, SolutionUpdatePolicy solutionUpdatePolicy) Calculates and retrievesConstraintMatchTotals andIndictments necessary for describing the quality of a particular solution.- Parameters:
- solution- never null
- solutionUpdatePolicy- never null; if unsure, pick- SolutionUpdatePolicy.UPDATE_ALL
- Returns:
- never null
- Throws:
- IllegalStateException- when constraint matching is disabled or not supported by the underlying score calculator, such as- EasyScoreCalculator.
- See Also:
 
 
-