choco.palm.cbj.explain
Class JumpExplanation

java.lang.Object
  extended by choco.palm.cbj.explain.JumpExplanation
All Implemented Interfaces:
ConstraintCollection, Explanation
Direct Known Subclasses:
BendersExplanation

public class JumpExplanation
extends java.lang.Object
implements Explanation


Field Summary
protected  java.util.BitSet decisionConstraints
           
protected  java.util.BitSet originalConstraints
           
protected  java.util.BitSet originalStaticConstraints
           
protected  AbstractProblem pb
           
 
Constructor Summary
JumpExplanation(AbstractProblem pb)
           
JumpExplanation(int level, AbstractProblem pb)
           
 
Method Summary
 void add(int level)
           
 void add(int from, int to)
           
 void add(Propagator constraint)
          Adds a new constraint in the explain.
 void addAll(java.util.Collection collection)
          Adds several constraints at a time
 void clear()
          Deletes all indirect constraints.
 boolean contains(int level)
           
 boolean contains(Propagator ct)
          test if a constraint is in the collection
 boolean containsAll(ConstraintCollection collec)
          test inclusion
 ConstraintCollection copy()
          Clones the collection as a new one.
 void delete(int level)
           
 void delete(Propagator constraint)
          Deletes a constraint from the explain.
 void empties()
          Removes all constraints from this explanation.
 Propagator getConstraint(int i)
          return the i-th constraint of the explanation
 java.util.BitSet getDecisionBitSet()
           
 int getLastLevel(int currentLevel)
           
 SymbolicDecision[] getNogood()
          return the nogood associated to the explanation
 java.util.BitSet getOriginalConstraintBitSet()
           
 boolean isEmpty()
          Checks if the explain is empty (that is wether the size of the set is null).
 boolean isValid()
           
 void merge(ConstraintCollection collection)
          Merges an explain with the current one.
 int nogoodSize()
           
 int size()
          return the size of the bitSet
 java.util.Set toSet()
          Creates a set with all the constraints in the explain..
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

originalConstraints

protected java.util.BitSet originalConstraints

originalStaticConstraints

protected java.util.BitSet originalStaticConstraints

decisionConstraints

protected java.util.BitSet decisionConstraints

pb

protected AbstractProblem pb
Constructor Detail

JumpExplanation

public JumpExplanation(AbstractProblem pb)

JumpExplanation

public JumpExplanation(int level,
                       AbstractProblem pb)
Method Detail

merge

public void merge(ConstraintCollection collection)
Description copied from interface: ConstraintCollection
Merges an explain with the current one.

Specified by:
merge in interface ConstraintCollection
Parameters:
collection - The collection of constraints that must be added to this

copy

public ConstraintCollection copy()
Description copied from interface: ConstraintCollection
Clones the collection as a new one.

Specified by:
copy in interface ConstraintCollection

add

public void add(Propagator constraint)
Description copied from interface: ConstraintCollection
Adds a new constraint in the explain.

Specified by:
add in interface ConstraintCollection
Parameters:
constraint - The constraint that should be added to the explain. It must be a PalmConstraint.

add

public void add(int level)

add

public void add(int from,
                int to)

delete

public void delete(Propagator constraint)
Description copied from interface: ConstraintCollection
Deletes a constraint from the explain.

Specified by:
delete in interface ConstraintCollection
Parameters:
constraint - The constraint that must be removed.

delete

public void delete(int level)

addAll

public void addAll(java.util.Collection collection)
Description copied from interface: ConstraintCollection
Adds several constraints at a time

Specified by:
addAll in interface ConstraintCollection
Parameters:
collection - The set of constraints

isEmpty

public boolean isEmpty()
Description copied from interface: ConstraintCollection
Checks if the explain is empty (that is wether the size of the set is null).

Specified by:
isEmpty in interface ConstraintCollection

size

public int size()
Description copied from interface: ConstraintCollection
return the size of the bitSet

Specified by:
size in interface ConstraintCollection

clear

public void clear()
Description copied from interface: ConstraintCollection
Deletes all indirect constraints.

Specified by:
clear in interface ConstraintCollection

contains

public boolean contains(Propagator ct)
Description copied from interface: ConstraintCollection
test if a constraint is in the collection

Specified by:
contains in interface ConstraintCollection

contains

public boolean contains(int level)

getLastLevel

public int getLastLevel(int currentLevel)

containsAll

public boolean containsAll(ConstraintCollection collec)
Description copied from interface: ConstraintCollection
test inclusion

Specified by:
containsAll in interface ConstraintCollection

toSet

public java.util.Set toSet()
Description copied from interface: Explanation
Creates a set with all the constraints in the explain..

Specified by:
toSet in interface Explanation
Returns:
The explain as a set.

isValid

public boolean isValid()

empties

public void empties()
Description copied from interface: Explanation
Removes all constraints from this explanation.

Specified by:
empties in interface Explanation

nogoodSize

public int nogoodSize()

getDecisionBitSet

public java.util.BitSet getDecisionBitSet()

getOriginalConstraintBitSet

public java.util.BitSet getOriginalConstraintBitSet()

getConstraint

public Propagator getConstraint(int i)
Description copied from interface: Explanation
return the i-th constraint of the explanation

Specified by:
getConstraint in interface Explanation
Parameters:
i - : the number of the constraint to return

getNogood

public SymbolicDecision[] getNogood()
Description copied from interface: Explanation
return the nogood associated to the explanation

Specified by:
getNogood in interface Explanation

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object