choco.palm.real.exp
Class AbstractPalmRealBinTerm

java.lang.Object
  extended by choco.AbstractEntity
      extended by choco.real.exp.AbstractRealCompoundTerm
          extended by choco.real.exp.AbstractRealBinTerm
              extended by choco.palm.real.exp.AbstractPalmRealBinTerm
All Implemented Interfaces:
Entity, PalmRealInterval, RealExp, RealInterval
Direct Known Subclasses:
PalmRealMinus, PalmRealMult, PalmRealPlus

public abstract class AbstractPalmRealBinTerm
extends AbstractRealBinTerm
implements PalmRealInterval

Abstract implementation of a real binary term (like addition for instance).


Field Summary
protected  Explanation explanationOnInf
          Explanation of the last lower bound affectation.
protected  Explanation explanationOnSup
          Explanation of the last upper bound affectation.
 
Fields inherited from class choco.real.exp.AbstractRealBinTerm
exp1, exp2
 
Fields inherited from class choco.real.exp.AbstractRealCompoundTerm
inf, sup
 
Fields inherited from class choco.AbstractEntity
hook, problem
 
Fields inherited from interface choco.palm.real.PalmRealInterval
DOM, INF, SUP
 
Constructor Summary
AbstractPalmRealBinTerm(AbstractProblem pb, RealExp exp1, RealExp exp2)
          Creates an abstract binary term with the two sub-expressions.
 
Method Summary
 void intersect(RealInterval interval, int index)
          Updates the interval such that this interval is included in the interval parameter.
 void self_explain(int select, Explanation e)
          Explains the state of this expression (lower/upper bounds or all domain).
 
Methods inherited from class choco.real.exp.AbstractRealBinTerm
collectVars, isolate, subExps
 
Methods inherited from class choco.real.exp.AbstractRealCompoundTerm
getInf, getSup, intersect, toString
 
Methods inherited from class choco.AbstractEntity
getProblem, pretty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface choco.real.RealInterval
getInf, getSup, intersect
 
Methods inherited from interface choco.real.RealExp
project, tighten
 

Field Detail

explanationOnInf

protected Explanation explanationOnInf
Explanation of the last lower bound affectation.


explanationOnSup

protected Explanation explanationOnSup
Explanation of the last upper bound affectation.

Constructor Detail

AbstractPalmRealBinTerm

public AbstractPalmRealBinTerm(AbstractProblem pb,
                               RealExp exp1,
                               RealExp exp2)
Creates an abstract binary term with the two sub-expressions.

Parameters:
pb - the problem of this constraint
exp1 - the first expression operand
exp2 - the second expression operand
Method Detail

intersect

public void intersect(RealInterval interval,
                      int index)
               throws ContradictionException
Updates the interval such that this interval is included in the interval parameter.

Specified by:
intersect in interface RealInterval
Overrides:
intersect in class AbstractRealCompoundTerm
Parameters:
interval - The interval this expression should be included in
index - The index of the constraint responsible of this reduction
Throws:
ContradictionException - if a domain becomes empty or if a contradiction can be infered

self_explain

public void self_explain(int select,
                         Explanation e)
Explains the state of this expression (lower/upper bounds or all domain).

Specified by:
self_explain in interface PalmRealInterval
Parameters:
select - Specifies which part of the domain should be explained.
e - Specifies the explanation in which these explaining constraints should be added.