choco.palm.cbj.integer
Class JumpIntervalIntDomain

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

public class JumpIntervalIntDomain
extends IntervalIntDomain
implements ExplainedIntDomain


Nested Class Summary
 
Nested classes/interfaces inherited from class choco.integer.var.AbstractIntDomain
AbstractIntDomain.IntDomainIterator
 
Field Summary
protected  java.util.LinkedList explanationOnInf
          A stack of explanations for lower bound modifications.
protected  java.util.LinkedList explanationOnSup
          A stack of explanations for upper bound modifications.
protected  StoredInt nbexpinf
          The number of valid inf explanation at the current world level
protected  StoredInt nbexpsup
          The number of valid inf explanation at the current world level
protected  int originalInf
          Original lower bound.
protected  int originalSup
          Original upper bound.
 
Fields inherited from class choco.integer.var.IntervalIntDomain
inf, random, sup
 
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
JumpIntervalIntDomain(IntDomainVarImpl v, int a, int b)
          Builds a interval domain for the specified variable.
 
Method Summary
 void ensureUpToDateExplanations()
           
 int[] getAllValues()
          Returns all the value currently in the domain.
 int getOriginalInf()
          Returns the original lower bound.
 int getOriginalSup()
          Returns the original upper bound.
 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.
protected  boolean updateInf(int x, Explanation e)
           
 boolean updateInf(int x, int idx, Explanation e)
          Updates the lower bound and posts the event.
protected  boolean updateSup(int x, Explanation e)
           
 boolean updateSup(int x, int idx, Explanation e)
          Updates the upper bound and posts the event.
 
Methods inherited from class choco.integer.var.IntervalIntDomain
_removeVal, contains, getDeltaIterator, getInf, getIterator, getNextValue, getPrevValue, getRandomValue, getSize, getSup, hasNextValue, hasPrevValue, isEnumerated, pretty, remove, restrict, updateInf, updateSup
 
Methods inherited from class choco.integer.var.AbstractIntDomain
_instantiate, _updateInf, _updateSup, clearDeltaDomain, freezeDeltaDomain, getReleasedDeltaDomain, instantiate, releaseDeltaDomain, 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, toString, wait, wait, wait
 
Methods inherited from interface choco.integer.var.IntDomain
clearDeltaDomain, contains, 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

explanationOnInf

protected final java.util.LinkedList explanationOnInf
A stack of explanations for lower bound modifications.


explanationOnSup

protected final java.util.LinkedList explanationOnSup
A stack of explanations for upper bound modifications.


nbexpinf

protected StoredInt nbexpinf
The number of valid inf explanation at the current world level


nbexpsup

protected StoredInt nbexpsup
The number of valid inf explanation at the current world level


originalInf

protected final int originalInf
Original lower bound.


originalSup

protected final int originalSup
Original upper bound.

Constructor Detail

JumpIntervalIntDomain

public JumpIntervalIntDomain(IntDomainVarImpl v,
                             int a,
                             int b)
Builds a interval domain for the specified variable.

Parameters:
v - Involved variable.
a - Lower bound.
b - Upper bound.
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

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

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

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

ensureUpToDateExplanations

public void ensureUpToDateExplanations()

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

updateSup

protected boolean updateSup(int x,
                            Explanation e)

updateInf

protected boolean updateInf(int x,
                            Explanation e)