|
|||||||||
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.Object
public java.lang.String toString()
toString
in class java.lang.Object
public void add(Propagator constraint)
add
in interface ConstraintCollection
constraint
- The constraint that should be added to the explain.
It must be a PalmConstraint
.public void delete(Propagator constraint)
delete
in interface ConstraintCollection
constraint
- The constraint that must be removed.public void addAll(java.util.Collection collection)
ConstraintCollection
addAll
in interface ConstraintCollection
collection
- The set of constraintspublic void merge(ConstraintCollection explanation)
merge
in interface ConstraintCollection
explanation
- The explain with the constraints to add.public boolean isEmpty()
isEmpty
in interface ConstraintCollection
public int size()
size
in interface ConstraintCollection
public void empties()
empties
in interface Explanation
public java.util.Set toSet()
toSet
in interface Explanation
public java.util.BitSet getBitSet()
getBitSet
in interface PalmExplanation
public boolean contains(Propagator constraint)
contains
in interface ConstraintCollection
constraint
- The constraint to search.public ConstraintCollection copy()
copy
in interface ConstraintCollection
public boolean isValid()
isValid
in interface PalmExplanation
public boolean isValid(int time)
PalmExplanation
isValid
in interface PalmExplanation
public boolean containsAll(ConstraintCollection expl)
containsAll
in interface ConstraintCollection
expl
- The explain that is tested to be included.public void clear()
clear
in interface ConstraintCollection
public void addDependencies()
public void removeDependencies(Constraint removed)
removed
- public IBoundExplanation makeIncInfExplanation(int inf, PalmIntVar var)
makeIncInfExplanation
in interface PalmExplanation
inf
- The previous value of the bound.var
- The involved variable.public IBoundExplanation makeDecSupExplanation(int sup, PalmIntVar var)
makeDecSupExplanation
in interface PalmExplanation
sup
- The previous value of the bound.var
- The involved variable.public IRemovalExplanation makeRemovalExplanation(int value, PalmIntVar var)
makeRemovalExplanation
in interface PalmExplanation
value
- The removed value of the domain.var
- The involved variable.public RealBoundExplanation makeIncInfExplanation(double inf, PalmRealVar var)
makeIncInfExplanation
in interface PalmExplanation
inf
- The previous value of the bound.var
- The involved variable.public RealBoundExplanation makeDecSupExplanation(double sup, PalmRealVar var)
makeDecSupExplanation
in interface PalmExplanation
sup
- The previous value of the bound.var
- The involved variable.public void postUndoRemoval(Constraint constraint)
postUndoRemoval
in interface PalmExplanation
constraint
- public java.util.Set toNogood()
public Propagator getConstraint(int i)
Explanation
getConstraint
in interface Explanation
i
- : 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 |