choco.palm.real
Class PalmRealVarImpl

java.lang.Object
  extended by choco.AbstractEntity
      extended by choco.AbstractVar
          extended by choco.real.var.RealVarImpl
              extended by choco.palm.real.PalmRealVarImpl
All Implemented Interfaces:
Entity, PalmVar, ExplainedVar, PalmRealInterval, PalmRealVar, RealExp, RealInterval, RealVar, Var

public class PalmRealVarImpl
extends RealVarImpl
implements PalmRealVar

Default implementation of PaLM real variables.


Field Summary
 
Fields inherited from class choco.real.var.RealVarImpl
domain
 
Fields inherited from class choco.AbstractVar
constraints, event, indices, name
 
Fields inherited from class choco.AbstractEntity
hook, problem
 
Fields inherited from interface choco.palm.real.PalmRealInterval
DOM, INF, SUP
 
Constructor Summary
PalmRealVarImpl(AbstractProblem pb, java.lang.String name, double a, double b)
          Creates a variable with the specified bounds and the specified name.
 
Method Summary
 int addConstraint(Constraint c, int varIdx)
          Adds a new constraints, and makes it active if needed.
 Constraint getDecisionConstraint(int val)
          Returns the decision constraint for the ith branch on the current domain.
 void resetExplanationOnInf()
          Updates lower bound explanations: it removes not up-to-date explanations.
 void resetExplanationOnSup()
          Updates upper bound explanations: it removes not up-to-date explanations.
 void restoreInf(double newValue)
          Lower bound of the domain should be restored to the specified value.
 void restoreSup(double newValue)
          Upper bound of the domain should be restored to the specified value.
 void self_explain(int select, Explanation e)
          Merge explanation of the specified part of the domain to a constraint collection.
 java.lang.String toString()
          The name of the variable.
 void updateDecisionConstraints()
          Updates decision constraints on this variable: it removes all erased constraints.
 
Methods inherited from class choco.real.var.RealVarImpl
collectVars, fail, getDomain, getInf, getSup, getValue, intersect, intersect, isInstantiated, isolate, project, silentlyAssign, subExps, tighten
 
Methods inherited from class choco.AbstractVar
addConstraint, eraseConstraint, getConstraint, getConstraintsIterator, getConstraintVector, getEvent, getIndexVector, getNbConstraints, getVarIndex
 
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.RealVar
getDomain, getValue, silentlyAssign
 
Methods inherited from interface choco.real.RealExp
collectVars, isolate, project, subExps, tighten
 
Methods inherited from interface choco.real.RealInterval
getInf, getSup, intersect, intersect
 

Constructor Detail

PalmRealVarImpl

public PalmRealVarImpl(AbstractProblem pb,
                       java.lang.String name,
                       double a,
                       double b)
Creates a variable with the specified bounds and the specified name.

Method Detail

toString

public java.lang.String toString()
The name of the variable.

Overrides:
toString in class RealVarImpl
Returns:
the name of the variable

resetExplanationOnInf

public void resetExplanationOnInf()
Updates lower bound explanations: it removes not up-to-date explanations.

Specified by:
resetExplanationOnInf in interface PalmRealVar

resetExplanationOnSup

public void resetExplanationOnSup()
Updates upper bound explanations: it removes not up-to-date explanations.

Specified by:
resetExplanationOnSup in interface PalmRealVar

updateDecisionConstraints

public void updateDecisionConstraints()
Updates decision constraints on this variable: it removes all erased constraints.

Specified by:
updateDecisionConstraints in interface PalmRealVar

restoreInf

public void restoreInf(double newValue)
Lower bound of the domain should be restored to the specified value.

Specified by:
restoreInf in interface PalmRealVar

restoreSup

public void restoreSup(double newValue)
Upper bound of the domain should be restored to the specified value.

Specified by:
restoreSup in interface PalmRealVar

self_explain

public void self_explain(int select,
                         Explanation e)
Merge explanation of the specified part of the domain to a constraint collection.

Specified by:
self_explain in interface ExplainedVar
Specified by:
self_explain in interface PalmRealInterval

getDecisionConstraint

public Constraint getDecisionConstraint(int val)
Description copied from interface: PalmVar
Returns the decision constraint for the ith branch on the current domain.

Specified by:
getDecisionConstraint in interface PalmVar

addConstraint

public int addConstraint(Constraint c,
                         int varIdx)
Adds a new constraints, and makes it active if needed.