choco.palm.cbj.integer
Class JumpBitSetIntDomain

java.lang.Object
  extended by choco.AbstractEntity
      extended by choco.integer.var.AbstractIntDomain
          extended by choco.integer.var.BitSetIntDomain
              extended by choco.palm.cbj.integer.JumpBitSetIntDomain
All Implemented Interfaces:
Entity, IntDomain, ExplainedDomain, ExplainedIntDomain

public class JumpBitSetIntDomain
extends BitSetIntDomain
implements ExplainedIntDomain


Nested Class Summary
 
Nested classes/interfaces inherited from class choco.integer.var.BitSetIntDomain
BitSetIntDomain.DeltaIntDomainIterator
 
Nested classes/interfaces inherited from class choco.integer.var.AbstractIntDomain
AbstractIntDomain.IntDomainIterator
 
Field Summary
 Explanation[] explanationOnVal
          A list of explanations for value withdrawals.
 java.util.BitSet originalDomain
          original domain of the variable
 
Fields inherited from class choco.integer.var.BitSetIntDomain
capacity, chain, contents, firstIndexBeingPropagated, firstIndexToBePropagated, offset, random, size
 
Fields inherited from class choco.integer.var.AbstractIntDomain
currentInfPropagated, currentSupPropagated, logger, variable
 
Fields inherited from class choco.AbstractEntity
hook, problem
 
Fields inherited from interface choco.palm.integer.ExplainedIntDomain
DOM, INF, SUP, VAL
 
Constructor Summary
JumpBitSetIntDomain(IntDomainVarImpl v, int[] sortedValues)
           
JumpBitSetIntDomain(IntDomainVarImpl v, int a, int b)
           
 
Method Summary
 boolean contains(int val)
          Checks if the value is in the domain.
 int[] getAllValues()
          Returns all the value currently in the domain.
 int getOriginalInf()
          Returns the original lower bound.
 int getOriginalSup()
          Returns the original upper bound.
protected  boolean removeVal(int value, Explanation e)
           
 boolean removeVal(int value, int idx, Explanation e)
          Removes a value and posts the event.
 void self_explain(int select, Explanation expl)
          Allows to get an explanation for the domain or a bound of the variable.
 void self_explain(int select, int x, Explanation expl)
          Allows to get an explanation for a value removal from the variable.
 boolean updateInf(int x, int idx, Explanation e)
          Updates the lower bound and posts the event.
 boolean updateSup(int x, int idx, Explanation e)
          Updates the upper bound and posts the event.
 
Methods inherited from class choco.integer.var.BitSetIntDomain
clearDeltaDomain, freezeDeltaDomain, getDeltaIterator, getInf, getNextValue, getPrevValue, getRandomValue, getReleasedDeltaDomain, getSize, getSup, hasNextValue, hasPrevValue, isEnumerated, pretty, releaseDeltaDomain, remove, restrict, toString, updateInf, updateSup
 
Methods inherited from class choco.integer.var.AbstractIntDomain
_instantiate, _removeVal, _updateInf, _updateSup, getIterator, instantiate, removeInterval, removeVal, updateInf, updateSup
 
Methods inherited from class choco.AbstractEntity
getProblem
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface choco.integer.var.IntDomain
clearDeltaDomain, freezeDeltaDomain, getDeltaIterator, getInf, getIterator, getNextValue, getPrevValue, getRandomValue, getReleasedDeltaDomain, getSize, getSup, hasNextValue, hasPrevValue, isEnumerated, releaseDeltaDomain, remove, restrict, updateInf, updateSup
 
Methods inherited from interface choco.Entity
getProblem, pretty
 

Field Detail

explanationOnVal

public Explanation[] explanationOnVal
A list of explanations for value withdrawals.


originalDomain

public java.util.BitSet originalDomain
original domain of the variable

Constructor Detail

JumpBitSetIntDomain

public JumpBitSetIntDomain(IntDomainVarImpl v,
                           int a,
                           int b)

JumpBitSetIntDomain

public JumpBitSetIntDomain(IntDomainVarImpl v,
                           int[] sortedValues)
Method Detail

getOriginalInf

public int getOriginalInf()
Returns the original lower bound.

Specified by:
getOriginalInf in interface ExplainedDomain

getOriginalSup

public int getOriginalSup()
Returns the original upper bound.

Specified by:
getOriginalSup in interface ExplainedDomain

getAllValues

public int[] getAllValues()
Returns all the value currently in the domain.

Specified by:
getAllValues in interface ExplainedIntDomain

updateInf

public boolean updateInf(int x,
                         int idx,
                         Explanation e)
                  throws ContradictionException
Updates the lower bound and posts the event.

Specified by:
updateInf in interface ExplainedIntDomain
Throws:
ContradictionException

updateSup

public boolean updateSup(int x,
                         int idx,
                         Explanation e)
                  throws ContradictionException
Updates the upper bound and posts the event.

Specified by:
updateSup in interface ExplainedIntDomain
Throws:
ContradictionException

removeVal

public boolean removeVal(int value,
                         int idx,
                         Explanation e)
                  throws ContradictionException
Removes a value and posts the event.

Specified by:
removeVal in interface ExplainedIntDomain
Throws:
ContradictionException

self_explain

public void self_explain(int select,
                         Explanation expl)
Allows to get an explanation for the domain or a bound of the variable. This explanation is merge to the explanation in parameter.

Specified by:
self_explain in interface ExplainedDomain
Parameters:
select - Should be PalmIntDomain.INF, PalmIntDomain.SUP, or PalmIntDomain.DOM

self_explain

public void self_explain(int select,
                         int x,
                         Explanation expl)
Allows to get an explanation for a value removal from the variable. This explanation is merge to the explanation in parameter.

Specified by:
self_explain in interface ExplainedIntDomain
Parameters:
select - Should be PalmIntDomain.VAL

contains

public boolean contains(int val)
Checks if the value is in the domain. Basically it checks if the value is in the original domain and if this case only calls the super method.

Specified by:
contains in interface IntDomain
Overrides:
contains in class BitSetIntDomain
Parameters:
val - The value to check.

removeVal

protected boolean removeVal(int value,
                            Explanation e)