|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectchoco.AbstractEntity
choco.prop.AbstractPropagationEngine
choco.prop.ChocEngine
public class ChocEngine
Implementation of an AbstractPropagationEngine
for Choco.
Field Summary | |
---|---|
protected static int |
NB_CONST_QUEUES
the number of queues for storing constraint events |
protected int |
nbPendingInitConstAwakeEvent
Number of pending init constraint awake events. |
protected VarEventQueue |
varEventQueue
The queue with all the variable events. |
Fields inherited from class choco.prop.AbstractPropagationEngine |
---|
contradictionCause |
Fields inherited from class choco.AbstractEntity |
---|
hook, problem |
Constructor Summary | |
---|---|
ChocEngine(AbstractProblem pb)
Constructs a new engine by initializing the var queues. |
Method Summary | |
---|---|
protected void |
_postEvent(Var v,
int idx,
int basicEvt)
Private method for completing the bound var posting. |
boolean |
checkCleanState()
checking that the propagation engine remains in a proper state |
void |
decPendingInitConstAwakeEvent()
Decrements the number of init constraint awake events. |
void |
flushEvents()
Removes all pending events (used when interrupting a propagation because a contradiction has been raised) |
int |
getNbPendingEvents()
|
EventQueue |
getNextActiveConstraintEventQueue()
Returns the next constraint var queue from which an event should be propagated. |
EventQueue |
getNextActiveEventQueue()
Returns the next queue from which an event should be propagated. |
PropagationEvent |
getPendingEvent(int idx)
getter without side effect: returns the i-ht pending event (without popping any event from the queues) |
ConstraintEventQueue |
getQueue(ConstraintEvent event)
Gets the queue for a given priority of var. |
VarEventQueue |
getVarEventQueue()
Returns the variable var queue. |
void |
incPendingInitConstAwakeEvent()
Increments the number of init constraint awake events. |
void |
postAddKer(SetVar v,
int idx)
Posts a kernel addition event on a set variable |
boolean |
postConstAwake(Propagator constraint,
boolean init)
Posts a constraint awake var. |
void |
postInstInt(IntDomainVar v,
int idx)
Posts an Inst var. |
void |
postInstSet(SetVar v,
int idx)
Posts an Inst event on a set var. |
void |
postRemEnv(SetVar v,
int idx)
Posts a removal event on a set variable |
void |
postRemoveVal(IntDomainVar v,
int x,
int idx)
Posts an Remove var. |
void |
postUpdateInf(IntDomainVar v,
int idx)
Posts an IncInf event |
void |
postUpdateInf(RealVar v,
int idx)
Posts an lower bound event for a real variable. |
void |
postUpdateSup(IntDomainVar v,
int idx)
Posts a DecSup event |
void |
postUpdateSup(RealVar v,
int idx)
Posts an upper bound event for a real variable |
void |
raiseContradiction()
Throws a contradiction without cause. |
void |
raiseContradiction(Entity cause)
Throws a contradiction with the specified cause. |
void |
registerEvent(ConstraintEvent event)
Registers an event in the queue. |
Methods inherited from class choco.prop.AbstractPropagationEngine |
---|
getContradictionCause, setContradictionCause, setNoContradictionCause |
Methods inherited from class choco.AbstractEntity |
---|
getProblem, pretty |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface choco.Entity |
---|
getProblem, pretty |
Field Detail |
---|
protected static int NB_CONST_QUEUES
protected int nbPendingInitConstAwakeEvent
protected VarEventQueue varEventQueue
Constructor Detail |
---|
public ChocEngine(AbstractProblem pb)
Method Detail |
---|
public void postUpdateInf(IntDomainVar v, int idx)
v
- The variable the bound is modified.idx
- The index of the constraint which is responsible of the var.public void postUpdateSup(IntDomainVar v, int idx)
v
- The variable the bound is modified.idx
- The index of the constraint which is responsible of the var.protected void _postEvent(Var v, int idx, int basicEvt)
basicEvt
- The basic event posted.idx
- The index of the constraint which is responsible of the var.public void postInstInt(IntDomainVar v, int idx)
v
- The variable that is instantiated.idx
- The index of the constraint which is responsible of the var.public void postRemoveVal(IntDomainVar v, int x, int idx)
v
- The variable the value is removed from.idx
- The index of the constraint which is responsible of the var.public void postUpdateInf(RealVar v, int idx)
v
- idx
- public void postUpdateSup(RealVar v, int idx)
v
- idx
- public void postRemEnv(SetVar v, int idx)
v
- the variable the enveloppe is modifiedidx
- the index of the constraint that causes the eventpublic void postAddKer(SetVar v, int idx)
v
- the variable the kernel is modifiedidx
- the index of the constraint that causes the eventpublic void postInstSet(SetVar v, int idx)
v
- The variable that is instantiated.idx
- The index of the constraint which is responsible of the var.public boolean postConstAwake(Propagator constraint, boolean init)
constraint
- The constraint that must be awaken.init
- Specifies if the constraint must be initialized
(awake instead of propagate).public ConstraintEventQueue getQueue(ConstraintEvent event)
event
- The var for which the queue is searched.public void registerEvent(ConstraintEvent event)
event
- public VarEventQueue getVarEventQueue()
public void raiseContradiction() throws ContradictionException
ContradictionException
public void raiseContradiction(Entity cause) throws ContradictionException
ContradictionException
public void decPendingInitConstAwakeEvent()
public void incPendingInitConstAwakeEvent()
public EventQueue getNextActiveConstraintEventQueue()
public EventQueue getNextActiveEventQueue()
getNextActiveEventQueue
in interface PropagationEngine
getNextActiveEventQueue
in class AbstractPropagationEngine
public int getNbPendingEvents()
public PropagationEvent getPendingEvent(int idx)
public void flushEvents()
public boolean checkCleanState()
PropagationEngine
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |