choco.integer.var
Class IntVarEvent

java.lang.Object
  extended by choco.prop.VarEvent
      extended by choco.integer.var.IntVarEvent
All Implemented Interfaces:
PropagationEvent, IPrioritizable
Direct Known Subclasses:
PalmIntVarEvent

public class IntVarEvent
extends VarEvent


Field Summary
static int BOUNDSbitvector
          Constants for the eventType bitvector: value of bitvector for updates to both bound of IntVars
static int DECSUP
          Constants for the eventType bitvector: index of bit for updates to upper bound of IntVars
static int DECSUPbitvector
          Constants for the eventType bitvector: value of bitvector for updates to upper bound of IntVars
static int INCINF
          Constants for the eventType bitvector: index of bit for updates to lower bound of IntVars
static int INCINFbitvector
          Constants for the eventType bitvector: value of bitvector for updates to lower bound of IntVars
static int INSTINT
          Constants for the eventType bitvector: index of bit for instantiations of IntVars
static int INSTINTbitvector
          Constants for the eventType bitvector: value of bitvector for instantiations of IntVars
static int REMVAL
          Constants for the eventType bitvector: index of bit for holes in the domain of IntVars
static int REMVALbitvector
          Constants for the eventType bitvector: value of bitvector for holes in the domain of IntVars
 
Fields inherited from class choco.prop.VarEvent
cause, EMPTYEVENT, eventType, logger, modifiedVar, NOCAUSE, NOEVENT
 
Fields inherited from interface choco.prop.PropagationEvent
POPPING
 
Constructor Summary
IntVarEvent(AbstractVar var)
           
 
Method Summary
 void clear()
          Clears the var: delegates to the basic events.
protected  void freeze()
          freezes the state of the "delta domain": the set of values that are considered for removal from the domain.
 IntIterator getEventIterator()
          Returns an iterator over the set of removed values
 int getEventType()
          Retrieves the event type
 IntDomainVarImpl getIntVar()
           
 boolean getReleased()
           
 void propagateBoundsEvent(int evtCause)
          Propagates the update to the domain lower and upper bounds
 boolean propagateEvent()
          Propagates the event through calls to the propagation engine.
 void propagateInfEvent(int evtCause)
          Propagates the update to the lower bound
 void propagateInstEvent(int evtCause)
          Propagates the instantiation event
 void propagateRemovalsEvent(int evtCause)
          Propagates a set of value removals
 void propagateSupEvent(int evtCause)
          Propagates the update to the upper bound
protected  boolean release()
          the event had been "frozen", (since the call to freeze), while it was handled by the propagation engine: This meant that the meaning of the event could not be changed: it represented a static set of value removals, during propagation.
 void setEventType(int evtType)
          records the event type
 java.lang.String toString()
          useful for debugging
 
Methods inherited from class choco.prop.VarEvent
getCause, getModifiedObject, getModifiedVar, getPriority, getProblem, isActive, isEnqueued, recordEventTypeAndCause
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

INCINF

public static final int INCINF
Constants for the eventType bitvector: index of bit for updates to lower bound of IntVars

See Also:
Constant Field Values

DECSUP

public static final int DECSUP
Constants for the eventType bitvector: index of bit for updates to upper bound of IntVars

See Also:
Constant Field Values

REMVAL

public static final int REMVAL
Constants for the eventType bitvector: index of bit for holes in the domain of IntVars

See Also:
Constant Field Values

INSTINT

public static final int INSTINT
Constants for the eventType bitvector: index of bit for instantiations of IntVars

See Also:
Constant Field Values

INCINFbitvector

public static final int INCINFbitvector
Constants for the eventType bitvector: value of bitvector for updates to lower bound of IntVars

See Also:
Constant Field Values

DECSUPbitvector

public static final int DECSUPbitvector
Constants for the eventType bitvector: value of bitvector for updates to upper bound of IntVars

See Also:
Constant Field Values

BOUNDSbitvector

public static final int BOUNDSbitvector
Constants for the eventType bitvector: value of bitvector for updates to both bound of IntVars

See Also:
Constant Field Values

REMVALbitvector

public static final int REMVALbitvector
Constants for the eventType bitvector: value of bitvector for holes in the domain of IntVars

See Also:
Constant Field Values

INSTINTbitvector

public static final int INSTINTbitvector
Constants for the eventType bitvector: value of bitvector for instantiations of IntVars

See Also:
Constant Field Values
Constructor Detail

IntVarEvent

public IntVarEvent(AbstractVar var)
Method Detail

getIntVar

public IntDomainVarImpl getIntVar()

toString

public java.lang.String toString()
useful for debugging

Overrides:
toString in class java.lang.Object

getEventType

public int getEventType()
Retrieves the event type


setEventType

public void setEventType(int evtType)
records the event type


clear

public void clear()
Clears the var: delegates to the basic events.

Specified by:
clear in interface PropagationEvent
Specified by:
clear in class VarEvent

release

protected boolean release()
the event had been "frozen", (since the call to freeze), while it was handled by the propagation engine: This meant that the meaning of the event could not be changed: it represented a static set of value removals, during propagation. Now, the event becomes "open" again: new value removals can be hosted, the delta domain can accept that further values are removed. In case value removals happened while the event was frozen, the release method returns false (the event cannot be released, it must be handled once more). Otherwise (the standard behavior), the method returns true

Overrides:
release in class VarEvent

freeze

protected void freeze()
Description copied from class: VarEvent
freezes the state of the "delta domain": the set of values that are considered for removal from the domain. Further removals will be treated as a further event.

Overrides:
freeze in class VarEvent

getReleased

public boolean getReleased()

getEventIterator

public IntIterator getEventIterator()
Returns an iterator over the set of removed values

Returns:
an iterator over the set of values that have been removed from the domain

propagateEvent

public boolean propagateEvent()
                       throws ContradictionException
Propagates the event through calls to the propagation engine.

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

propagateInstEvent

public void propagateInstEvent(int evtCause)
                        throws ContradictionException
Propagates the instantiation event

Throws:
ContradictionException

propagateSupEvent

public void propagateSupEvent(int evtCause)
                       throws ContradictionException
Propagates the update to the upper bound

Throws:
ContradictionException

propagateInfEvent

public void propagateInfEvent(int evtCause)
                       throws ContradictionException
Propagates the update to the lower bound

Throws:
ContradictionException

propagateBoundsEvent

public void propagateBoundsEvent(int evtCause)
                          throws ContradictionException
Propagates the update to the domain lower and upper bounds

Throws:
ContradictionException

propagateRemovalsEvent

public void propagateRemovalsEvent(int evtCause)
                            throws ContradictionException
Propagates a set of value removals

Throws:
ContradictionException