Interface SolutionManager
- All Known Implementing Classes:
SimpleSolutionManager
public interface SolutionManager
A solution manager manages the solutions of the backtrack, keeping them by level.
This make it sure that we can go back in the backtrack and have a current solution retrieved.
-
Method Summary
Modifier and TypeMethodDescriptionvoidadd(int level, Iterator<Substitution> results) Adds the given results at the given level.Returns the current solution tracked by this manager.booleannext(int level) Update the current solution to use the next correct solution by using the next substitution at the given level.
-
Method Details
-
getCurrentSolution
Substitution getCurrentSolution()Returns the current solution tracked by this manager.- Returns:
- the current solution.
-
next
boolean next(int level) Update the current solution to use the next correct solution by using the next substitution at the given level.- Parameters:
level- the current level- Returns:
- true iff there is effectively a next solution for the given level.
-
add
Adds the given results at the given level. The new ones must override old results already stored at that level. The current solution must be updated accordingly when overriding the old results.- Parameters:
level- the current levelresults- the results to store
-