T
- type of variable for which the solution is being stored.public interface SolutionListener<T extends Var>
Modifier and Type | Method and Description |
---|---|
boolean |
assignSolution(Store store,
int no)
It imposes the constraints, so the last found solution is enforced.
|
boolean |
executeAfterSolution(Search<T> search,
SelectChoicePoint<T> select)
It is executed by search after a solution is found.
|
int |
findSolutionMatchingParent(int parentSolutionNo)
For a given master solution finds any solution within that listener which
matches the master solution.
|
int |
getParentSolution(int childSolutionNo) |
Domain[] |
getSolution(int no)
It returns the solution number no.
|
Domain[][] |
getSolutions()
It returns all solutions.
|
T[] |
getVariables()
It returns the variables in the same order as the one used to encode
solutions.
|
boolean |
isRecordingSolutions()
It specifies if the solution listener is recording solutions or not.
|
void |
printAllSolutions()
It prints all the solutions.
|
void |
recordSolutions(boolean status)
It records each solution so it can be later retrieved and used.
|
PrimitiveConstraint[] |
returnSolution()
It returns a collection of constraints which represent the last found
solution.
|
void |
searchAll(boolean status)
It will enforce the solution listener to instruct search to keep looking
for a solution making the search explore the whole search space.
|
void |
setChildrenListeners(SolutionListener<T> child)
It sets the child listener for this solution listener.
|
void |
setChildrenListeners(SolutionListener<T>[] children)
It sets the children listeners for this solution listener.
|
void |
setParentSolutionListener(SolutionListener<? extends Var> parent)
It allows to inform sub-search of what is the current number of the
solution in master search.
|
void |
setSolutionLimit(int limit)
It sets the solution limit.
|
boolean |
solutionLimitReached()
It checks if the sufficient number of solutions was found.
|
int |
solutionsNo()
It returns number of solutions found while using this choice point
selector.
|
String |
toString()
It returns the string representation of the last solution.
|
boolean executeAfterSolution(Search<T> search, SelectChoicePoint<T> select)
search
- the search which have found a solution.select
- the select choice point heuristicboolean assignSolution(Store store, int no)
store
- store in which the solution is enforced.no
- the number of the solution to be enforced.String toString()
T[] getVariables()
Domain[][] getSolutions()
PrimitiveConstraint[] returnSolution()
Domain[] getSolution(int no)
no
- it obtains the solution with a given index.int solutionsNo()
void searchAll(boolean status)
status
- true if we are interested in search for all solutions, false otherwise.void recordSolutions(boolean status)
status
- true if we are interested in recording all solutions, false otherwise.void setParentSolutionListener(SolutionListener<? extends Var> parent)
parent
- solution listener used by a master search.int findSolutionMatchingParent(int parentSolutionNo)
parentSolutionNo
- solution number of the parent for which we search matching solution.int getParentSolution(int childSolutionNo)
void setChildrenListeners(SolutionListener<T>[] children)
children
- an array containing children listeners.void setChildrenListeners(SolutionListener<T> child)
child
- the child listener.boolean isRecordingSolutions()
boolean solutionLimitReached()
void setSolutionLimit(int limit)
limit
- the maximal number of solutions we are interested in.void printAllSolutions()
Copyright © 2022. All rights reserved.