choco.real.var
Class RealDomainImpl

java.lang.Object
  extended by choco.AbstractEntity
      extended by choco.real.var.RealDomainImpl
All Implemented Interfaces:
Entity, RealInterval, RealDomain
Direct Known Subclasses:
PalmRealDomainImpl

public class RealDomainImpl
extends AbstractEntity
implements RealDomain

An implmentation of real variable domains using two stored floats for storing bounds.


Field Summary
protected  double currentInfPropagated
          for the delta domain: current value of the inf (domain lower bound) when the bound started beeing propagated (just to check that it does not change during the propagation phase)
protected  double currentSupPropagated
          for the delta domain: current value of the sup (domain upper bound) when the bound started beeing propagated (just to check that it does not change during the propagation phase)
protected  StoredFloat inf
           
protected  StoredFloat sup
           
protected  RealVar variable
           
 
Fields inherited from class choco.AbstractEntity
hook, problem
 
Constructor Summary
RealDomainImpl(RealVar v, double a, double b)
           
 
Method Summary
 void clearDeltaDomain()
           
 void freezeDeltaDomain()
           
 double getInf()
           
 boolean getReleasedDeltaDomain()
           
 double getSup()
           
 void intersect(RealInterval interval)
          Modifies the bounds for intersecting with the specified interval.
 void intersect(RealInterval interval, int index)
          Modifies the bounds for intersecting with the specified interval.
 java.lang.String pretty()
          pretty printing of the object.
 boolean releaseDeltaDomain()
           
 void silentlyAssign(RealInterval i)
           
 
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.Entity
getProblem
 

Field Detail

currentInfPropagated

protected double currentInfPropagated
for the delta domain: current value of the inf (domain lower bound) when the bound started beeing propagated (just to check that it does not change during the propagation phase)


currentSupPropagated

protected double currentSupPropagated
for the delta domain: current value of the sup (domain upper bound) when the bound started beeing propagated (just to check that it does not change during the propagation phase)


inf

protected StoredFloat inf

sup

protected StoredFloat sup

variable

protected RealVar variable
Constructor Detail

RealDomainImpl

public RealDomainImpl(RealVar v,
                      double a,
                      double b)
Method Detail

pretty

public java.lang.String pretty()
Description copied from interface: Entity
pretty printing of the object. This String is not constant and may depend on the context.

Specified by:
pretty in interface Entity
Overrides:
pretty in class AbstractEntity
Returns:
a readable string representation of the object

getInf

public double getInf()
Specified by:
getInf in interface RealInterval
Returns:
the lower bound.

getSup

public double getSup()
Specified by:
getSup in interface RealInterval
Returns:
the upper bound.

intersect

public void intersect(RealInterval interval)
               throws ContradictionException
Description copied from interface: RealInterval
Modifies the bounds for intersecting with the specified interval.

Specified by:
intersect in interface RealInterval
Throws:
ContradictionException

intersect

public void intersect(RealInterval interval,
                      int index)
               throws ContradictionException
Description copied from interface: RealInterval
Modifies the bounds for intersecting with the specified interval.

Specified by:
intersect in interface RealInterval
index - of the constraint responsible to this withdraw
Throws:
ContradictionException

clearDeltaDomain

public void clearDeltaDomain()
Specified by:
clearDeltaDomain in interface RealDomain

releaseDeltaDomain

public boolean releaseDeltaDomain()
Specified by:
releaseDeltaDomain in interface RealDomain

freezeDeltaDomain

public void freezeDeltaDomain()
Specified by:
freezeDeltaDomain in interface RealDomain

getReleasedDeltaDomain

public boolean getReleasedDeltaDomain()
Specified by:
getReleasedDeltaDomain in interface RealDomain

silentlyAssign

public void silentlyAssign(RealInterval i)
Specified by:
silentlyAssign in interface RealDomain