Package org.jacop.search
Class NoGoodsCollector<T extends IntVar>
java.lang.Object
org.jacop.search.NoGoodsCollector<T>
- All Implemented Interfaces:
ExitChildListener<T>,ExitListener,TimeOutListener
public class NoGoodsCollector<T extends IntVar>
extends Object
implements ExitChildListener<T>, TimeOutListener, ExitListener
NoGoodCollector collects no-goods from search when timeout has occurred. As
time-out is executed the search will exit from deeper search levels and
no-goods collector will collect neccessary information to create no-goods
when finally exiting the search. The no-goods will be immmediately imposed
when collector is informed about exiting the search.
- Version:
- 4.10
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) ExitChildListener<T>[](package private) ExitListener[]booleanIt specifies if the timeout has occurred and search is being terminated.(package private) TimeOutListener[] -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidexecutedAtExit(Store store, int solutionsNo) It is executed right after time out is determined.voidexecutedAtTimeOut(int noSolutions) It is executed right after time out is determined.booleanleftChild(PrimitiveConstraint choice, boolean status) It is executed after exiting the left child.booleanIt is executed after exiting left child.voidrightChild(PrimitiveConstraint choice, boolean status) It is executed after exiting the right child.voidrightChild(T var, int value, boolean status) It is executed after exiting the right child.voidsetChildrenListeners(ExitChildListener<T> child) It adds one child listener.voidsetChildrenListeners(ExitChildListener<T>[] children) It sets the children listeners for the current listener.voidsetChildrenListeners(ExitListener child) It sets one child listener.voidsetChildrenListeners(ExitListener[] children) It sets the children of this exit listener.voidIt sets child listener for this timeout listener.voidsetChildrenListeners(TimeOutListener[] children) It sets children listeners for this timeout listener.toString()
-
Field Details
-
noGoodsVariables
-
noGoodsValues
-
timeOut
public boolean timeOutIt specifies if the timeout has occurred and search is being terminated. -
exitChildListeners
ExitChildListener<T extends IntVar>[] exitChildListeners -
timeOutListeners
TimeOutListener[] timeOutListeners -
exitListeners
ExitListener[] exitListeners
-
-
Constructor Details
-
NoGoodsCollector
public NoGoodsCollector()
-
-
Method Details
-
executedAtTimeOut
public void executedAtTimeOut(int noSolutions) It is executed right after time out is determined.- Specified by:
executedAtTimeOutin interfaceTimeOutListener- Parameters:
noSolutions- number of solutions found before the timeout occurred.
-
leftChild
It is executed after exiting left child. Status specifies if the solution is found or not. The return parameter specifies if the search should continue according to its course or be forced to exit the parent node of the left child.- Specified by:
leftChildin interfaceExitChildListener<T extends IntVar>- Parameters:
var- variable used in the choice point.value- value used in the choice point.status- true if the solution was found in the child subtree, false otherwise.- Returns:
- true if the search should continue undisturbed, false if it should exit the current node with false
-
leftChild
Description copied from interface:ExitChildListenerIt is executed after exiting the left child.- Specified by:
leftChildin interfaceExitChildListener<T extends IntVar>- Parameters:
choice- primitive constraint used as the base of the choice point.status- true if the solution was found in the child subtree, false otherwise.- Returns:
- true if the search should continue undisturbed to the right node, false if it should exit the current node with false
-
rightChild
Description copied from interface:ExitChildListenerIt is executed after exiting the right child.- Specified by:
rightChildin interfaceExitChildListener<T extends IntVar>- Parameters:
var- variable used in the choice point.value- value used in the choice point.status- true if the solution was found in the child subtree, false otherwise. exit the current node with false
-
rightChild
Description copied from interface:ExitChildListenerIt is executed after exiting the right child.- Specified by:
rightChildin interfaceExitChildListener<T extends IntVar>- Parameters:
choice- primitive constraint used as the base of the choice point.status- true if the solution was found in the child subtree, false otherwise. exit the current node with false
-
executedAtExit
Description copied from interface:ExitListenerIt is executed right after time out is determined.- Specified by:
executedAtExitin interfaceExitListener- Parameters:
store- store in the context of which the search took place.solutionsNo- the number of solutions found.
-
setChildrenListeners
Description copied from interface:ExitChildListenerIt sets the children listeners for the current listener.- Specified by:
setChildrenListenersin interfaceExitChildListener<T extends IntVar>- Parameters:
children- array containing children listeners.
-
setChildrenListeners
Description copied from interface:ExitListenerIt sets the children of this exit listener.- Specified by:
setChildrenListenersin interfaceExitListener- Parameters:
children- an array containing the children.
-
setChildrenListeners
Description copied from interface:TimeOutListenerIt sets children listeners for this timeout listener.- Specified by:
setChildrenListenersin interfaceTimeOutListener- Parameters:
children- list of children listeners.
-
setChildrenListeners
Description copied from interface:TimeOutListenerIt sets child listener for this timeout listener.- Specified by:
setChildrenListenersin interfaceTimeOutListener- Parameters:
child- child listener for this timeout listener.
-
setChildrenListeners
Description copied from interface:ExitListenerIt sets one child listener.- Specified by:
setChildrenListenersin interfaceExitListener- Parameters:
child- the only child listener used by this listener.
-
setChildrenListeners
Description copied from interface:ExitChildListenerIt adds one child listener.- Specified by:
setChildrenListenersin interfaceExitChildListener<T extends IntVar>- Parameters:
child- added child listener.
-
toString
-