choco.palm.real
Class PalmRealDomainImpl

java.lang.Object
  extended by choco.AbstractEntity
      extended by choco.real.var.RealDomainImpl
          extended by choco.palm.real.PalmRealDomainImpl
All Implemented Interfaces:
Entity, PalmRealDomain, PalmRealInterval, RealInterval, RealDomain

public class PalmRealDomainImpl
extends RealDomainImpl
implements PalmRealDomain

Default implementation of PaLM real domain.


Field Summary
protected  PalmExplanation decisionConstraints
          All active decision constraints on this variable (except the last one).
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  Constraint lastDC
          Last decision constraint.
protected  double originalInf
          Original lower bound.
protected  double originalSup
          Original upper bound.
protected  boolean silent
          States if modfication should be quiet, that is no PaLM must be created when the bounds are modified.
 
Fields inherited from class choco.real.var.RealDomainImpl
currentInfPropagated, currentSupPropagated, inf, sup, variable
 
Fields inherited from class choco.AbstractEntity
hook, problem
 
Fields inherited from interface choco.palm.real.PalmRealInterval
DOM, INF, SUP
 
Constructor Summary
PalmRealDomainImpl(RealVar v, double a, double b)
          Creates a real domain for the specified variable.
 
Method Summary
 void addDecisionConstraint(AbstractConstraint cst)
          Adds a new decision constraint on this variable.
 ConstraintCollection getDecisionConstraints()
          Returns all decision constraints.
 double getOriginalInf()
          Returns the original lower bound.
 double getOriginalSup()
          Returns the original upper bound.
 void intersect(RealInterval interval, int index)
          Makes this domain be included in the specified interval.
 void resetExplanationOnInf()
          Reset lower bound explanatioins: not up-to-date explanations are removed.
 void resetExplanationOnSup()
          Reset upper bound explanatioins: not up-to-date explanations are removed.
 void restoreInf(double newValue)
          Restores lower bound to the specified value.
 void restoreSup(double newValue)
          Restores upper bound to the specified value.
 void self_explain(int select, Explanation e)
          Explains the state of this domain
 void silentlyAssign(RealInterval i)
          Quietly assign this domain to the values of the specified interval.
 void updateDecisionConstraints()
          Updates decision constraints by removing not up-to-date ones.
 
Methods inherited from class choco.real.var.RealDomainImpl
clearDeltaDomain, freezeDeltaDomain, getInf, getReleasedDeltaDomain, getSup, intersect, pretty, releaseDeltaDomain
 
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.real.var.RealDomain
clearDeltaDomain, freezeDeltaDomain, getReleasedDeltaDomain, releaseDeltaDomain
 
Methods inherited from interface choco.Entity
getProblem, pretty
 
Methods inherited from interface choco.real.RealInterval
getInf, getSup, intersect
 
Methods inherited from interface choco.real.RealInterval
getInf, getSup, intersect
 

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.


originalInf

protected final double originalInf
Original lower bound.


originalSup

protected final double originalSup
Original upper bound.


decisionConstraints

protected PalmExplanation decisionConstraints
All active decision constraints on this variable (except the last one).


lastDC

protected Constraint lastDC
Last decision constraint.


silent

protected boolean silent
States if modfication should be quiet, that is no PaLM must be created when the bounds are modified.

Constructor Detail

PalmRealDomainImpl

public PalmRealDomainImpl(RealVar v,
                          double a,
                          double b)
Creates a real domain for the specified variable.

Method Detail

getDecisionConstraints

public ConstraintCollection getDecisionConstraints()
Returns all decision constraints.

Specified by:
getDecisionConstraints in interface PalmRealDomain

addDecisionConstraint

public void addDecisionConstraint(AbstractConstraint cst)
Adds a new decision constraint on this variable.

Specified by:
addDecisionConstraint in interface PalmRealDomain

getOriginalInf

public double getOriginalInf()
Returns the original lower bound.


getOriginalSup

public double getOriginalSup()
Returns the original upper bound.


intersect

public void intersect(RealInterval interval,
                      int index)
               throws ContradictionException
Makes this domain be included in the specified interval.

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

silentlyAssign

public void silentlyAssign(RealInterval i)
Quietly assign this domain to the values of the specified interval. No PaLM events are trown.

Specified by:
silentlyAssign in interface RealDomain
Overrides:
silentlyAssign in class RealDomainImpl

self_explain

public void self_explain(int select,
                         Explanation e)
Explains the state of this domain

Specified by:
self_explain in interface PalmRealInterval
Parameters:
select - The part of the domain that should be explained
e - Constraint collection this explanation must be added to.

restoreInf

public void restoreInf(double newValue)
Restores lower bound to the specified value.

Specified by:
restoreInf in interface PalmRealDomain

restoreSup

public void restoreSup(double newValue)
Restores upper bound to the specified value.

Specified by:
restoreSup in interface PalmRealDomain

resetExplanationOnInf

public void resetExplanationOnInf()
Reset lower bound explanatioins: not up-to-date explanations are removed.

Specified by:
resetExplanationOnInf in interface PalmRealDomain

resetExplanationOnSup

public void resetExplanationOnSup()
Reset upper bound explanatioins: not up-to-date explanations are removed.

Specified by:
resetExplanationOnSup in interface PalmRealDomain

updateDecisionConstraints

public void updateDecisionConstraints()
Updates decision constraints by removing not up-to-date ones.

Specified by:
updateDecisionConstraints in interface PalmRealDomain