choco.real.search
Class AssignInterval

java.lang.Object
  extended by choco.branch.AbstractBranching
      extended by choco.search.AbstractIntBranching
          extended by choco.real.search.AssignInterval
All Implemented Interfaces:
Branching, IntBranching

public class AssignInterval
extends AbstractIntBranching
implements IntBranching

A binary branching assigning interval to subinterval.


Field Summary
protected  IValIterator valIterator
           
protected  RealVarSelector varSelector
           
 
Fields inherited from class choco.branch.AbstractBranching
LOG_DECISION_MSG, LOG_DOWN_MSG, LOG_UP_MSG, logger, manager, nextBranching
 
Constructor Summary
AssignInterval(RealVarSelector varSelector, IValIterator valIterator)
           
 
Method Summary
 boolean branchOn(java.lang.Object x, int n)
          Deprecated. replaced by the management incremental search (with a stack of BranchingTrace storing the environment (local variables) associated to each choice point
 boolean finishedBranching(java.lang.Object x, int i)
          Checks whether all branches have already been explored at the current choice point.
 java.lang.String getDecisionLogMsg(int i)
          used for logging messages related to the search tree
 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 up the current branch to the father choice point.
 java.lang.Object selectBranchingObject()
          selecting the object under scrutiny (that object on which an alternative will be set)
 
Methods inherited from class choco.search.AbstractIntBranching
explore, logDownBranch, logUpBranch
 
Methods inherited from class choco.branch.AbstractBranching
getNextBranching, setNextBranching, setSolver
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface choco.branch.IntBranching
explore
 

Field Detail

varSelector

protected RealVarSelector varSelector

valIterator

protected IValIterator valIterator
Constructor Detail

AssignInterval

public AssignInterval(RealVarSelector varSelector,
                      IValIterator valIterator)
Method Detail

selectBranchingObject

public java.lang.Object selectBranchingObject()
Description copied from interface: Branching
selecting the object under scrutiny (that object on which an alternative will be set)

Specified by:
selectBranchingObject in interface Branching
Returns:
the object on which an alternative will be set (often a variable)

branchOn

public boolean branchOn(java.lang.Object x,
                        int n)
                 throws ContradictionException
Deprecated. replaced by the management incremental search (with a stack of BranchingTrace storing the environment (local variables) associated to each choice point

Description copied from interface: IntBranching
A method exploring the i-th branch of choice point.

Specified by:
branchOn in interface IntBranching
Parameters:
x - the current branching object
n - the index of the branch
Returns:
true if the subtree below that branch lead to a solution or not
Throws:
ContradictionException - if a domain empties or a contradiction is infered

goDownBranch

public void goDownBranch(java.lang.Object x,
                         int i)
                  throws ContradictionException
Description copied from interface: IntBranching
Performs the action, so that we go down a branch from the current choice point.

Specified by:
goDownBranch in interface IntBranching
Overrides:
goDownBranch in class AbstractIntBranching
Parameters:
x - the object on which the alternative is set
i - the label of the branch that we want to go down
Throws:
ContradictionException - if a domain empties or a contradiction is infered

goUpBranch

public void goUpBranch(java.lang.Object x,
                       int i)
                throws ContradictionException
Description copied from interface: IntBranching
Performs the action, so that we go up the current branch to the father choice point.

Specified by:
goUpBranch in interface IntBranching
Overrides:
goUpBranch in class AbstractIntBranching
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 - if a domain empties or a contradiction is infered

getFirstBranch

public int getFirstBranch(java.lang.Object x)
Description copied from interface: IntBranching
Computes the search index of the first branch of the choice point.

Specified by:
getFirstBranch in interface IntBranching
Parameters:
x - the object on which the alternative is set
Returns:
the index of the first branch

getNextBranch

public int getNextBranch(java.lang.Object x,
                         int i)
Description copied from interface: IntBranching
Computes the search index of the next branch of the choice point.

Specified by:
getNextBranch in interface IntBranching
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

public boolean finishedBranching(java.lang.Object x,
                                 int i)
Description copied from interface: IntBranching
Checks whether all branches have already been explored at the current choice point.

Specified by:
finishedBranching in interface IntBranching
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

getDecisionLogMsg

public java.lang.String getDecisionLogMsg(int i)
Description copied from class: AbstractBranching
used for logging messages related to the search tree

Specified by:
getDecisionLogMsg in class AbstractBranching
Returns:
an string that will be printed between the branching object and the branch index Suggested implementations return LOG_DECISION_MSG[0] or LOG_DECISION_MSG[branchIndex]