choco.cp.solver.search.integer.branching.domwdeg
Class AbstractDomOverWDegBranching

java.lang.Object
  extended by choco.kernel.solver.branch.AbstractBranchingStrategy
      extended by choco.kernel.solver.branch.AbstractIntBranchingStrategy
          extended by choco.kernel.solver.branch.AbstractLargeIntBranchingStrategy
              extended by choco.cp.solver.search.integer.branching.domwdeg.AbstractDomOverWDegBranching
All Implemented Interfaces:
IRandomBreakTies, BranchingStrategy, IntBranching, PropagationEngineListener
Direct Known Subclasses:
AbstractDomOverWDegBinBranching, DomOverWDegBranchingNew

public abstract class AbstractDomOverWDegBranching
extends AbstractLargeIntBranchingStrategy
implements PropagationEngineListener, IRandomBreakTies


Field Summary
protected  Solver solver
           
protected  int updateWeightsCount
           
protected  IntRatio[] varRatios
           
 
Fields inherited from class choco.kernel.solver.branch.AbstractBranchingStrategy
LOG_DECISION_MSG_ASSIGN, LOG_DECISION_MSG_REMOVE, LOG_DOWN_MSG, LOG_UP_MSG, manager
 
Fields inherited from interface choco.kernel.solver.branch.BranchingStrategy
LOGGER
 
Constructor Summary
AbstractDomOverWDegBranching(Solver solver, IntRatio[] varRatios, Number seed)
           
 
Method Summary
 void cancelRandomBreakTies()
           
 void contradictionOccured(ContradictionException e)
           
protected  void decreaseVarWeights(Var currentVar)
           
protected abstract  int getExpectedUpdateWeightsCount()
           
 IntVarRatioSelector getRatioSelector()
           
 Solver getSolver()
           
protected  void increaseVarWeights(Var currentVar)
           
 void initBranching()
          This method is called before launching the search. it may be used to intialiaze data structures or counters for instance.
 void initConstraintForBranching(SConstraint c)
          this method is used to build the data structure in the branching for the given constraint.
protected  void reinitBranching()
           
 void safeDelete()
          Define action to do just before a deletion.
 Object selectBranchingObject()
          selecting the object under scrutiny (that object on which an alternative will be set)
 void setRandomBreakTies(long seed)
           
 String toString()
           
 
Methods inherited from class choco.kernel.solver.branch.AbstractIntBranchingStrategy
getDefaultAssignMsg, getDefaultAssignOrForbidMsg
 
Methods inherited from class choco.kernel.solver.branch.AbstractBranchingStrategy
getManager, getNextBranching, setNextBranching, setSolver
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface choco.kernel.solver.branch.IntBranching
finishedBranching, getDecisionLogMessage, goDownBranch, goUpBranch, setFirstBranch, setNextBranch
 

Field Detail

solver

protected final Solver solver

varRatios

protected final IntRatio[] varRatios

updateWeightsCount

protected int updateWeightsCount
Constructor Detail

AbstractDomOverWDegBranching

public AbstractDomOverWDegBranching(Solver solver,
                                    IntRatio[] varRatios,
                                    Number seed)
Method Detail

getSolver

public final Solver getSolver()

getRatioSelector

public final IntVarRatioSelector getRatioSelector()

cancelRandomBreakTies

public void cancelRandomBreakTies()
Specified by:
cancelRandomBreakTies in interface IRandomBreakTies

setRandomBreakTies

public void setRandomBreakTies(long seed)
Specified by:
setRandomBreakTies in interface IRandomBreakTies

initConstraintForBranching

public void initConstraintForBranching(SConstraint c)
Description copied from class: AbstractBranchingStrategy
this method is used to build the data structure in the branching for the given constraint. This is used when the constraint was not present at the initialization of the branching, for example a cut

Overrides:
initConstraintForBranching in class AbstractBranchingStrategy
Parameters:
c - constraint

getExpectedUpdateWeightsCount

protected abstract int getExpectedUpdateWeightsCount()

initBranching

public final void initBranching()
Description copied from class: AbstractBranchingStrategy
This method is called before launching the search. it may be used to intialiaze data structures or counters for instance.

Overrides:
initBranching in class AbstractBranchingStrategy

reinitBranching

protected final void reinitBranching()

increaseVarWeights

protected final void increaseVarWeights(Var currentVar)

decreaseVarWeights

protected final void decreaseVarWeights(Var currentVar)

contradictionOccured

public final void contradictionOccured(ContradictionException e)
Specified by:
contradictionOccured in interface PropagationEngineListener

safeDelete

public final void safeDelete()
Description copied from interface: PropagationEngineListener
Define action to do just before a deletion.

Specified by:
safeDelete in interface PropagationEngineListener

selectBranchingObject

public Object selectBranchingObject()
                             throws ContradictionException
Description copied from interface: BranchingStrategy
selecting the object under scrutiny (that object on which an alternative will be set)

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

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2012. All Rights Reserved.