Module org.chocosolver.solver
Interface IRealConstraintFactory
-
- All Known Subinterfaces:
IConstraintFactory
,IModel
- All Known Implementing Classes:
Model
public interface IRealConstraintFactory
Interface to make constraints over RealVar A kind of factory relying on interface default implementation to allow (multiple) inheritance- Since:
- 4.0.0
- Author:
- Jean-Guillaume FAGES
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default Constraint
element(RealVar value, double[] table, IntVar index)
Let 'index' be an integer variable with 'n' values and 'value' be a real variable.default Constraint
eq(RealVar x, IntVar y)
An arithmetical constraint : x = Ydefault RealConstraint
ibex(String functions, Variable... rvars)
Creates a 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( ),...'default RealConstraint
realIbexGenericConstraint(String functions, Variable... rvars)
Creates a 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( ),...'default Constraint
scalar(Variable[] vars, double[] coeffs, String op, double bound)
Creates a linear equation constraint over RealVar, IntVar or BoolVar which ensures that Sum(vars[i]*coeffs[i]) op bound
-
-
-
Method Detail
-
realIbexGenericConstraint
default RealConstraint realIbexGenericConstraint(String functions, Variable... rvars)
Creates a 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. Example to express the system:
x*y + sin(x) = 1;
ln(x)+[-0.1,0.1] >=2.6;
realIbexGenericConstraint("({0}*{1})+sin({0})=1.0;ln({0}+[-0.1,0.1])>=2.6", x,y);- Parameters:
functions
- list of functions, separated by a semi-colonrvars
- a list of real variables
-
ibex
default RealConstraint ibex(String functions, Variable... rvars)
Creates a 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. Example to express the system:
x*y + sin(x) = 1;
ln(x)+[-0.1,0.1] >=2.6;
realIbexGenericConstraint("({0}*{1})+sin({0})=1.0;ln({0}+[-0.1,0.1])>=2.6", x,y);- Parameters:
functions
- list of functions, separated by a semi-colonrvars
- a list of real variables
-
scalar
default Constraint scalar(Variable[] vars, double[] coeffs, String op, double bound)
Creates a linear equation constraint over RealVar, IntVar or BoolVar which ensures that Sum(vars[i]*coeffs[i]) op bound- Parameters:
vars
- a collection of variable (RealVar, IntVar, BoolVar are accepted)coeffs
- a collection of double, for which |vars|=|coeffs|op
- an operator in {"=", ">=", "<="}bound
- a double- Returns:
- a scalar constraint
-
eq
default Constraint eq(RealVar x, IntVar y)
An arithmetical constraint : x = Y- Parameters:
x
- a real variabley
- an integer variable- Returns:
- an arithmetical constraint
-
element
default Constraint element(RealVar value, double[] table, IntVar index)
Let 'index' be an integer variable with 'n' values and 'value' be a real variable. Given 'n' constant values a1 to an, this constraint ensures that:x = i iff v = ai
a1... an sequence is supposed to be ordered (a1<a2<... an)- Parameters:
value
- a real variabletable
- a sequence of double valuesindex
- an integer variable- Returns:
- an element constraint
-
-