choco.search
Class AssignVar
java.lang.Object
choco.branch.AbstractBranching
choco.search.AbstractIntBranching
choco.search.AbstractLargeIntBranching
choco.search.AssignVar
- All Implemented Interfaces:
- Branching, IntBranching
- Direct Known Subclasses:
- JumpAssignVar
public class AssignVar
- extends AbstractLargeIntBranching
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
wrapper
protected AssignVar.ValueChooserWrapper wrapper
AssignVar
public AssignVar(IVarSelector varSel,
IValIterator valHeuri)
AssignVar
public AssignVar(IVarSelector varSel,
IValSelector valHeuri)
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 seti
- 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 seti
- 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 seti
- 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 pointi
- 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]