choco.palm.dbt.prop
Class PalmEngine

java.lang.Object
  extended by choco.AbstractEntity
      extended by choco.prop.AbstractPropagationEngine
          extended by choco.prop.ChocEngine
              extended by choco.palm.dbt.prop.PalmEngine
All Implemented Interfaces:
Entity, PropagationEngine

public class PalmEngine
extends ChocEngine


Field Summary
 
Fields inherited from class choco.prop.ChocEngine
NB_CONST_QUEUES, nbPendingInitConstAwakeEvent, varEventQueue
 
Fields inherited from class choco.prop.AbstractPropagationEngine
contradictionCause
 
Fields inherited from class choco.AbstractEntity
hook, problem
 
Constructor Summary
PalmEngine(AbstractProblem pb)
          Constructs an engine with the specified problem.
 
Method Summary
 boolean isContradictory()
          Checks if a contradiction has been reached.
 void postRestoreInf(PalmIntVar v)
          Posts an inf bound restoration prop.
 void postRestoreInf(PalmRealVar v)
          Posts an inf bound restoration prop.
 void postRestoreSup(PalmIntVar v)
          Posts a sup bound restoration prop.
 void postRestoreSup(PalmRealVar v)
          Posts a sup bound restoration prop.
 void postRestoreVal(PalmIntVar v, int value)
          Posts value restoration.
 void raisePalmContradiction(Var var)
          Raises a Palm Contradiction caused by the specified variable.
 void raisePalmFakeContradiction(PalmExplanation expl)
          Raises a fake Contradiction with the specified explain.
 void raiseSystemContradiction()
          Raise a System Contradiction, that is a Choco Contradiction, that means that no solution can be found anymore without removing constraint with a level upper that PalmProblem.MAX_RELAX_LEVEL.
 void remove(Constraint[] constraints)
          Removes several constraints.
 void remove(Propagator constraint)
          Removes properly a constraint: the constraint is deactivated, and all depending filtering decisions are undone.
 void resetDummyVariable()
          Resets the dummy variable.
 void resetEvents()
          Resets all the events in the queue (no cause, and in the queue (no popping events anymore)).
 void setContradictory(boolean c)
          Sets if a contradiciton has been reached.
 
Methods inherited from class choco.prop.ChocEngine
_postEvent, checkCleanState, decPendingInitConstAwakeEvent, flushEvents, getNbPendingEvents, getNextActiveConstraintEventQueue, getNextActiveEventQueue, getPendingEvent, getQueue, getVarEventQueue, incPendingInitConstAwakeEvent, postAddKer, postConstAwake, postInstInt, postInstSet, postRemEnv, postRemoveVal, postUpdateInf, postUpdateInf, postUpdateSup, postUpdateSup, raiseContradiction, raiseContradiction, registerEvent
 
Methods inherited from class choco.prop.AbstractPropagationEngine
getContradictionCause, setContradictionCause, setNoContradictionCause
 
Methods inherited from class choco.AbstractEntity
getProblem, pretty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface choco.Entity
getProblem, pretty
 

Constructor Detail

PalmEngine

public PalmEngine(AbstractProblem pb)
Constructs an engine with the specified problem.

Parameters:
pb - The problem to associate with this engine.
Method Detail

resetEvents

public void resetEvents()
Resets all the events in the queue (no cause, and in the queue (no popping events anymore)).


postRestoreInf

public void postRestoreInf(PalmIntVar v)
Posts an inf bound restoration prop.

Parameters:
v - The variable on which the inf bound is restored.

postRestoreSup

public void postRestoreSup(PalmIntVar v)
Posts a sup bound restoration prop.

Parameters:
v - The variable on which the sup bound is restored.

postRestoreInf

public void postRestoreInf(PalmRealVar v)
Posts an inf bound restoration prop.

Parameters:
v - The variable on which the inf bound is restored.

postRestoreSup

public void postRestoreSup(PalmRealVar v)
Posts a sup bound restoration prop.

Parameters:
v - The variable on which the sup bound is restored.

postRestoreVal

public void postRestoreVal(PalmIntVar v,
                           int value)
Posts value restoration.

Parameters:
v - The variable that should be modified.
value - The value restored.

raisePalmContradiction

public void raisePalmContradiction(Var var)
                            throws ContradictionException
Raises a Palm Contradiction caused by the specified variable.

Parameters:
var - The variable which is responsible of the contradiction.
Throws:
ContradictionException

raisePalmFakeContradiction

public void raisePalmFakeContradiction(PalmExplanation expl)
                                throws ContradictionException
Raises a fake Contradiction with the specified explain. Useful when the contradiction is not due to only one domain.

Parameters:
expl - The explain of the contradiction.
Throws:
ContradictionException

raiseSystemContradiction

public void raiseSystemContradiction()
                              throws ContradictionException
Raise a System Contradiction, that is a Choco Contradiction, that means that no solution can be found anymore without removing constraint with a level upper that PalmProblem.MAX_RELAX_LEVEL.

Throws:
ContradictionException

remove

public void remove(Propagator constraint)
Removes properly a constraint: the constraint is deactivated, and all depending filtering decisions are undone.

Parameters:
constraint - The constraint to be removed.

remove

public void remove(Constraint[] constraints)
Removes several constraints.

Parameters:
constraints - An array with all the constraints to remove.

isContradictory

public boolean isContradictory()
Checks if a contradiction has been reached.

Returns:
True if a contradiciton happened.

setContradictory

public void setContradictory(boolean c)
Sets if a contradiciton has been reached.

Parameters:
c - The value to set.

resetDummyVariable

public void resetDummyVariable()
Resets the dummy variable.