Package org.jacop.search
Class PrintOutListener<T extends Var>
- java.lang.Object
-
- org.jacop.search.SimpleSolutionListener<T>
-
- org.jacop.search.PrintOutListener<T>
-
- All Implemented Interfaces:
SolutionListener<T>
public class PrintOutListener<T extends Var> extends SimpleSolutionListener<T> implements SolutionListener<T>
It is a simple example how it is possible to extend existing listeners to add your own functionality.- Version:
- 4.8
-
-
Field Summary
-
Fields inherited from class org.jacop.search.SimpleSolutionListener
alwaysUpdateToMostRecentSolution, childrenSolutionListeners, noSolutions, parentSolutionListener, parentSolutionNo, recordSolutions, solutionLimit, solutions, vars
-
-
Constructor Summary
Constructors Constructor Description PrintOutListener()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
executeAfterSolution(Search<T> search, SelectChoicePoint<T> select)
It is executed right after consistency of the current search node.-
Methods inherited from class org.jacop.search.SimpleSolutionListener
assignSolution, assignSolution, findSolutionMatchingParent, getParentSolution, getSolution, getSolutions, getVariables, isRecordingSolutions, printAllSolutions, recordSolution, recordSolutions, returnSolution, returnSolution, searchAll, setChildrenListeners, setChildrenListeners, setParentSolutionListener, setSolutionLimit, setSolutionsNo, setVariables, solutionLimitReached, solutionsNo, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.jacop.search.SolutionListener
assignSolution, findSolutionMatchingParent, getParentSolution, getSolution, getSolutions, getVariables, isRecordingSolutions, printAllSolutions, recordSolutions, returnSolution, searchAll, setChildrenListeners, setChildrenListeners, setParentSolutionListener, setSolutionLimit, solutionLimitReached, solutionsNo, toString
-
-
-
-
Method Detail
-
executeAfterSolution
public boolean executeAfterSolution(Search<T> search, SelectChoicePoint<T> select)
It is executed right after consistency of the current search node. The return code specifies if the search should continue or exit.- Specified by:
executeAfterSolution
in interfaceSolutionListener<T extends Var>
- Overrides:
executeAfterSolution
in classSimpleSolutionListener<T extends Var>
- Parameters:
search
- the search which have found a solution.select
- the select choice point heuristic- Returns:
- false forces the search to keep looking for a solution, true then the search will accept a solution.
-
-