choco.kernel.solver.propagation.event
Class ConstraintEvent

java.lang.Object
  extended by choco.kernel.solver.propagation.event.ConstraintEvent
All Implemented Interfaces:
IPrioritizable, PropagationEvent

public class ConstraintEvent
extends Object
implements PropagationEvent

A class for constraint revisions in the propagation process.


Field Summary
static int BINARY
           
static int CUBIC
           
static int LINEAR
           
static int NB_PRIORITY
           
static int QUADRATIC
           
static int TERNARY
           
static int UNARY
           
static int VERY_SLOW
           
 
Fields inherited from interface choco.kernel.solver.propagation.event.PropagationEvent
LOGGER
 
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.
 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
 

Field Detail

UNARY

public static final int UNARY

BINARY

public static final int BINARY

TERNARY

public static final int TERNARY

LINEAR

public static final int LINEAR

QUADRATIC

public static final int QUADRATIC

CUBIC

public static final int CUBIC

VERY_SLOW

public static final int VERY_SLOW

NB_PRIORITY

public static final int NB_PRIORITY
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 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.

Specified by:
getPriority in interface IPrioritizable

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


Copyright © 2012. All Rights Reserved.