-
- All Superinterfaces:
CArExpression
,Comparable<Variable>
,Identity
,Variable
- All Known Implementing Classes:
FixedRealVarImpl
,RealVarImpl
,RealView
public interface RealVar extends Variable, CArExpression
An interface to declare variable for continuous constraints (solved using IBEX).- Since:
- 18/07/12
- Author:
- Charles Prud'homme
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.chocosolver.solver.expression.continuous.arithmetic.CArExpression
CArExpression.Operator
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description double
getLB()
Retrieves the lower bound of the variabledouble
getPrecision()
double
getUB()
Retrieves the upper bound of the variabledefault RealVar
realVar(double p)
boolean
updateBounds(double lowerbound, double upperbound, ICause cause)
Updates the bounds of the domain ofthis
tovalue
.boolean
updateLowerBound(double value, ICause cause)
Updates the lower bound of the domain ofthis
tovalue
.boolean
updateUpperBound(double value, ICause cause)
Updates the upper bound of the domain ofthis
tovalue
.-
Methods inherited from interface org.chocosolver.solver.expression.continuous.arithmetic.CArExpression
abs, acos, acosh, add, add, asin, asinh, atan, atan2, atan2, atanh, cos, cosh, div, div, eq, eq, exp, ge, ge, getModel, gt, gt, le, le, ln, lt, lt, max, max, min, min, mul, mul, neg, pow, pow, sin, sinh, sqrt, sub, sub, tan, tanh
-
Methods inherited from interface java.lang.Comparable
compareTo
-
Methods inherited from interface org.chocosolver.solver.variables.Variable
addMonitor, asBoolVar, asIntVar, asRealVar, asSetVar, clearEvents, contradiction, createDelta, getCause, getDelta, getDindex, getEnvironment, getEvtScheduler, getIndexInPropagator, getMask, getModel, getName, getNbProps, getNbViews, getPIndices, getPropagator, getPropagators, getTypeAndKind, getView, isAConstant, isInstantiated, link, notifyMonitors, notifyPropagators, notifyViews, removeMonitor, setPIndice, storeEvents, subscribeView, swapOnActivate, swapOnPassivate, unlink
-
-
-
-
Method Detail
-
getLB
double getLB()
Retrieves the lower bound of the variable- Returns:
- the lower bound
-
getUB
double getUB()
Retrieves the upper bound of the variable- Returns:
- the upper bound
-
updateLowerBound
boolean updateLowerBound(double value, ICause cause) throws ContradictionException
Updates the lower bound of the domain ofthis
tovalue
. The instruction comes frompropagator
.- If
value
is smaller than the lower bound of the domain, nothing is done and the return value isfalse
, - if updating the lower bound to
value
leads to a dead-end (domain wipe-out), aContradictionException
is thrown, - otherwise, if updating the lower bound to
value
can be done safely, the event type is created (the original event can be promoted) and observers are notified and the return value istrue
- Parameters:
value
- new lower bound (included)cause
- updating releaser- Returns:
- true if the lower bound has been updated, false otherwise
- Throws:
ContradictionException
- if the domain become empty due to this action
- If
-
updateUpperBound
boolean updateUpperBound(double value, ICause cause) throws ContradictionException
Updates the upper bound of the domain ofthis
tovalue
. The instruction comes frompropagator
.- If
value
is greater than the upper bound of the domain, nothing is done and the return value isfalse
, - if updating the upper bound to
value
leads to a dead-end (domain wipe-out), aContradictionException
is thrown, - otherwise, if updating the upper bound to
value
can be done safely, the event type is created (the original event can be promoted) and observers are notified and the return value istrue
- Parameters:
value
- new upper bound (included)cause
- update releaser- Returns:
- true if the upper bound has been updated, false otherwise
- Throws:
ContradictionException
- if the domain become empty due to this action
- If
-
updateBounds
boolean updateBounds(double lowerbound, double upperbound, ICause cause) throws ContradictionException
Updates the bounds of the domain ofthis
tovalue
. The instruction comes frompropagator
.- If the interval defined by [
lowerbound
,upperbound
] includes the domain of this, nothing is done and the return value isfalse
, - if updating the domain leads to a dead-end (domain wipe-out),
a
ContradictionException
is thrown, - otherwise, if updating the domain be done safely,
the event type is created (the original event can be promoted) and observers are notified
and the return value is
true
- Parameters:
lowerbound
- new lower bound (included)upperbound
- new upper bound (included)cause
- update releaser- Returns:
- true if the upper bound has been updated, false otherwise
- Throws:
ContradictionException
- if the domain become empty due to this action
- If the interval defined by [
-
getPrecision
double getPrecision()
-
realVar
default RealVar realVar(double p)
- Specified by:
realVar
in interfaceCArExpression
- Parameters:
p
- precision of the variable to return- Returns:
- the arithmetic expression as an
RealVar
. If necessary, it creates intermediary variable and posts intermediary constraints
-
-