choco.branch
Interface IntBranching

All Superinterfaces:
Branching
All Known Implementing Classes:
AbstractBinIntBranching, AbstractIntBranching, AbstractLargeIntBranching, AbstractSetBranching, AssignInterval, AssignSetVar, AssignVar, JumpAssignVar

public interface IntBranching
extends Branching

IntBranching objects are specific branching objects where each branch is labeled with an integer. This is typically useful for choice points in search trees


Method Summary
 boolean branchOn(java.lang.Object x, int i)
          A method exploring the i-th branch of choice point
 boolean explore(int n)
          A method launching the exploration of a subtree in order to satisfy the current goal
 boolean finishedBranching(java.lang.Object x, int i)
          Checks whether all branches have already been explored at the current choice point
 int getFirstBranch(java.lang.Object x)
          Computes the search index of the first branch of the choice point
 int getNextBranch(java.lang.Object x, int i)
          Computes the search index of the next branch of the choice point
 void goDownBranch(java.lang.Object x, int i)
          performs the action, so that we go down a branch from the current choice point
 void goUpBranch(java.lang.Object x, int i)
          performs the action, so that we go down up the current branch to the father choice point
 
Methods inherited from interface choco.branch.Branching
selectBranchingObject
 

Method Detail

goDownBranch

void goDownBranch(java.lang.Object x,
                  int i)
                  throws ContradictionException
performs the action, so that we go down a branch from the current choice point

Parameters:
x - the object on which the alternative is set
i - the label of the branch that we want to go down
Throws:
ContradictionException

goUpBranch

void goUpBranch(java.lang.Object x,
                int i)
                throws ContradictionException
performs the action, so that we go down up the current branch to the father choice point

Parameters:
x - the object on which the alternative has been set at the father choice point
i - the label of the branch that has been travelled down from the father choice point
Throws:
ContradictionException

getFirstBranch

int getFirstBranch(java.lang.Object x)
Computes the search index of the first branch of the choice point

Parameters:
x - the object on which the alternative is set
Returns:
the index of the first branch

getNextBranch

int getNextBranch(java.lang.Object x,
                  int i)
Computes the search index of the next branch of the choice point

Parameters:
x - the object on which the alternative is set
i - the index of the current branch
Returns:
the index of the next branch

finishedBranching

boolean finishedBranching(java.lang.Object x,
                          int i)
Checks whether all branches have already been explored at the current choice point

Parameters:
x - the object on which the alternative is set
i - the index of the last branch
Returns:
true if no more branches can be generated

branchOn

boolean branchOn(java.lang.Object x,
                 int i)
                 throws ContradictionException
A method exploring the i-th branch of choice point

Parameters:
x - the current branching object
i - the index of the branch
Returns:
true if the subtree below that branch lead to a solution or not
Throws:
ContradictionException

explore

boolean explore(int n)
A method launching the exploration of a subtree in order to satisfy the current goal

Parameters:
n - current depth in the search tree
Returns:
true iff the search was successful