choco.search
Class AssignVar

java.lang.Object
  extended by choco.branch.AbstractBranching
      extended by choco.search.AbstractIntBranching
          extended by choco.search.AbstractLargeIntBranching
              extended by choco.search.AssignVar
All Implemented Interfaces:
Branching, IntBranching
Direct Known Subclasses:
JumpAssignVar

public class AssignVar
extends AbstractLargeIntBranching


Nested Class Summary
protected  class AssignVar.ValIteratorWrapper
           
protected  class AssignVar.ValSelectorWrapper
           
protected static interface AssignVar.ValueChooserWrapper
           
 
Field Summary
protected  AssignVar.ValueChooserWrapper wrapper
           
 
Fields inherited from class choco.branch.AbstractBranching
LOG_DECISION_MSG, LOG_DOWN_MSG, LOG_UP_MSG, logger, manager, nextBranching
 
Constructor Summary
AssignVar(IVarSelector varSel, IValIterator valHeuri)
           
AssignVar(IVarSelector varSel, IValSelector valHeuri)
           
 
Method Summary
 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 branchIndex)
          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.AbstractLargeIntBranching
branchOn
 
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
 

Field Detail

wrapper

protected AssignVar.ValueChooserWrapper wrapper
Constructor Detail

AssignVar

public AssignVar(IVarSelector varSel,
                 IValIterator valHeuri)

AssignVar

public AssignVar(IVarSelector varSel,
                 IValSelector valHeuri)
Method Detail

selectBranchingObject

public java.lang.Object selectBranchingObject()
selecting the object under scrutiny (that object on which an alternative will be set)

Returns:
the object on which an alternative will be set (often a variable)

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.

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

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.

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.

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

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

getDecisionLogMsg

public java.lang.String getDecisionLogMsg(int branchIndex)
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]