Class RealConstraint
- java.lang.Object
-
- org.chocosolver.solver.constraints.Constraint
-
- org.chocosolver.solver.constraints.real.RealConstraint
-
public class RealConstraint extends Constraint
A constraint on real variables, solved using IBEX.- Since:
- 18/07/12
- Author:
- Charles Prud'homme, Jean-Guillaume Fages
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.chocosolver.solver.constraints.Constraint
Constraint.Status
-
-
Field Summary
-
Fields inherited from class org.chocosolver.solver.constraints.Constraint
boolReif, propagators
-
-
Constructor Summary
Constructors Constructor Description RealConstraint(String functions, Variable... rvars)
Make a new RealConstraint to model one or more continuous functions, separated with semi-colon ";"
A function is a string declared using the following format:
- the '{i}' tag defines a variable, where 'i' is an explicit index the array of variablesvars
,
- one or more operators :'+,-,*,/,=,<,>,<=,>=,exp( ),ln( ),max( ),min( ),abs( ),cos( ), sin( ),...'
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
reifyWith(BoolVar bool)
Reifies the constraint with a boolean variable If the reified boolean variable already exists, an additional (equality) constraint is automatically posted.-
Methods inherited from class org.chocosolver.solver.constraints.Constraint
checkNewStatus, computeMaxPriority, declareAs, getCidxInModel, getName, getOpposite, getPropagator, getPropagators, getStatus, isReified, isSatisfied, makeOpposite, merge, post, reify, setName, setOpposite, toString
-
-
-
-
Constructor Detail
-
RealConstraint
public RealConstraint(String functions, Variable... rvars)
Make a new RealConstraint to model one or more continuous functions, separated with semi-colon ";"
A function is a string declared using the following format:
- the '{i}' tag defines a variable, where 'i' is an explicit index the array of variablesvars
,
- one or more operators :'+,-,*,/,=,<,>,<=,>=,exp( ),ln( ),max( ),min( ),abs( ),cos( ), sin( ),...'
A complete list is available in the documentation of IBEX.model.realIbexGenericConstraint("({0}*{1})+sin({0})=1.0;ln({0}+[-0.1,0.1])>=2.6", x, y).post();
- Parameters:
functions
- list of functions, separated by a semi-colonrvars
- a list of real variables
-
-
Method Detail
-
reifyWith
public void reifyWith(BoolVar bool)
Reifies the constraint with a boolean variable If the reified boolean variable already exists, an additional (equality) constraint is automatically posted.- Overrides:
reifyWith
in classConstraint
- Parameters:
bool
- the variable to reify with
-
-