choco.prop
Class ConstraintEvent

java.lang.Object
  extended by choco.prop.ConstraintEvent
All Implemented Interfaces:
PropagationEvent

public class ConstraintEvent
extends java.lang.Object
implements PropagationEvent

A class for constraint revisions in the propagation process.


Field Summary
 
Fields inherited from interface choco.prop.PropagationEvent
POPPING
 
Constructor Summary
ConstraintEvent(Propagator constraint, boolean init, int prio)
          Constructs a new var with the specified values for the fileds.
 
Method Summary
 void clear()
          Clears the var.
 java.lang.Object getModifiedObject()
          Returns the object, whose modification is described by the event
 int getPriority()
          Returns the priority of the var.
 boolean isActive(int idx)
          Testing whether an event is active in the propagation network
 boolean isInitialized()
          Returns if the constraint is initialized.
 boolean propagateEvent()
          Propagates the var: awake or propagate depending on the init status.
 void setInitialized(boolean init)
          Sets if the constraint is initialized.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConstraintEvent

public ConstraintEvent(Propagator constraint,
                       boolean init,
                       int prio)
Constructs a new var with the specified values for the fileds.

Method Detail

getModifiedObject

public java.lang.Object getModifiedObject()
Description copied from interface: PropagationEvent
Returns the object, whose modification is described by the event

Specified by:
getModifiedObject in interface PropagationEvent

getPriority

public int getPriority()
Returns the priority of the var.


propagateEvent

public boolean propagateEvent()
                       throws ContradictionException
Propagates the var: awake or propagate depending on the init status.

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

isInitialized

public boolean isInitialized()
Returns if the constraint is initialized.


setInitialized

public void setInitialized(boolean init)
Sets if the constraint is initialized.


isActive

public boolean isActive(int idx)
Testing whether an event is active in the propagation network

Specified by:
isActive in interface PropagationEvent

clear

public void clear()
Clears the var. This should not be called with this kind of var.

Specified by:
clear in interface PropagationEvent