|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectchoco.AbstractEntity
choco.palm.search.AbstractDecision
public abstract class AbstractDecision
A class representing a decision as a constraint (An adapter of decision constraint). It is useful to represent decision in a uniform way when the search algorithm performs assignments instead of posting constraints (As done by the AssignVar branching).
| Field Summary |
|---|
| Fields inherited from class choco.AbstractEntity |
|---|
hook, problem |
| Constructor Summary | |
|---|---|
AbstractDecision(AbstractProblem problem)
|
|
| Method Summary | |
|---|---|
void |
activateListener()
|
void |
addListener(boolean dynamicAddition)
This function connects a constraint with its variables in several ways. |
int |
assignIndices(AbstractCompositeConstraint root,
int i,
boolean dynamicAddition)
performs the global numbering (wrt root) of the variables contained in the subtree this, starting from i |
void |
awake()
Propagation: Propagating the constraint for the very first time until local consistency is reached. |
void |
awakeOnVar(int idx)
propagation on domain revision. |
java.lang.Object |
clone()
returns a copy of the constraint. |
void |
deactivateListener()
|
void |
deactivateListener(int varIndex)
|
int |
getConstraintIdx(int idx)
Network management: Among all listeners linked to the idx-th variable of c, find the index of constraint c. |
PropagationEvent |
getEvent()
Returns the constraint awake var associated with this constraint. |
ConstraintPlugin |
getPlugIn()
Returns the constraint plugin. |
int |
getPriority()
Propagation: Accessing the priority level of the queue handling the propagation of the constraint. |
int |
getVarIdxInOpposite(int i)
computes the index of the i-th variable in the counter-opposite of the constraint |
boolean |
isActive()
Propagation: A constraint is active if it is connected to the network and if it does propagate. |
boolean |
isConsistent()
tests if the constraint is consistent with respect to the current state of domains |
java.lang.Boolean |
isEntailed()
Checks whether the constraint is definitely satisfied, no matter what further restrictions occur to the domain of its variables. |
boolean |
isEquivalentTo(Constraint compareTo)
tests the equivalence (logical equality of the conditions) between two constraints. |
Constraint |
negate()
Returns the negation of this enumeration constraint. |
AbstractConstraint |
opposite()
computes the constraint modelling the counter-opposite condition of this |
void |
propagate()
Propagation: Propagating the constraint until local consistency is reached. |
void |
setActive()
Propagation: un-freezes a constraint [a constraint is active if it is connected to the network and if it does propagate] |
void |
setConstraintIndex(int i,
int idx)
Network management: Storing that among all listeners linked to the i-th variable of c, this (the current constraint) is found at index idx. |
void |
setPassive()
Propagation: freezes a constraint [a constraint is active if it is connected to the network and if it does propagate] |
void |
takeIntoAccountStatusChange(int index)
Informs constraints that one of their children has a modified status (due to value restoration). |
void |
updateDataStructuresOnConstraint(int idx,
int select,
int newValue,
int oldValue)
Method called when one of the variables is modified. |
void |
updateDataStructuresOnRestoreConstraint(int idx,
int select,
int newValue,
int oldValue)
Method called when one of the variables has a restored value. |
| Methods inherited from class choco.AbstractEntity |
|---|
getProblem, pretty |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface choco.palm.dbt.search.DecisionConstraint |
|---|
getBranch |
| Constructor Detail |
|---|
public AbstractDecision(AbstractProblem problem)
| Method Detail |
|---|
public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
Constraint
clone in interface Constraintclone in class java.lang.Objectjava.lang.CloneNotSupportedExceptionpublic ConstraintPlugin getPlugIn()
Propagator
getPlugIn in interface Propagatorpublic void takeIntoAccountStatusChange(int index)
PalmConstraint
takeIntoAccountStatusChange in interface PalmConstraint
public void updateDataStructuresOnConstraint(int idx,
int select,
int newValue,
int oldValue)
PalmVarListener
updateDataStructuresOnConstraint in interface PalmVarListeneridx - Index of the variable.select - Type of modification (PalmIntVar.INF, PalmIntVar.SUP,
PalmIntVar.VAL).newValue - New value (or modified value).oldValue - Old value (or 0 if this a value removal).
public void updateDataStructuresOnRestoreConstraint(int idx,
int select,
int newValue,
int oldValue)
PalmVarListener
updateDataStructuresOnRestoreConstraint in interface PalmVarListeneridx - Index of the variable.select - Type of modification.newValue - New value (or modified value).oldValue - Old value (or 0 if this a value removal).public Constraint negate()
DecisionConstraint
negate in interface DecisionConstraintpublic void addListener(boolean dynamicAddition)
VarEventListener
addListener in interface VarEventListenerpublic void deactivateListener(int varIndex)
public void deactivateListener()
public void activateListener()
public void setConstraintIndex(int i,
int idx)
Constraint
setConstraintIndex in interface ConstraintsetConstraintIndex in interface PalmVarListeneri - index of the variable in the constraintidx - index of the constraint in the among all listeners linked to that variablepublic int getConstraintIdx(int idx)
Constraint
getConstraintIdx in interface ConstraintgetConstraintIdx in interface PalmVarListeneridx - index of the variable in the constraint
public void awake()
throws ContradictionException
Propagator
awake in interface PropagatorContradictionException
public void awakeOnVar(int idx)
throws ContradictionException
VarEventListener
awakeOnVar in interface VarEventListenerawakeOnVar in interface PropagatorContradictionException
public void propagate()
throws ContradictionException
Propagator
propagate in interface PropagatorContradictionExceptionpublic int getPriority()
Propagator
getPriority in interface Propagatorpublic boolean isActive()
VarEventListener
isActive in interface VarEventListenerpublic void setActive()
VarEventListener
setActive in interface VarEventListenerpublic void setPassive()
VarEventListener
setPassive in interface VarEventListenerpublic PropagationEvent getEvent()
Propagator
getEvent in interface Propagatorpublic java.lang.Boolean isEntailed()
Propagator
isEntailed in interface Propagatorpublic boolean isConsistent()
Propagator
isConsistent in interface Propagatorpublic int getVarIdxInOpposite(int i)
Constraint
getVarIdxInOpposite in interface Constrainti - the index of the variable in the current constraint (this)
public AbstractConstraint opposite()
Constraint
opposite in interface Constraintpublic boolean isEquivalentTo(Constraint compareTo)
Constraint
isEquivalentTo in interface ConstraintcompareTo - the constraint to be compared to
public int assignIndices(AbstractCompositeConstraint root,
int i,
boolean dynamicAddition)
Propagator
assignIndices in interface Propagatorroot - the overall root constraint, for which the variables are numberedi - the index that will assigned to the first variable in the subtree this (originally 0)dynamicAddition - whether the addition is undone automatically on backtracking
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||