public interface RealVar extends Variable, CArExpression
CArExpression.Operator
BOOL, CSTE, INT, KIND, REAL, SET, TYPE, VAR, VIEW
NO_CHILD
Modifier and Type | Method and Description |
---|---|
double |
getLB()
Retrieves the lower bound of the variable
|
double |
getPrecision() |
double |
getUB()
Retrieves the upper bound of the variable
|
default RealVar |
realVar(double p) |
boolean |
updateBounds(double lowerbound,
double upperbound,
ICause cause)
Updates the bounds of the domain of
this to value . |
boolean |
updateLowerBound(double value,
ICause cause)
Updates the lower bound of the domain of
this to value . |
boolean |
updateUpperBound(double value,
ICause cause)
Updates the upper bound of the domain of
this to value . |
_schedIter, addMonitor, contradiction, createDelta, getDelta, getDindex, getEnvironment, getIndexInPropagator, getModel, getName, getNbProps, getPIndices, getPropagator, getPropagators, getTypeAndKind, getViews, isAConstant, isInstantiated, link, notifyMonitors, notifyPropagators, notifyViews, removeMonitor, setPIndice, subscribeView, unlink
compareTo
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
double getLB()
double getUB()
boolean updateLowerBound(double value, ICause cause) throws ContradictionException
this
to value
.
The instruction comes from propagator
.
value
is smaller than the lower bound of the domain, nothing is done and the return value is false
,value
leads to a dead-end (domain wipe-out),
a ContradictionException
is thrown,value
can be done safely,
the event type is created (the original event can be promoted) and observers are notified
and the return value is true
value
- new lower bound (included)cause
- updating releaserContradictionException
- if the domain become empty due to this actionboolean updateUpperBound(double value, ICause cause) throws ContradictionException
this
to value
.
The instruction comes from propagator
.
value
is greater than the upper bound of the domain, nothing is done and the return value is false
,value
leads to a dead-end (domain wipe-out),
a ContradictionException
is thrown,value
can be done safely,
the event type is created (the original event can be promoted) and observers are notified
and the return value is true
value
- new upper bound (included)cause
- update releaserContradictionException
- if the domain become empty due to this actionboolean updateBounds(double lowerbound, double upperbound, ICause cause) throws ContradictionException
this
to value
.
The instruction comes from propagator
.
lowerbound
,upperbound
] includes the domain of this, nothing is done and the return value is false
,ContradictionException
is thrown,true
lowerbound
- new lower bound (included)upperbound
- new upper bound (included)cause
- update releaserContradictionException
- if the domain become empty due to this actiondouble getPrecision()
default RealVar realVar(double p)
realVar
in interface CArExpression
p
- precision of the variable to returnRealVar
.
If necessary, it creates intermediary variable and posts intermediary constraintsCopyright © 2017. All rights reserved.