choco.palm.dbt.search
Class PalmAssignVar

java.lang.Object
  extended by choco.branch.AbstractBranching
      extended by choco.palm.dbt.search.PalmAbstractBranching
          extended by choco.palm.dbt.search.PalmAssignVar
All Implemented Interfaces:
Branching, ObjectBranching
Direct Known Subclasses:
PathRepairAssignVar

public class PalmAssignVar
extends PalmAbstractBranching

A classic implementation of branching algorithm for Palm. It selects the variable with a minimal domain size and tries to instantiate it to the inf bound.


Nested Class Summary
protected  class PalmAssignVar.ValIteratorWrapper
           
protected  class PalmAssignVar.ValSelectorWrapper
           
protected static interface PalmAssignVar.ValueChooserWrapper
           
 
Field Summary
protected  IValIterator valHeuristic
           
protected  IValSelector valSHeuristic
           
protected  IVarSelector varHeuristic
           
protected  PalmAssignVar.ValueChooserWrapper wrapper
           
 
Fields inherited from class choco.palm.dbt.search.PalmAbstractBranching
extender
 
Fields inherited from class choco.branch.AbstractBranching
LOG_DECISION_MSG, LOG_DOWN_MSG, LOG_UP_MSG, logger, manager, nextBranching
 
Constructor Summary
PalmAssignVar(IVarSelector varSel, IValIterator valHeuri)
           
PalmAssignVar(IVarSelector varSel, IValSelector valHeuri)
           
 
Method Summary
 boolean finishedBranching(java.lang.Object item, java.lang.Object previousBranch)
          Not defined in this algorithm.
 java.lang.String getDecisionLogMsg(int branchIndex)
          used for logging messages related to the search tree
 java.lang.Object getNextBranch(java.lang.Object branchingItem, java.lang.Object previousBranch)
          Not defined in this algorithm.
 java.lang.Object selectBranchingObject()
          Selects an item to branch on.
 java.lang.Object selectFirstBranch(java.lang.Object item)
          Returns a decision to take on the choosen item.
 
Methods inherited from class choco.palm.dbt.search.PalmAbstractBranching
getExtender, setExtender
 
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

varHeuristic

protected IVarSelector varHeuristic

valHeuristic

protected IValIterator valHeuristic

valSHeuristic

protected IValSelector valSHeuristic

wrapper

protected PalmAssignVar.ValueChooserWrapper wrapper
Constructor Detail

PalmAssignVar

public PalmAssignVar(IVarSelector varSel,
                     IValIterator valHeuri)

PalmAssignVar

public PalmAssignVar(IVarSelector varSel,
                     IValSelector valHeuri)
Method Detail

selectBranchingObject

public java.lang.Object selectBranchingObject()
Selects an item to branch on. In this algorithm, the variable with the minimal domain size is choosen.

Returns:
An item to branch on.

selectFirstBranch

public java.lang.Object selectFirstBranch(java.lang.Object item)
Returns a decision to take on the choosen item. In this algorithm, the variable is instantiated to the inf bound.

Parameters:
item - The variable (item) involved.
Returns:
The decision the solver should take.

getNextBranch

public java.lang.Object getNextBranch(java.lang.Object branchingItem,
                                      java.lang.Object previousBranch)
Not defined in this algorithm.

Parameters:
branchingItem -
previousBranch -
Returns:
the object labelling the current branch

finishedBranching

public boolean finishedBranching(java.lang.Object item,
                                 java.lang.Object previousBranch)
Not defined in this algorithm.

Returns:
true if no more branches can be generated

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]