choco.palm.real.search
Class PalmCyclicSplit

java.lang.Object
  extended by choco.branch.AbstractBranching
      extended by choco.palm.dbt.search.PalmAbstractBranching
          extended by choco.palm.real.search.PalmCyclicSplit
All Implemented Interfaces:
Branching, ObjectBranching

public class PalmCyclicSplit
extends PalmAbstractBranching

A default branching for continuous variables: each variable is choosen cyclicly.


Field Summary
protected  int current
          The index of the last splitted variable.
 
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
PalmCyclicSplit()
           
 
Method Summary
 boolean checkAcceptable(java.util.List csts)
          Checks if the constraints that should be posted are acceptable w.r.t. the learner component.
 boolean finishedBranching(java.lang.Object item, java.lang.Object previousBranch)
          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
 java.lang.Object getNextBranch(java.lang.Object branchingItem, java.lang.Object previousBranch)
          Returns the next decision constraints for a specified variable.
 void learnFromRejection()
          Learns from rejection: it allows to avoid to fail again for the same reason.
 java.lang.Object selectBranchingObject()
          Returns the next variable to split.
 java.lang.Object selectFirstBranch(java.lang.Object item)
          Returns the decision constraint to add (w.r.t. a specified variable).
 
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

current

protected int current
The index of the last splitted variable.

Constructor Detail

PalmCyclicSplit

public PalmCyclicSplit()
Method Detail

selectBranchingObject

public java.lang.Object selectBranchingObject()
Returns the next variable to split.

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

selectFirstBranch

public java.lang.Object selectFirstBranch(java.lang.Object item)
Returns the decision constraint to add (w.r.t. a specified variable).

Parameters:
item - The item the solver branchs on.

checkAcceptable

public boolean checkAcceptable(java.util.List csts)
Checks if the constraints that should be posted are acceptable w.r.t. the learner component. Not used here.


learnFromRejection

public void learnFromRejection()
Learns from rejection: it allows to avoid to fail again for the same reason. Not used here.


getNextBranch

public java.lang.Object getNextBranch(java.lang.Object branchingItem,
                                      java.lang.Object previousBranch)
Returns the next decision constraints for a specified variable. Not used here.

Parameters:
branchingItem - the branching object under scrutiny
previousBranch - the object labelling the previous branch
Returns:
the object labelling the current branch

finishedBranching

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

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]