choco.kernel.solver.branch
Class BranchingWithLoggingStatements

java.lang.Object
  extended by choco.kernel.solver.branch.AbstractBranchingStrategy
      extended by choco.kernel.solver.branch.AbstractIntBranchingStrategy
          extended by choco.kernel.solver.branch.BranchingWithLoggingStatements
All Implemented Interfaces:
BranchingStrategy, IntBranching

public class BranchingWithLoggingStatements
extends AbstractIntBranchingStrategy


Field Summary
 AbstractIntBranchingStrategy internalBranching
           
 
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
BranchingWithLoggingStatements(AbstractIntBranchingStrategy internalBranching)
           
 
Method Summary
 boolean finishedBranching(IntBranchingDecision decision)
          Checks whether all branches have already been explored at the current choice point.
 String getDecisionLogMessage(IntBranchingDecision decision)
          The logging message associated with the current decision.
 void goDownBranch(IntBranchingDecision decision)
          Performs the action, so that we go down a branch from the current choice point.
 void goUpBranch(IntBranchingDecision decision)
          Performs the action, so that we go up the current branch to the father choice point.
 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  String makeLoggingMessage(IntBranchingDecision decision, String dirMsg, int worldStamp)
           
static StringBuilder makeLoggingMsgPrefix(int worldStamp)
           
 Object selectBranchingObject()
          selecting the object under scrutiny (that object on which an alternative will be set)
 void setFirstBranch(IntBranchingDecision decision)
          compute the first decision by setting a branching value or modifying the branching object
static AbstractIntBranchingStrategy setLoggingStatement(AbstractIntBranchingStrategy goal)
           
 void setNextBranch(IntBranchingDecision decision)
          compute the next decision by setting a branching value or modifying the branching object
 
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, toString, wait, wait, wait
 

Field Detail

internalBranching

public final AbstractIntBranchingStrategy internalBranching
Constructor Detail

BranchingWithLoggingStatements

public BranchingWithLoggingStatements(AbstractIntBranchingStrategy internalBranching)
Method Detail

finishedBranching

public boolean finishedBranching(IntBranchingDecision decision)
Description copied from interface: IntBranching
Checks whether all branches have already been explored at the current choice point.

Parameters:
decision - the last decision applied
Returns:
true if no more branches can be generated

getDecisionLogMessage

public String getDecisionLogMessage(IntBranchingDecision decision)
Description copied from interface: IntBranching
The logging message associated with the current decision.

Parameters:
decision - current decision
Returns:
logging message.

makeLoggingMsgPrefix

public static final StringBuilder makeLoggingMsgPrefix(int worldStamp)

makeLoggingMessage

protected String makeLoggingMessage(IntBranchingDecision decision,
                                    String dirMsg,
                                    int worldStamp)

goDownBranch

public void goDownBranch(IntBranchingDecision decision)
                  throws ContradictionException
Description copied from interface: IntBranching
Performs the action, so that we go down a branch from the current choice point.

Parameters:
decision - the decision to apply.
Throws:
ContradictionException - if a domain empties or a contradiction is infered

goUpBranch

public void goUpBranch(IntBranchingDecision decision)
                throws ContradictionException
Description copied from interface: IntBranching
Performs the action, so that we go up the current branch to the father choice point.

Parameters:
decision - the decision that has been set at the father choice point
Throws:
ContradictionException - if a domain empties or a contradiction is infered

setFirstBranch

public void setFirstBranch(IntBranchingDecision decision)
Description copied from interface: IntBranching
compute the first decision by setting a branching value or modifying the branching object


setNextBranch

public void setNextBranch(IntBranchingDecision decision)
Description copied from interface: IntBranching
compute the next decision by setting a branching value or modifying the branching object


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)

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

initBranching

public 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

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

setLoggingStatement

public static final AbstractIntBranchingStrategy setLoggingStatement(AbstractIntBranchingStrategy goal)


Copyright © 2012. All Rights Reserved.