JaCoP.search
Interface ExitChildListener<T extends Var>

Type Parameters:
T - type of variable used in the search.
All Known Implementing Classes:
CreditCalculator, LDS, NoGoodsCollector, Shaving, TraceGenerator

public interface ExitChildListener<T extends Var>

Defines a listener which is called by the search if a child node is exited. It works for both the right and left child.

Version:
3.1
Author:
Radoslaw Szymanek and Krzysztof Kuchcinski

Method Summary
 boolean leftChild(PrimitiveConstraint choice, boolean status)
          It is executed after exiting the left child.
 boolean leftChild(T var, int value, boolean status)
          It is executed after exiting the left child.
 void rightChild(PrimitiveConstraint choice, boolean status)
          It is executed after exiting the right child.
 void rightChild(T var, int value, boolean status)
          It is executed after exiting the right child.
 void setChildrenListeners(ExitChildListener<T> child)
          It adds one child listener.
 void setChildrenListeners(ExitChildListener<T>[] children)
          It sets the children listeners for the current listener.
 

Method Detail

leftChild

boolean leftChild(T var,
                  int value,
                  boolean status)
It is executed after exiting the left child.

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

boolean leftChild(PrimitiveConstraint choice,
                  boolean status)
It is executed after exiting the left child.

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

void rightChild(T var,
                int value,
                boolean status)
It is executed after exiting the right child.

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

void rightChild(PrimitiveConstraint choice,
                boolean status)
It is executed after exiting the right child.

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

setChildrenListeners

void setChildrenListeners(ExitChildListener<T>[] children)
It sets the children listeners for the current listener.

Parameters:
children - array containing children listeners.

setChildrenListeners

void setChildrenListeners(ExitChildListener<T> child)
It adds one child listener.

Parameters:
child - added child listener.