|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectchoco.palm.dbt.explain.GenericExplanation
public class GenericExplanation
Generic implementation of explanations. It is used by filtering algorithms before specializing them for specific use (bound modification, value removal, contradiction...).
| Field Summary | |
|---|---|
protected java.util.BitSet |
explanation
Set of all the constraint in the explain. |
protected PalmProblem |
pb
The current problem. |
protected int |
timeStamp
|
| Constructor Summary | |
|---|---|
GenericExplanation(AbstractProblem pb)
Initializes the explain set. |
|
| Method Summary | |
|---|---|
void |
add(Propagator constraint)
Adds a new constraint in the explain. |
void |
addAll(java.util.Collection collection)
Adds several constraints at a time |
void |
addDependencies()
Updates dependencies. |
void |
clear()
Deletes all indirect constraints. |
boolean |
contains(Propagator constraint)
Checks if the explain contains a constraint. |
boolean |
containsAll(ConstraintCollection expl)
Checks if another explain is included in this one. |
ConstraintCollection |
copy()
Clones the explain as a new one. |
void |
delete(Propagator constraint)
Deletes a constraint from the explain. |
void |
empties()
Clears the constraint set. |
java.util.BitSet |
getBitSet()
Copies the explain set and returns the new bitset. |
Propagator |
getConstraint(int i)
return the i-th constraint of the explanation |
SymbolicDecision[] |
getNogood()
return the nogood associated to the explanation |
int |
hashCode()
|
boolean |
isEmpty()
Checks if the explain is empty (that is wether the size of the set is null). |
boolean |
isValid()
Checks if the explain is valid, that is wether all the constraint are active. |
boolean |
isValid(int time)
Checks if the explain is valid, that is wether all the constraint are active. |
RealBoundExplanation |
makeDecSupExplanation(double sup,
PalmRealVar var)
Makes a DecSupExplanation from the current explain by adding dependencies. |
IBoundExplanation |
makeDecSupExplanation(int sup,
PalmIntVar var)
Makes a DecSupExplanation from the current explain by adding dependencies. |
RealBoundExplanation |
makeIncInfExplanation(double inf,
PalmRealVar var)
Makes an IncInfExplanation from the current explain by adding dependencies. |
IBoundExplanation |
makeIncInfExplanation(int inf,
PalmIntVar var)
Makes an IncInfExplanation from the current explain by adding dependencies. |
IRemovalExplanation |
makeRemovalExplanation(int value,
PalmIntVar var)
Makes a RemovalExplanation from the current explain by adding dependencies. |
void |
merge(ConstraintCollection explanation)
Merges an explain in the current one. |
void |
postUndoRemoval(Constraint constraint)
Posts a restoration prop. |
static void |
reinitTimestamp()
|
void |
removeDependencies(Constraint removed)
Removes all dependencies except for one constraint. |
int |
size()
Get the size of the bitSet |
java.util.Set |
toNogood()
|
java.util.Set |
toSet()
Creates a set with all the constraints in the explain. |
java.lang.String |
toString()
Pretty print of the explain. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected int timeStamp
protected java.util.BitSet explanation
protected PalmProblem pb
| Constructor Detail |
|---|
public GenericExplanation(AbstractProblem pb)
| Method Detail |
|---|
public static void reinitTimestamp()
public int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic void add(Propagator constraint)
add in interface ConstraintCollectionconstraint - The constraint that should be added to the explain.
It must be a PalmConstraint.public void delete(Propagator constraint)
delete in interface ConstraintCollectionconstraint - The constraint that must be removed.public void addAll(java.util.Collection collection)
ConstraintCollection
addAll in interface ConstraintCollectioncollection - The set of constraintspublic void merge(ConstraintCollection explanation)
merge in interface ConstraintCollectionexplanation - The explain with the constraints to add.public boolean isEmpty()
isEmpty in interface ConstraintCollectionpublic int size()
size in interface ConstraintCollectionpublic void empties()
empties in interface Explanationpublic java.util.Set toSet()
toSet in interface Explanationpublic java.util.BitSet getBitSet()
getBitSet in interface PalmExplanationpublic boolean contains(Propagator constraint)
contains in interface ConstraintCollectionconstraint - The constraint to search.public ConstraintCollection copy()
copy in interface ConstraintCollectionpublic boolean isValid()
isValid in interface PalmExplanationpublic boolean isValid(int time)
PalmExplanation
isValid in interface PalmExplanationpublic boolean containsAll(ConstraintCollection expl)
containsAll in interface ConstraintCollectionexpl - The explain that is tested to be included.public void clear()
clear in interface ConstraintCollectionpublic void addDependencies()
public void removeDependencies(Constraint removed)
removed -
public IBoundExplanation makeIncInfExplanation(int inf,
PalmIntVar var)
makeIncInfExplanation in interface PalmExplanationinf - The previous value of the bound.var - The involved variable.
public IBoundExplanation makeDecSupExplanation(int sup,
PalmIntVar var)
makeDecSupExplanation in interface PalmExplanationsup - The previous value of the bound.var - The involved variable.
public IRemovalExplanation makeRemovalExplanation(int value,
PalmIntVar var)
makeRemovalExplanation in interface PalmExplanationvalue - The removed value of the domain.var - The involved variable.
public RealBoundExplanation makeIncInfExplanation(double inf,
PalmRealVar var)
makeIncInfExplanation in interface PalmExplanationinf - The previous value of the bound.var - The involved variable.
public RealBoundExplanation makeDecSupExplanation(double sup,
PalmRealVar var)
makeDecSupExplanation in interface PalmExplanationsup - The previous value of the bound.var - The involved variable.public void postUndoRemoval(Constraint constraint)
postUndoRemoval in interface PalmExplanationconstraint - public java.util.Set toNogood()
public Propagator getConstraint(int i)
Explanation
getConstraint in interface Explanationi - : the number of the constraint to returnpublic SymbolicDecision[] getNogood()
Explanation
getNogood in interface Explanation
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||