choco.palm.real
Class PalmRealVarEvent

java.lang.Object
  extended by choco.prop.VarEvent
      extended by choco.real.var.RealVarEvent
          extended by choco.palm.real.PalmRealVarEvent
All Implemented Interfaces:
PalmVarEvent, PropagationEvent, IPrioritizable

public class PalmRealVarEvent
extends RealVarEvent
implements PalmVarEvent

Implements an event for real variable of PaLM.


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.
 
Fields inherited from class choco.real.var.RealVarEvent
BOUNDSEVENT, DECSUP, EMPTYEVENT, INCINF, INFEVENT, SUPEVENT
 
Fields inherited from class choco.prop.VarEvent
cause, eventType, logger, modifiedVar, NOCAUSE, NOEVENT
 
Fields inherited from interface choco.prop.PropagationEvent
POPPING
 
Constructor Summary
PalmRealVarEvent(AbstractVar var)
          Creates new event for the specified variable (should be a Palm real variable).
 
Method Summary
 int getPriority()
          Computes the priority of the prop.
 boolean isPopping()
          States if this event is currently being popped.
 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 reset()
          Resets this event if interrupted during execution.
 void restoreVariableExplanation()
          Updates variable states after restoration (like explanation or decision constraints for instance).
 void setPopping(boolean b)
          Specifies if this event is being popped.
 
Methods inherited from class choco.real.var.RealVarEvent
clear, freeze, getEventType, getReleased, propagateBoundsEvent, propagateInfEvent, propagateSupEvent, release, 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
Constructor Detail

PalmRealVarEvent

public PalmRealVarEvent(AbstractVar var)
Creates new event for the specified variable (should be a Palm real variable).

Parameters:
var -
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 RealVarEvent
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

restoreVariableExplanation

public void restoreVariableExplanation()
Updates variable states after restoration (like explanation or decision constraints for instance).

Specified by:
restoreVariableExplanation in interface PalmVarEvent

isPopping

public boolean isPopping()
States if this event is currently being popped.

Specified by:
isPopping in interface PalmVarEvent

setPopping

public void setPopping(boolean b)
Specifies if this event is being popped.

Specified by:
setPopping in interface PalmVarEvent

reset

public void reset()
Resets this event if interrupted during execution.

Specified by:
reset in interface PalmVarEvent