choco.palm.dbt.prop
Class PalmIntVarEvent

java.lang.Object
  extended by choco.prop.VarEvent
      extended by choco.integer.var.IntVarEvent
          extended by choco.palm.dbt.prop.PalmIntVarEvent
All Implemented Interfaces:
PalmVarEvent, PropagationEvent, IPrioritizable

public class PalmIntVarEvent
extends IntVarEvent
implements PalmVarEvent


Field Summary
 boolean isPopping
          This boolean was before in the queue
 int oldEventType
           
static int RESTINF
          Constant value associated to the inf bound restoration prop.
static int RESTSUP
          Constant value associated to the sup bound restoration prop.
static int RESTVAL
          Constant value associated to the value restoration prop.
 
Fields inherited from class choco.integer.var.IntVarEvent
BOUNDSbitvector, DECSUP, DECSUPbitvector, INCINF, INCINFbitvector, INSTINT, INSTINTbitvector, REMVAL, REMVALbitvector
 
Fields inherited from class choco.prop.VarEvent
cause, EMPTYEVENT, eventType, logger, modifiedVar, NOCAUSE, NOEVENT
 
Fields inherited from interface choco.prop.PropagationEvent
POPPING
 
Constructor Summary
PalmIntVarEvent(Var var)
          Creates an prop for the specified variable.
 
Method Summary
 int getPriority()
          Computes the priority of the prop.
 IntIterator getRestoreIterator()
          Returns an iterator on the chain containing all the restored values.
 boolean isPopping()
           
 boolean propagateEvent()
          Generic propagation method.
 void propagateRestInfEvent(int evtCause)
          Propagates the lower bound restoration event.
 void propagateRestSupEvent(int evtCause)
          Propagates the upper bound restoration event.
 void propagateRestValEvent(int evtCause)
          Propagates a value restoration event.
 void reset()
          If a contradiction occurs when the event is handled, the event is reinitialized.
 void restoreVariableExplanation()
          Updates explanations for the variable: when bounds are completely restored, the unrelevant explanations are removed.
 void setPopping(boolean b)
           
 
Methods inherited from class choco.integer.var.IntVarEvent
clear, freeze, getEventIterator, getEventType, getIntVar, getReleased, propagateBoundsEvent, propagateInfEvent, propagateInstEvent, propagateRemovalsEvent, propagateSupEvent, release, setEventType, toString
 
Methods inherited from class choco.prop.VarEvent
getCause, getModifiedObject, getModifiedVar, getProblem, isActive, isEnqueued, recordEventTypeAndCause
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

oldEventType

public int oldEventType

isPopping

public boolean isPopping
This boolean was before in the queue


RESTINF

public static final int RESTINF
Constant value associated to the inf bound restoration prop.

See Also:
Constant Field Values

RESTSUP

public static final int RESTSUP
Constant value associated to the sup bound restoration prop.

See Also:
Constant Field Values

RESTVAL

public static final int RESTVAL
Constant value associated to the value restoration prop.

See Also:
Constant Field Values
Constructor Detail

PalmIntVarEvent

public PalmIntVarEvent(Var var)
Creates an prop for the specified variable.

Parameters:
var - The variable this prop is reponsible for.
Method Detail

getPriority

public int getPriority()
Computes the priority of the prop. Actually, it returns 0 for restoration events (that is urgent events) and 1 for the others.

Specified by:
getPriority in interface IPrioritizable
Overrides:
getPriority in class VarEvent
Returns:
The priority of this prop.

propagateEvent

public boolean propagateEvent()
                       throws ContradictionException
Generic propagation method. Calls relevant methods depending on the kind of event. It handles some new events for restoration purpose and call the Choco method super.propagateEvent().

Specified by:
propagateEvent in interface PropagationEvent
Overrides:
propagateEvent in class IntVarEvent
Returns:
true if the event has been fully propagated (and can thus be discarded), false otherwise
Throws:
ContradictionException

propagateRestInfEvent

public void propagateRestInfEvent(int evtCause)
                           throws ContradictionException
Propagates the lower bound restoration event.

Throws:
ContradictionException

propagateRestSupEvent

public void propagateRestSupEvent(int evtCause)
                           throws ContradictionException
Propagates the upper bound restoration event.

Throws:
ContradictionException

propagateRestValEvent

public void propagateRestValEvent(int evtCause)
                           throws ContradictionException
Propagates a value restoration event.

Throws:
ContradictionException

restoreVariableExplanation

public void restoreVariableExplanation()
Updates explanations for the variable: when bounds are completely restored, the unrelevant explanations are removed.

Specified by:
restoreVariableExplanation in interface PalmVarEvent

getRestoreIterator

public IntIterator getRestoreIterator()
Returns an iterator on the chain containing all the restored values.


reset

public void reset()
If a contradiction occurs when the event is handled, the event is reinitialized.

Specified by:
reset in interface PalmVarEvent

isPopping

public boolean isPopping()
Specified by:
isPopping in interface PalmVarEvent

setPopping

public void setPopping(boolean b)
Specified by:
setPopping in interface PalmVarEvent