Interface SolutionManager<Solution_,Score_ extends Score<Score_>>
-
- Type Parameters:
Solution_- the solution type, the class with thePlanningSolutionannotationScore_- the actual score type
- All Known Implementing Classes:
DefaultSolutionManager
public interface SolutionManager<Solution_,Score_ extends Score<Score_>>A stateless service to help calculateScore,ConstraintMatchTotal,Indictment, etc.To create a
SolutionManagerinstance, usecreate(SolverFactory).These methods are thread-safe unless explicitly stated otherwise.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description static <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_>explain(Solution_ solution)As defined byexplain(Object), usingSolutionUpdatePolicy.UPDATE_ALL.ScoreExplanation<Solution_,Score_>explain(Solution_ solution, SolutionUpdatePolicy solutionUpdatePolicy)Calculates and retrievesConstraintMatchTotals andIndictments necessary for describing the quality of a particular solution.default Score_update(Solution_ solution)As defined byupdate(Object, SolutionUpdatePolicy), usingSolutionUpdatePolicy.UPDATE_ALL.Score_update(Solution_ solution, SolutionUpdatePolicy solutionUpdatePolicy)Updates the given solution according to theSolutionUpdatePolicy.
-
-
-
Method Detail
-
create
static <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 thePlanningSolutionannotationScore_- the actual score type- Parameters:
solverFactory- never null- Returns:
- never null
-
create
static <Solution_,Score_ extends Score<Score_>,ProblemId_> SolutionManager<Solution_,Score_> create(SolverManager<Solution_,ProblemId_> solverManager)
Uses aSolverManagerto build aSolutionManager.- Type Parameters:
Solution_- the solution type, the class with thePlanningSolutionannotationScore_- the actual score typeProblemId_- the ID type of a submitted problem, such asLongorUUID- Parameters:
solverManager- never null- Returns:
- never null
-
update
default Score_ update(Solution_ solution)
As defined byupdate(Object, SolutionUpdatePolicy), usingSolutionUpdatePolicy.UPDATE_ALL.
-
update
Score_ update(Solution_ solution, SolutionUpdatePolicy solutionUpdatePolicy)
Updates the given solution according to theSolutionUpdatePolicy.- Parameters:
solution- never nullsolutionUpdatePolicy- never null; if unsure, pickSolutionUpdatePolicy.UPDATE_ALL- Returns:
- possibly null if already null and
SolutionUpdatePolicydidn't cause its update - See Also:
Description of individual policies with respect to performance trade-offs.
-
explain
default ScoreExplanation<Solution_,Score_> explain(Solution_ solution)
As defined byexplain(Object), usingSolutionUpdatePolicy.UPDATE_ALL.
-
explain
ScoreExplanation<Solution_,Score_> explain(Solution_ solution, SolutionUpdatePolicy solutionUpdatePolicy)
Calculates and retrievesConstraintMatchTotals andIndictments necessary for describing the quality of a particular solution.- Parameters:
solution- never nullsolutionUpdatePolicy- never null; if unsure, pickSolutionUpdatePolicy.UPDATE_ALL- Returns:
- never null
- Throws:
IllegalStateException- when constraint matching is disabled or not supported by the underlying score calculator, such asEasyScoreCalculator.- See Also:
Description of individual policies with respect to performance trade-offs.
-
-