Class HxModel
open()) or instantiate another Hexaly Optimizer environment to optimize
another model.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionabs(HxExpression a) Creates an absolute value expression.voidaddConstraint(HxExpression expr) Adds the given expression to the list of constraints.voidaddObjective(HxExpression expr, HxObjectiveDirection direction) Adds the given expression to the list of objectives to optimize.and()Creates an AND expression.and(HxExpression a) Creates an AND expression.and(HxExpression... operands) Creates an AND expression.and(HxExpression a, HxExpression b) Creates an AND expression.and(Iterable<HxExpression> operands) Creates an AND expression.array()Creates an array expression.array(double... operands) Creates an array expression.array(float... operands) Creates an array expression.array(int... operands) Creates an array expression.array(long... operands) Creates an array expression.array(HxExpression... operands) Creates an array expression.array(HxExpression range, HxExpression lambda, double defaultvalue) Creates an array expression.array(HxExpression range, HxExpression lambda, long defaultvalue) Creates an array expression.Creates an N-dimensional array expression.at(HxExpression array, long index) Creates a "at" expression.at(HxExpression array, HxExpression... indices) Creates a "at" expression for N-dimensional array.boolVar()Creates a boolean decision.call()Creates a call expression.call(HxExpression a) Creates a call expression.call(HxExpression... operands) Creates a call expression.call(HxExpression a, HxExpression b) Creates a call expression.call(HxExpression a, HxExpression b, HxExpression c) Creates a call expression.call(Iterable<HxExpression> operands) Creates a call expression.ceil(HxExpression a) Creates a ceil expression.voidclose()Closes the model.constArray(double[] values) Creates a constant array expression.constArray(long[] values) Creates a constant array expression.voidconstraint(HxExpression expr) Shortcut for addConstraint(expr).contains(HxExpression a, long b) Creates a contains expression.contains(HxExpression a, HxExpression b) Creates a contains expression.cos(HxExpression a) Creates a cosine expression.Creates a count expression.cover()Creates a cover expression.cover(HxExpression array) Creates a cover expression.cover(HxExpression... operands) Creates a cover expression.cover(Iterable<HxExpression> operands) Creates a cover expression.createConstant(double value) Creates a constant expression representing the given value.createConstant(long value) Creates a constant expression representing the given value.createConstArray(double[] values) Creates a constant array expression representing the given array.createConstArray(long[] values) Creates a constant array expression representing the given array.Creates a double array external function.Creates a double external function.Creates an expression of the given type.createExpression(HxOperator op, double expr0) Creates an expression of the given type, with the given operand.createExpression(HxOperator op, double[] operands) Creates an expression of the given type, with the given operands.createExpression(HxOperator op, double expr0, double expr1) Creates an expression of the given type, with the given operands.createExpression(HxOperator op, double expr0, double expr1, double expr2) Creates an expression of the given type, with the given operands.createExpression(HxOperator op, double expr0, double expr1, HxExpression expr2) Creates an expression of the given type, with the given operands.createExpression(HxOperator op, double expr0, HxExpression expr1) Creates an expression of the given type, with the given operands.createExpression(HxOperator op, double expr0, HxExpression expr1, double expr2) Creates an expression of the given type, with the given operands.createExpression(HxOperator op, double expr0, HxExpression expr1, HxExpression expr2) Creates an expression of the given type, with the given operands.createExpression(HxOperator op, float[] operands) Creates an expression of the given type, with the given operands.createExpression(HxOperator op, int[] operands) Creates an expression of the given type, with the given operands.createExpression(HxOperator op, long expr0) Creates an expression of the given type, with the given operand.createExpression(HxOperator op, long[] operands) Creates an expression of the given type, with the given operands.createExpression(HxOperator op, long expr0, long expr1) Creates an expression of the given type, with the given operands.createExpression(HxOperator op, long expr0, long expr1, long expr2) Creates an expression of the given type, with the given operands.createExpression(HxOperator op, long expr0, long expr1, HxExpression expr2) Creates an expression of the given type, with the given operands.createExpression(HxOperator op, long expr0, HxExpression expr1) Creates an expression of the given type, with the given operands.createExpression(HxOperator op, long expr0, HxExpression expr1, long expr2) Creates an expression of the given type, with the given operands.createExpression(HxOperator op, long expr0, HxExpression expr1, HxExpression expr2) Creates an expression of the given type, with the given operands.createExpression(HxOperator op, HxExpression expr0) Creates an expression of the given type, with the given operand.createExpression(HxOperator op, HxExpression... operands) Creates an expression of the given type, with the given operands.createExpression(HxOperator op, HxExpression expr0, double expr1) Creates an expression of the given type, with the given operands.createExpression(HxOperator op, HxExpression expr0, double expr1, double expr2) Creates an expression of the given type, with the given operands.createExpression(HxOperator op, HxExpression expr0, double expr1, HxExpression expr2) Creates an expression of the given type, with the given operands.createExpression(HxOperator op, HxExpression expr0, long expr1) Creates an expression of the given type, with the given operands.createExpression(HxOperator op, HxExpression expr0, long expr1, long expr2) Creates an expression of the given type, with the given operands.createExpression(HxOperator op, HxExpression expr0, long expr1, HxExpression expr2) Creates an expression of the given type, with the given operands.createExpression(HxOperator op, HxExpression expr0, HxExpression expr1) Creates an expression of the given type, with the given operands.createExpression(HxOperator op, HxExpression expr0, HxExpression expr1, double expr2) Creates an expression of the given type, with the given operands.createExpression(HxOperator op, HxExpression expr0, HxExpression expr1, long expr2) Creates an expression of the given type, with the given operands.createExpression(HxOperator op, HxExpression expr0, HxExpression expr1, HxExpression expr2) Creates an expression of the given type, with the given operands.createExpression(HxOperator op, Iterable<HxExpression> operands) Creates an expression of the given type, with the given operands.Creates an integer array external function.Creates an integer external function.createLambdaFunction(int nbArgs, HxLambdaFunction functor) Creates a lambda function with arguments.createLambdaFunction(HxLambdaFunction0 functor) Creates a lambda function without arguments.createLambdaFunction(HxLambdaFunction1 functor) Creates a lambda function with one arguments.createLambdaFunction(HxLambdaFunction2 functor) Creates a lambda function with two arguments.createLambdaFunction(HxLambdaFunction3 functor) Creates a lambda function with three arguments.disjoint()Creates a disjoint expression.disjoint(HxExpression array) Creates a disjoint expression.disjoint(HxExpression... operands) Creates a disjoint expression.disjoint(Iterable<HxExpression> operands) Creates a disjoint expression.dist(double a, HxExpression b) Creates a distance expression.dist(long a, HxExpression b) Creates a distance expression.dist(HxExpression a, double b) Creates a distance expression.dist(HxExpression a, long b) Creates a distance expression.dist(HxExpression a, HxExpression b) Creates a distance expression.Creates an distinct expression.distinct(HxExpression a, HxExpression b) Creates an distinct expression.div(double a, HxExpression b) Creates a division expression.div(long a, HxExpression b) Creates a division expression.div(HxExpression a, double b) Creates a division expression.div(HxExpression a, long b) Creates a division expression.div(HxExpression a, HxExpression b) Creates a division expression.Creates an external function expression.Creates an external function expression.end(HxExpression a) Creates an end expression.eq(double a, HxExpression b) Creates an equality expression.eq(long a, HxExpression b) Creates an equality expression.eq(HxExpression a, double b) Creates an equality expression.eq(HxExpression a, long b) Creates an equality expression.eq(HxExpression a, HxExpression b) Creates an equality expression.booleanexp(HxExpression a) Creates an exponential expression.find(HxExpression a, long b) Creates a find expression.find(HxExpression a, HxExpression b) Creates a find expression.floatVar(double lb, double ub) Creates a float decision.Creates a floor expression.geq(double a, HxExpression b) Creates an inequality expression greater than or equal to.geq(long a, HxExpression b) Creates an inequality expression greater than or equal to.geq(HxExpression a, double b) Creates an inequality expression greater than or equal to.geq(HxExpression a, long b) Creates an inequality expression greater than or equal to.geq(HxExpression a, HxExpression b) Creates an inequality expression greater than or equal to.getConstraint(int constraintIndex) Gets the constraint with the given index.getDecision(int decisionIndex) Gets the decision with the given index.getExpression(int exprIndex) Gets the expression with the given index in this model.getExpression(String name) Gets the expression with the given index in this model.intGets the number of constraints added to this model.intGets the number of decisions in the model.intGets the number of expressions added to this model.intGets the number of objectives added to this model.intGets the number of operands in the model.getObjective(int objectiveIndex) Gets the objective with the given index.getObjectiveDirection(int objectiveIndex) Gets the direction of the objective with the given index.Returns the Hexaly Optimizer object associated to this model.gt(double a, HxExpression b) Creates an inequality expression greater than.gt(long a, HxExpression b) Creates an inequality expression greater than.gt(HxExpression a, double b) Creates an inequality expression greater than.gt(HxExpression a, long b) Creates an inequality expression greater than.gt(HxExpression a, HxExpression b) Creates an inequality expression greater than.inthashCode()hull()Creates a hull expression.hull(HxExpression array) Creates a hull expression.hull(HxExpression... operands) Creates a hull expression.iif(HxExpression a, double b, double c) Creates a ternary conditional expression.iif(HxExpression a, double b, HxExpression c) Creates a ternary conditional expression.iif(HxExpression a, long b, long c) Creates a ternary conditional expression.iif(HxExpression a, long b, HxExpression c) Creates a ternary conditional expression.iif(HxExpression a, HxExpression b, double c) Creates a ternary conditional expression.iif(HxExpression a, HxExpression b, long c) Creates a ternary conditional expression.iif(HxExpression a, HxExpression b, HxExpression c) Creates a ternary conditional expression.indexOf(HxExpression a, long b) Creates an indexOf expression.indexOf(HxExpression a, HxExpression b) Creates an indexOf expression.Creates an external function expression.intersection(HxExpression... operands) Creates an intersection expression of n intervals.Creates an intersection expression.intervalVar(long minStart, long maxEnd) Creates an interval decision included in [minStart, maxEnd).Creates an external function expression.intVar(long lb, long ub) Creates an integer decision.booleanisClosed()Returns true if the model is closed, false otherwise.lambdaFunction(int nbArgs, HxLambdaFunction functor) Creates a lambda function expression.lambdaFunction(HxLambdaFunction0 functor) Creates a lambda function expression.lambdaFunction(HxLambdaFunction1 functor) Creates a lambda function expression.lambdaFunction(HxLambdaFunction2 functor) Creates a lambda function expression.lambdaFunction(HxLambdaFunction3 functor) Creates a lambda function expression.Creates a length expression.leq(double a, HxExpression b) Creates an inequality expression less than or equal to.leq(long a, HxExpression b) Creates an inequality expression less than or equal to.leq(HxExpression a, double b) Creates an inequality expression less than or equal to.leq(HxExpression a, long b) Creates an inequality expression less than or equal to.leq(HxExpression a, HxExpression b) Creates an inequality expression less than or equal to.listVar(long n) Creates a list decision with the given length.log(HxExpression a) Creates a log expression.lt(double a, HxExpression b) Creates an inequality expression less than.lt(long a, HxExpression b) Creates an inequality expression less than.lt(HxExpression a, double b) Creates an inequality expression less than.lt(HxExpression a, long b) Creates an inequality expression less than.lt(HxExpression a, HxExpression b) Creates an inequality expression less than.max()Creates a maximum expression.max(double a) Creates a maximum expression.max(double a, HxExpression b) Creates a maximum expression.max(long a) Creates a maximum expression.max(long a, HxExpression b) Creates a maximum expression.max(HxExpression a) Creates a maximum expression.max(HxExpression... operands) Creates a maximum expression.max(HxExpression a, double b) Creates a maximum expression.max(HxExpression a, long b) Creates a maximum expression.max(HxExpression a, HxExpression b) Creates a maximum expression.max(Iterable<HxExpression> operands) Creates a maximum expression.voidmaximize(HxExpression expr) Shortcut for addObjective(expr, OD_Maximize).min()Creates a minimum expression.min(double a) Creates a minimum expression.min(double a, HxExpression b) Creates a minimum expression.min(long a) Creates a minimum expression.min(long a, HxExpression b) Creates a minimum expression.min(HxExpression a) Creates a minimum expression.min(HxExpression... operands) Creates a minimum expression.min(HxExpression a, double b) Creates a minimum expression.min(HxExpression a, long b) Creates a minimum expression.min(HxExpression a, HxExpression b) Creates a minimum expression.min(Iterable<HxExpression> operands) Creates a minimum expression.voidminimize(HxExpression expr) Shortcut for addObjective(expr, OD_Minimize).mod(long a, HxExpression b) Creates a modulo expression.mod(HxExpression a, long b) Creates a modulo expression.mod(HxExpression a, HxExpression b) Creates a modulo expression.neq(double a, HxExpression b) Creates a disequality expression.neq(long a, HxExpression b) Creates a disequality expression.neq(HxExpression a, double b) Creates a disequality expression.neq(HxExpression a, long b) Creates a disequality expression.neq(HxExpression a, HxExpression b) Creates a disequality expression.not(HxExpression a) Creates a NOT expression.voidopen()Reopens the model.optionalIntervalVar(long minStart, long maxEnd) Creates an optional interval decision, which can either be absent (void) or included in [minStart, maxEnd).or()Creates a OR expression.or(HxExpression a) Creates a OR expression.or(HxExpression... operands) Creates a OR expression.or(HxExpression a, HxExpression b) Creates a OR expression.or(Iterable<HxExpression> operands) Creates a OR expression.Creates a partition expression.partition(HxExpression array) Creates a partition expression.partition(HxExpression... operands) Creates a partition expression.partition(Iterable<HxExpression> operands) Creates a partition expression.piecewise(HxExpression abscissae, HxExpression ordinates, HxExpression x) Creates a piecewise linear expression.pow(double a, HxExpression b) Creates a power expression.pow(long a, HxExpression b) Creates a power expression.pow(HxExpression a, double b) Creates a power expression.pow(HxExpression a, long b) Creates a power expression.pow(HxExpression a, HxExpression b) Creates a power expression.Creates a presence expression.prod()Creates a product expression.prod(double a) Creates a product expression.prod(double a, HxExpression b) Creates a product expression.prod(long a) Creates a product expression.prod(long a, HxExpression b) Creates a product expression.prod(HxExpression a) Creates a product expression.prod(HxExpression... operands) Creates a product expression.prod(HxExpression a, double b) Creates a product expression.prod(HxExpression a, long b) Creates a product expression.prod(HxExpression a, HxExpression b) Creates a product expression.prod(Iterable<HxExpression> operands) Creates a product expression.range(long a, long b) Creates a range expression, where a is the lower bound (inclusive) and b is the upper bound (exclusive).range(long a, HxExpression b) Creates a range expression, where a is the lower bound (inclusive) and b is the upper bound (exclusive).range(HxExpression a, long b) Creates a range expression, where a is the lower bound (inclusive) and b is the upper bound (exclusive).range(HxExpression a, HxExpression b) Creates a range expression, where a is the lower bound (inclusive) and b is the upper bound (exclusive).voidremoveConstraint(int constraintIndex) Removes the constraint at the given position in the list of constraints.voidremoveConstraint(HxExpression expr) Removes the given expression from the list of constraints.voidremoveObjective(int objectiveIndex) Removes the objective at the given position in the list of objectives.Creates a rounding expression.scalar(HxExpression a, HxExpression b) Creates an expression for the scalar product between two arrays.setVar(long n) Creates a set decision with the given length.sin(HxExpression a) Creates a sine expression.sort(HxExpression expr) Creates a sorted array in ascending order, containing integer if the input is a collection or an array with only integers or boolean, and containing doubles if the array has at least one double.sort(HxExpression expr, HxExpression lambda) Creates a sorted array, containing integer if the input is a collection or an array with only integers or boolean, and containing doubles if the array has at least one double.sqrt(HxExpression a) Creates a square root expression.Creates a start expression.stepArray(HxExpression array_1, HxExpression array_2) Creates a stepArray expression.sub(double a, HxExpression b) Creates a substraction expression.sub(long a, HxExpression b) Creates a substraction expression.sub(HxExpression a, double b) Creates a substraction expression.sub(HxExpression a, long b) Creates a substraction expression.sub(HxExpression a, HxExpression b) Creates a substraction expression.sum()Creates a sum expression.sum(double a) Creates a sum expression.sum(double a, HxExpression b) Creates a sum expression.sum(long a) Creates a sum expression.sum(long a, HxExpression b) Creates a sum expression.sum(HxExpression a) Creates a sum expression.sum(HxExpression... operands) Creates a sum expression.sum(HxExpression a, double b) Creates a sum expression.sum(HxExpression a, long b) Creates a sum expression.sum(HxExpression a, HxExpression b) Creates a sum expression.sum(Iterable<HxExpression> operands) Creates a sum expression.tan(HxExpression a) Creates a tangent expression.toString()Returns a String representation of this model.union(HxExpression... operands) Creates an union expression of n iterables.xor()Creates a XOR expression.xor(HxExpression a) Creates a XOR expression.xor(HxExpression... operands) Creates a XOR expression.xor(HxExpression a, HxExpression b) Creates a XOR expression.xor(Iterable<HxExpression> operands) Creates a XOR expression.
-
Method Details
-
getOptimizer
Returns the Hexaly Optimizer object associated to this model.- Returns:
- Hexaly Optimizer object.
-
createConstant
Creates a constant expression representing the given value. Only allowed in stateHxState.Modeling. Note that if a constant has been already created with the same value, this method can return the same expression, but it is not guaranteed. The exact behavior is implementation defined.- Parameters:
value- Value of the constant.- Returns:
- Created constant expression.
-
createConstant
Creates a constant expression representing the given value. Only allowed in stateHxState.Modeling. Note that if a constant has been already created with the same value, this method can return the same expression, but it is not guaranteed. The exact behavior is implementation defined.- Parameters:
value- Value of the constant.- Returns:
- Created constant expression.
-
createConstArray
Creates a constant array expression representing the given array. Note that the constant array created does not have any operands. Only allowed in stateHxState.Modeling.- Parameters:
values- array of constant values.- Returns:
- Created constant array expression.
- Since:
- 13.5
-
createConstArray
Creates a constant array expression representing the given array. Note that the constant array created does not have any operands. Only allowed in stateHxState.Modeling.- Parameters:
values- array of constant values.- Returns:
- Created constant array expression.
- Since:
- 13.5
-
createExpression
Creates an expression of the given type. The expression is created without operand. Only allowed in stateHxState.Modeling. This method cannot be used to create constants: usecreateConstant(long)orcreateConstant(double)instead.- Parameters:
op- Type of expression to create.- Returns:
- Created expression.
-
createExpression
Creates an expression of the given type, with the given operand. Only allowed in stateHxState.Modeling. Useful for creating unary expressions.- Parameters:
op- Type of expression to create.expr0- Operand 0.- Returns:
- Created expression.
-
createExpression
Creates an expression of the given type, with the given operand. Only allowed in stateHxState.Modeling. Useful for creating unary expressions.- Parameters:
op- Type of expression to create.expr0- Operand 0.- Returns:
- Created expression.
-
createExpression
Creates an expression of the given type, with the given operand. Only allowed in stateHxState.Modeling. Useful for creating unary expressions.- Parameters:
op- Type of expression to create.expr0- Operand 0.- Returns:
- Created expression.
-
createExpression
Creates an expression of the given type, with the given operands. Only allowed in stateHxState.Modeling. Useful for creating binary expressions.- Parameters:
op- Type of expression to create.expr0- Operand 0.expr1- Operand 1.- Returns:
- Created expression.
-
createExpression
Creates an expression of the given type, with the given operands. Only allowed in stateHxState.Modeling. Useful for creating binary expressions.- Parameters:
op- Type of expression to create.expr0- Operand 0.expr1- Operand 1.- Returns:
- Created expression.
-
createExpression
Creates an expression of the given type, with the given operands. Only allowed in stateHxState.Modeling. Useful for creating binary expressions.- Parameters:
op- Type of expression to create.expr0- Operand 0.expr1- Operand 1.- Returns:
- Created expression.
-
createExpression
Creates an expression of the given type, with the given operands. Only allowed in stateHxState.Modeling. Useful for creating binary expressions.- Parameters:
op- Type of expression to create.expr0- Operand 0.expr1- Operand 1.- Returns:
- Created expression.
-
createExpression
Creates an expression of the given type, with the given operands. Only allowed in stateHxState.Modeling. Useful for creating binary expressions.- Parameters:
op- Type of expression to create.expr0- Operand 0.expr1- Operand 1.- Returns:
- Created expression.
-
createExpression
Creates an expression of the given type, with the given operands. Only allowed in stateHxState.Modeling. Useful for creating binary expressions.- Parameters:
op- Type of expression to create.expr0- Operand 0.expr1- Operand 1.- Returns:
- Created expression.
-
createExpression
Creates an expression of the given type, with the given operands. Only allowed in stateHxState.Modeling. Useful for creating binary expressions.- Parameters:
op- Type of expression to create.expr0- Operand 0.expr1- Operand 1.- Returns:
- Created expression.
-
createExpression
public HxExpression createExpression(HxOperator op, HxExpression expr0, HxExpression expr1, HxExpression expr2) Creates an expression of the given type, with the given operands. Only allowed in stateHxState.Modeling. Useful for creating ternary expressions.- Parameters:
op- Type of expression to create.expr0- Operand 0.expr1- Operand 1.expr2- Operand 2.- Returns:
- Created expression.
-
createExpression
Creates an expression of the given type, with the given operands. Only allowed in stateHxState.Modeling. Useful for creating ternary expressions.- Parameters:
op- Type of expression to create.expr0- Operand 0.expr1- Operand 1.expr2- Operand 2.- Returns:
- Created expression.
-
createExpression
Creates an expression of the given type, with the given operands. Only allowed in stateHxState.Modeling. Useful for creating ternary expressions.- Parameters:
op- Type of expression to create.expr0- Operand 0.expr1- Operand 1.expr2- Operand 2.- Returns:
- Created expression.
-
createExpression
Creates an expression of the given type, with the given operands. Only allowed in stateHxState.Modeling. Useful for creating ternary expressions.- Parameters:
op- Type of expression to create.expr0- Operand 0.expr1- Operand 1.expr2- Operand 2.- Returns:
- Created expression.
-
createExpression
public HxExpression createExpression(HxOperator op, long expr0, HxExpression expr1, HxExpression expr2) Creates an expression of the given type, with the given operands. Only allowed in stateHxState.Modeling. Useful for creating ternary expressions.- Parameters:
op- Type of expression to create.expr0- Operand 0.expr1- Operand 1.expr2- Operand 2.- Returns:
- Created expression.
-
createExpression
Creates an expression of the given type, with the given operands. Only allowed in stateHxState.Modeling. Useful for creating ternary expressions.- Parameters:
op- Type of expression to create.expr0- Operand 0.expr1- Operand 1.expr2- Operand 2.- Returns:
- Created expression.
-
createExpression
public HxExpression createExpression(HxOperator op, HxExpression expr0, long expr1, HxExpression expr2) Creates an expression of the given type, with the given operands. Only allowed in stateHxState.Modeling. Useful for creating ternary expressions.- Parameters:
op- Type of expression to create.expr0- Operand 0.expr1- Operand 1.expr2- Operand 2.- Returns:
- Created expression.
-
createExpression
public HxExpression createExpression(HxOperator op, HxExpression expr0, HxExpression expr1, long expr2) Creates an expression of the given type, with the given operands. Only allowed in stateHxState.Modeling. Useful for creating ternary expressions.- Parameters:
op- Type of expression to create.expr0- Operand 0.expr1- Operand 1.expr2- Operand 2.- Returns:
- Created expression.
-
createExpression
Creates an expression of the given type, with the given operands. Only allowed in stateHxState.Modeling. Useful for creating ternary expressions.- Parameters:
op- Type of expression to create.expr0- Operand 0.expr1- Operand 1.expr2- Operand 2.- Returns:
- Created expression.
-
createExpression
Creates an expression of the given type, with the given operands. Only allowed in stateHxState.Modeling. Useful for creating ternary expressions.- Parameters:
op- Type of expression to create.expr0- Operand 0.expr1- Operand 1.expr2- Operand 2.- Returns:
- Created expression.
-
createExpression
Creates an expression of the given type, with the given operands. Only allowed in stateHxState.Modeling. Useful for creating ternary expressions.- Parameters:
op- Type of expression to create.expr0- Operand 0.expr1- Operand 1.expr2- Operand 2.- Returns:
- Created expression.
-
createExpression
public HxExpression createExpression(HxOperator op, double expr0, HxExpression expr1, HxExpression expr2) Creates an expression of the given type, with the given operands. Only allowed in stateHxState.Modeling. Useful for creating ternary expressions.- Parameters:
op- Type of expression to create.expr0- Operand 0.expr1- Operand 1.expr2- Operand 2.- Returns:
- Created expression.
-
createExpression
Creates an expression of the given type, with the given operands. Only allowed in stateHxState.Modeling. Useful for creating ternary expressions.- Parameters:
op- Type of expression to create.expr0- Operand 0.expr1- Operand 1.expr2- Operand 2.- Returns:
- Created expression.
-
createExpression
public HxExpression createExpression(HxOperator op, HxExpression expr0, double expr1, HxExpression expr2) Creates an expression of the given type, with the given operands. Only allowed in stateHxState.Modeling. Useful for creating ternary expressions.- Parameters:
op- Type of expression to create.expr0- Operand 0.expr1- Operand 1.expr2- Operand 2.- Returns:
- Created expression.
-
createExpression
public HxExpression createExpression(HxOperator op, HxExpression expr0, HxExpression expr1, double expr2) Creates an expression of the given type, with the given operands. Only allowed in stateHxState.Modeling. Useful for creating ternary expressions.- Parameters:
op- Type of expression to create.expr0- Operand 0.expr1- Operand 1.expr2- Operand 2.- Returns:
- Created expression.
-
createExpression
Creates an expression of the given type, with the given operands. Only allowed in stateHxState.Modeling. Useful for creating n-ary expressions.- Parameters:
op- Type of expression to create.operands- Operands to add.- Returns:
- Created expression.
-
createExpression
Creates an expression of the given type, with the given operands. Only allowed in stateHxState.Modeling. Useful for creating n-ary expressions.- Parameters:
op- Type of expression to create.operands- Operands to add.- Returns:
- Created expression.
-
createExpression
Creates an expression of the given type, with the given operands. Only allowed in stateHxState.Modeling. Useful for creating n-ary expressions.- Parameters:
op- Type of expression to create.operands- Operands to add.- Returns:
- Created expression.
-
createExpression
Creates an expression of the given type, with the given operands. Only allowed in stateHxState.Modeling. Useful for creating n-ary expressions.- Parameters:
op- Type of expression to create.operands- Operands to add.- Returns:
- Created expression.
-
createExpression
Creates an expression of the given type, with the given operands. Only allowed in stateHxState.Modeling. Useful for creating n-ary expressions.- Parameters:
op- Type of expression to create.operands- Operands to add.- Returns:
- Created expression.
-
createExpression
Creates an expression of the given type, with the given operands. Only allowed in stateHxState.Modeling. Useful for creating n-ary expressions.- Parameters:
op- Type of expression to create.operands- Operands to add.- Returns:
- Created expression.
-
createIntExternalFunction
Creates an integer external function. The argument must implement
HxIntExternalFunction. When the external function is called, the argument values will be made accessible to your function through theHxExternalArgumentValues.Once you have instantiated it, you have to use
call(HxExpression...operands)to call it in your model.Note 1: Most of the time your external function will be called when the optimizer is in state
HxState.Running. Do not attempt to call any method of the optimizer (to retrieve statistics, values of HxExpressions or whatever) in that state or an exception will be thrown. The only accessible function isHexalyOptimizer.stop().Note 2: Your functions must be thread-safe. According to the "nbThreads" parameter, Hexaly Optimizer can be multi-threaded. In that case, your external functions must be thread safe. If you cannot guarantee the thread-safety of your code, we strongly recommend you to limit the search of Hexaly Optimizer to one thread with
HxParam.setNbThreads(int).Note 3: You can provide additional data for your function (such as lower and upper bounds) with the help of the
HxExternalContextassociated with your function (seeHxExpression.getExternalContext().- Parameters:
func- External function to call.- Returns:
- The expression associated with the function.
- Since:
- 9.5
- See Also:
-
createDoubleExternalFunction
Creates a double external function. The argument must implement
HxDoubleExternalFunction. When the external function is called, the argument values will be made accessible to your function through theHxExternalArgumentValues.Once you have instantiated it, you have to use
call(HxExpression...operands)to call it in your model.Note 1: Most of the time your external function will be called when the optimizer is in state
HxState.Running. Do not attempt to call any method of the optimizer (to retrieve statistics, values of HxExpressions or whatever) in that state or an exception will be thrown. The only accessible function isHexalyOptimizer.stop().Note 2: Your functions must be thread-safe. According to the "nbThreads" parameter, Hexaly Optimizer can be multi-threaded. In that case, your external functions must be thread safe. If you cannot guarantee the thread-safety of your code, we strongly recommend you to limit the search of Hexaly Optimizer to one thread with
HxParam.setNbThreads(int).Note 3: You can provide additional data for your function (such as lower and upper bounds) with the help of the
HxExternalContextassociated with your function (seeHxExpression.getExternalContext().- Parameters:
func- External function to call.- Returns:
- The expression associated with the function.
- Since:
- 9.5
- See Also:
-
createIntArrayExternalFunction
Creates an integer array external function. The argument must implement
HxIntArrayExternalFunction. When the external function is called, the argument values will be made accessible to your function through theHxExternalArgumentValues.Once you have instantiated it, you have to use
call(HxExpression...operands)to call it in your model.Note: You can provide additional data and parameters for your function (such as the maximum number of evaluations) with the help of the
HxExternalContextassociated with your function (seeHxExpression.getExternalContext()).- Parameters:
func- External function to call.- Returns:
- The expression associated with the function.
- Since:
- 11.0
- See Also:
-
createDoubleArrayExternalFunction
Creates a double array external function. The argument must implement
HxDoubleArrayExternalFunction. When the external function is called, the argument values will be made accessible to your function through theHxExternalArgumentValues.Once you have instantiated it, you have to use
call(HxExpression...operands)to call it in your model.Note: You can provide additional data and parameters for your function (such as the maximum number of evaluations) with the help of the
HxExternalContextassociated with your function (seeHxExpression.getExternalContext()).- Parameters:
func- External function to call.- Returns:
- The expression associated with the function.
- Since:
- 11.0
- See Also:
-
createLambdaFunction
Creates a lambda function without arguments. A lambda function is a particular expression composed of two parts:- The arguments of the function (which are also HxExpressions of type
HxOperator.Argument. - The body of the function. The body is an HxExpression that will be used to evaluate the result of the function. The body can be any HxExpression composed of any operands and operators supported by Hexaly Optimizer. Thus, the body expression can use the arguments of the function but can also capture and refer to expressions declared outside of the function.
- Parameters:
functor- A function (HxLambdaFunction0) that returns anHxExpressionthat will be used as the body of the new Hexaly Optimizer function you want to create.- Returns:
- Expression of type
HxOperator.LambdaFunction. - Since:
- 9.5
- The arguments of the function (which are also HxExpressions of type
-
createLambdaFunction
Creates a lambda function with one arguments. A lambda function is a particular expression composed of two parts:- The arguments of the function (which are also HxExpressions of type
HxOperator.Argument. - The body of the function. The body is an HxExpression that will be used to evaluate the result of the function. The body can be any HxExpression composed of any operands and operators supported by Hexaly Optimizer. Thus, the body expression can use the arguments of the function but can also capture and refer to expressions declared outside of the function.
HxOperator.Argument. At the end of the evaluation of your function, the returned HxExpression will be used as the body of the Hexaly Optimizer function.- Parameters:
functor- A function (HxLambdaFunction1) that accepts oneHxExpressionas argument and returns anHxExpressionthat will be used as the body of the new Hexaly Optimizer function you want to create.- Returns:
- Expression of type
HxOperator.LambdaFunction. - Since:
- 9.5
- The arguments of the function (which are also HxExpressions of type
-
createLambdaFunction
Creates a lambda function with two arguments. A lambda function is a particular expression composed of two parts:- The arguments of the function (which are also HxExpressions of type
HxOperator.Argument. - The body of the function. The body is an HxExpression that will be used to evaluate the result of the function. The body can be any HxExpression composed of any operands and operators supported by Hexaly Optimizer. Thus, the body expression can use the arguments of the function but can also capture and refer to expressions declared outside of the function.
HxOperator.Argumentthat corresponds to the number of arguments your function expects. At the end of the evaluation of your function, the returned HxExpression will be used as the body of the Hexaly Optimizer function.- Parameters:
functor- A function (HxLambdaFunction2) that accepts twoHxExpressionas arguments and returns anHxExpressionthat will be used as the body of the new Hexaly Optimizer function you want to create.- Returns:
- Expression of type
HxOperator.LambdaFunction. - Since:
- 9.5
- The arguments of the function (which are also HxExpressions of type
-
createLambdaFunction
Creates a lambda function with three arguments. A lambda function is a particular expression composed of two parts:- The arguments of the function (which are also HxExpressions of type
HxOperator.Argument. - The body of the function. The body is an HxExpression that will be used to evaluate the result of the function. The body can be any HxExpression composed of any operands and operators supported by Hexaly Optimizer. Thus, the body expression can use the arguments of the function but can also capture and refer to expressions declared outside of the function.
HxOperator.Argumentthat corresponds to the number of arguments your function expects. At the end of the evaluation of your function, the returned HxExpression will be used as the body of the Hexaly Optimizer function.- Parameters:
functor- A function (HxLambdaFunction3) that accepts threeHxExpressionas arguments and returns anHxExpressionthat will be used as the body of the new Hexaly Optimizer function you want to create.- Returns:
- Expression of type
HxOperator.LambdaFunction. - Since:
- 9.5
- The arguments of the function (which are also HxExpressions of type
-
createLambdaFunction
Creates a lambda function with arguments. A lambda function is a particular expression composed of two parts:- The arguments of the function (which are also HxExpressions of type
HxOperator.Argument. - The body of the function. The body is an HxExpression that will be used to evaluate the result of the function. The body can be any HxExpression composed of any operands and operators supported by Hexaly Optimizer. Thus, the body expression can use the arguments of the function but can also capture and refer to expressions declared outside of the function.
HxOperator.Argumentthat corresponds to the number of arguments you want and your function expects. At the end of the evaluation of your function, the returned HxExpression will be used as the body of the Hexaly Optimizer function.- Parameters:
nbArgs- Number of arguments you want for your function.functor- A function (HxLambdaFunction) that acceptsHxExpressionas arguments and returns anHxExpressionthat will be used as the body of the new Hexaly Optimizer function you want to create.- Returns:
- Expression of type
HxOperator.LambdaFunction. - Since:
- 9.5
- The arguments of the function (which are also HxExpressions of type
-
boolVar
Creates a boolean decision. Binary decision variable with domain { 0, 1 }. This method is a shortcut forcreateExpression(.HxOperator.Bool)- Since:
- 5.5
- See Also:
-
floatVar
Creates a float decision. Decision variable with domain [lb, ub]. This method is a shortcut forcreateExpression(HxOperator.Float, lb, ub).- Parameters:
lb- Lower bound of the decision variable.ub- Upper bound of the decision variable.- Since:
- 5.5
- See Also:
-
intVar
Creates an integer decision. Decision variable with domain [lb, ub]. This method is a shortcut forcreateExpression(HxOperator.Int, lb, ub).- Parameters:
lb- Lower bound of the decision variable.ub- Upper bound of the decision variable.- Since:
- 5.5
- See Also:
-
intervalVar
Creates an interval decision included in [minStart, maxEnd). Start is inclusive and end is exclusive. This method is a shortcut forcreateExpression(HxOperator.Interval, minStart, maxEnd).- Parameters:
minStart- Min start of the decision variable.maxEnd- Max end of the decision variable.- Since:
- 12.0
- See Also:
-
optionalIntervalVar
Creates an optional interval decision, which can either be absent (void) or included in [minStart, maxEnd). When present, start is inclusive and end is exclusive. When absent, start and end are undefined. This method is a shortcut forcreateExpression(HxOperator.OptionalInterval, minStart, maxEnd).- Parameters:
minStart- Min start of the decision variable.maxEnd- Max end of the decision variable.- Since:
- 14.0
- See Also:
-
start
Creates a start expression. This method is a shortcut forcreateExpression(HxOperator.Start, a).- Since:
- 12.0
- See Also:
-
end
Creates an end expression. This method is a shortcut forcreateExpression(HxOperator.End, a).- Since:
- 12.0
- See Also:
-
length
Creates a length expression. This method is a shortcut forcreateExpression(HxOperator.Length, a).- Since:
- 12.0
- See Also:
-
presence
Creates a presence expression. This method is a shortcut forcreateExpression(HxOperator.Presence, a).- Since:
- 14.0
- See Also:
-
sum
Creates a sum expression. This method is a shortcut forcreateExpression(HxOperator.Sum).- Since:
- 5.5
- See Also:
-
sum
Creates a sum expression. This method is a shortcut forcreateExpression(HxOperator.Sum, a).- Since:
- 5.5
- See Also:
-
sum
Creates a sum expression. This method is a shortcut forcreateExpression(HxOperator.Sum, a).- Since:
- 12.5
- See Also:
-
sum
Creates a sum expression. This method is a shortcut forcreateExpression(HxOperator.Sum, a).- Since:
- 5.5
- See Also:
-
sum
Creates a sum expression. This method is a shortcut forcreateExpression(HxOperator.Sum, a, b).- Since:
- 5.5
- See Also:
-
sum
Creates a sum expression. This method is a shortcut forcreateExpression(HxOperator.Sum, operands).- Since:
- 5.5
- See Also:
-
sum
Creates a sum expression. This method is a shortcut forcreateExpression(HxOperator.Sum, operands).- Since:
- 5.5
- See Also:
-
sum
Creates a sum expression. This method is a shortcut forcreateExpression(HxOperator.Sum, a, b).- Since:
- 5.5
- See Also:
-
sum
Creates a sum expression. This method is a shortcut forcreateExpression(HxOperator.Sum, a, b).- Since:
- 5.5
- See Also:
-
sum
Creates a sum expression. This method is a shortcut forcreateExpression(HxOperator.Sum, a, b).- Since:
- 5.5
- See Also:
-
sum
Creates a sum expression. This method is a shortcut forcreateExpression(HxOperator.Sum, a, b).- Since:
- 5.5
- See Also:
-
sub
Creates a substraction expression. This method is a shortcut forcreateExpression(HxOperator.Sub, a, b).- Since:
- 5.5
- See Also:
-
sub
Creates a substraction expression. This method is a shortcut forcreateExpression(HxOperator.Sub, a, b).- Since:
- 5.5
- See Also:
-
sub
Creates a substraction expression. This method is a shortcut forcreateExpression(HxOperator.Sub, a, b).- Since:
- 5.5
- See Also:
-
sub
Creates a substraction expression. This method is a shortcut forcreateExpression(HxOperator.Sub, a, b).- Since:
- 5.5
- See Also:
-
sub
Creates a substraction expression. This method is a shortcut forcreateExpression(HxOperator.Sub, a, b).- Since:
- 5.5
- See Also:
-
prod
Creates a product expression. This method is a shortcut forcreateExpression(HxOperator.Prod).- Since:
- 5.5
- See Also:
-
prod
Creates a product expression. This method is a shortcut forcreateExpression(HxOperator.Prod, a).- Since:
- 5.5
- See Also:
-
prod
Creates a product expression. This method is a shortcut forcreateExpression(HxOperator.Prod, a).- Since:
- 5.5
- See Also:
-
prod
Creates a product expression. This method is a shortcut forcreateExpression(HxOperator.Prod, a).- Since:
- 12.5
- See Also:
-
prod
Creates a product expression. This method is a shortcut forcreateExpression(HxOperator.Prod, a, b).- Since:
- 5.5
- See Also:
-
prod
Creates a product expression. This method is a shortcut forcreateExpression(HxOperator.Prod, operands).- Since:
- 5.5
- See Also:
-
prod
Creates a product expression. This method is a shortcut forcreateExpression(HxOperator.Prod, operands).- Since:
- 5.5
- See Also:
-
prod
Creates a product expression. This method is a shortcut forcreateExpression(HxOperator.Prod, a, b).- Since:
- 5.5
- See Also:
-
prod
Creates a product expression. This method is a shortcut forcreateExpression(HxOperator.Prod, a, b).- Since:
- 5.5
- See Also:
-
prod
Creates a product expression. This method is a shortcut forcreateExpression(HxOperator.Prod, a, b).- Since:
- 5.5
- See Also:
-
prod
Creates a product expression. This method is a shortcut forcreateExpression(HxOperator.Prod, a, b).- Since:
- 5.5
- See Also:
-
max
Creates a maximum expression. This method is a shortcut forcreateExpression(HxOperator.Max).- Since:
- 5.5
- See Also:
-
max
Creates a maximum expression. This method is a shortcut forcreateExpression(HxOperator.Max, a).- Since:
- 5.5
- See Also:
-
max
Creates a maximum expression. This method is a shortcut forcreateExpression(HxOperator.Max, a).- Since:
- 5.5
- See Also:
-
max
Creates a maximum expression. This method is a shortcut forcreateExpression(HxOperator.Max, a).- Since:
- 12.5
- See Also:
-
max
Creates a maximum expression. This method is a shortcut forcreateExpression(HxOperator.Max, a, b).- Since:
- 5.5
- See Also:
-
max
Creates a maximum expression. This method is a shortcut forcreateExpression(HxOperator.Max, operands).- Since:
- 5.5
- See Also:
-
max
Creates a maximum expression. This method is a shortcut forcreateExpression(HxOperator.Max, operands).- Since:
- 5.5
- See Also:
-
max
Creates a maximum expression. This method is a shortcut forcreateExpression(HxOperator.Max, a, b).- Since:
- 5.5
- See Also:
-
max
Creates a maximum expression. This method is a shortcut forcreateExpression(HxOperator.Max, a, b).- Since:
- 5.5
- See Also:
-
max
Creates a maximum expression. This method is a shortcut forcreateExpression(HxOperator.Max, a, b).- Since:
- 5.5
- See Also:
-
max
Creates a maximum expression. This method is a shortcut forcreateExpression(HxOperator.Max, a, b).- Since:
- 5.5
- See Also:
-
min
Creates a minimum expression. This method is a shortcut forcreateExpression(HxOperator.Min).- Since:
- 5.5
- See Also:
-
min
Creates a minimum expression. This method is a shortcut forcreateExpression(HxOperator.Min, a).- Since:
- 5.5
- See Also:
-
min
Creates a minimum expression. This method is a shortcut forcreateExpression(HxOperator.Min, a).- Since:
- 5.5
- See Also:
-
min
Creates a minimum expression. This method is a shortcut forcreateExpression(HxOperator.Min, a).- Since:
- 12.5
- See Also:
-
min
Creates a minimum expression. This method is a shortcut forcreateExpression(HxOperator.Min, a, b).- Since:
- 5.5
- See Also:
-
min
Creates a minimum expression. This method is a shortcut forcreateExpression(HxOperator.Min, operands).- Since:
- 5.5
- See Also:
-
min
Creates a minimum expression. This method is a shortcut forcreateExpression(HxOperator.Min, operands).- Since:
- 5.5
- See Also:
-
min
Creates a minimum expression. This method is a shortcut forcreateExpression(HxOperator.Min, a, b).- Since:
- 5.5
- See Also:
-
min
Creates a minimum expression. This method is a shortcut forcreateExpression(HxOperator.Min, a, b).- Since:
- 5.5
- See Also:
-
min
Creates a minimum expression.- Since:
- 5.5
- See Also:
-
min
Creates a minimum expression. This method is a shortcut forcreateExpression(HxOperator.Min, a, b).- Since:
- 5.5
- See Also:
-
eq
Creates an equality expression. This method is a shortcut forcreateExpression(HxOperator.Eq, a, b).- Since:
- 5.5
- See Also:
-
eq
Creates an equality expression. This method is a shortcut forcreateExpression(HxOperator.Eq, a, b).- Since:
- 5.5
- See Also:
-
eq
Creates an equality expression. This method is a shortcut forcreateExpression(HxOperator.Eq, a, b).- Since:
- 5.5
- See Also:
-
eq
Creates an equality expression. This method is a shortcut forcreateExpression(HxOperator.Eq, a, b).- Since:
- 5.5
- See Also:
-
eq
Creates an equality expression. This method is a shortcut forcreateExpression(HxOperator.Eq, a, b).- Since:
- 5.5
- See Also:
-
neq
Creates a disequality expression. This method is a shortcut forcreateExpression(HxOperator.Neq, a, b).- Since:
- 5.5
- See Also:
-
neq
Creates a disequality expression. This method is a shortcut forcreateExpression(HxOperator.Neq, a, b).- Since:
- 5.5
- See Also:
-
neq
Creates a disequality expression. This method is a shortcut forcreateExpression(HxOperator.Neq, a, b).- Since:
- 5.5
- See Also:
-
neq
Creates a disequality expression. This method is a shortcut forcreateExpression(HxOperator.Neq, a, b).- Since:
- 5.5
- See Also:
-
neq
Creates a disequality expression. This method is a shortcut forcreateExpression(HxOperator.Neq, a, b).- Since:
- 5.5
- See Also:
-
geq
Creates an inequality expression greater than or equal to. This method is a shortcut forcreateExpression(HxOperator.Geq, a, b).- Since:
- 5.5
- See Also:
-
geq
Creates an inequality expression greater than or equal to. This method is a shortcut forcreateExpression(HxOperator.Geq, a, b).- Since:
- 5.5
- See Also:
-
geq
Creates an inequality expression greater than or equal to. This method is a shortcut forcreateExpression(HxOperator.Geq, a, b).- Since:
- 5.5
- See Also:
-
geq
Creates an inequality expression greater than or equal to. This method is a shortcut forcreateExpression(HxOperator.Geq, a, b).- Since:
- 5.5
- See Also:
-
geq
Creates an inequality expression greater than or equal to. This method is a shortcut forcreateExpression(HxOperator.Geq, a, b).- Since:
- 5.5
- See Also:
-
leq
Creates an inequality expression less than or equal to. This method is a shortcut forcreateExpression(HxOperator.Leq, a, b).- Since:
- 5.5
- See Also:
-
leq
Creates an inequality expression less than or equal to. This method is a shortcut forcreateExpression(HxOperator.Leq, a, b).- Since:
- 5.5
- See Also:
-
leq
Creates an inequality expression less than or equal to. This method is a shortcut forcreateExpression(HxOperator.Leq, a, b).- Since:
- 5.5
- See Also:
-
leq
Creates an inequality expression less than or equal to. This method is a shortcut forcreateExpression(HxOperator.Leq, a, b).- Since:
- 5.5
- See Also:
-
leq
Creates an inequality expression less than or equal to. This method is a shortcut forcreateExpression(HxOperator.Leq, a, b).- Since:
- 5.5
- See Also:
-
gt
Creates an inequality expression greater than. This method is a shortcut forcreateExpression(HxOperator.Gt, a, b).- Since:
- 5.5
- See Also:
-
gt
Creates an inequality expression greater than. This method is a shortcut forcreateExpression(HxOperator.Gt, a, b).- Since:
- 5.5
- See Also:
-
gt
Creates an inequality expression greater than. This method is a shortcut forcreateExpression(HxOperator.Gt, a, b).- Since:
- 5.5
- See Also:
-
gt
Creates an inequality expression greater than. This method is a shortcut forcreateExpression(HxOperator.Gt, a, b).- Since:
- 5.5
- See Also:
-
gt
Creates an inequality expression greater than. This method is a shortcut forcreateExpression(HxOperator.Gt, a, b).- Since:
- 5.5
- See Also:
-
lt
Creates an inequality expression less than. This method is a shortcut forcreateExpression(HxOperator.Lt, a, b).- Since:
- 5.5
- See Also:
-
lt
Creates an inequality expression less than. This method is a shortcut forcreateExpression(HxOperator.Lt, a, b).- Since:
- 5.5
- See Also:
-
lt
Creates an inequality expression less than. This method is a shortcut forcreateExpression(HxOperator.Lt, a, b).- Since:
- 5.5
- See Also:
-
lt
Creates an inequality expression less than. This method is a shortcut forcreateExpression(HxOperator.Lt, a, b).- Since:
- 5.5
- See Also:
-
lt
Creates an inequality expression less than. This method is a shortcut forcreateExpression(HxOperator.Lt, a, b).- Since:
- 5.5
- See Also:
-
iif
Creates a ternary conditional expression. This method is a shortcut forcreateExpression(HxOperator.If, a, b, c).- Since:
- 5.5
- See Also:
-
iif
Creates a ternary conditional expression. This method is a shortcut forcreateExpression(HxOperator.If, a, b, c).- Since:
- 5.5
- See Also:
-
iif
Creates a ternary conditional expression. This method is a shortcut forcreateExpression(HxOperator.If, a, b, c).- Since:
- 5.5
- See Also:
-
iif
Creates a ternary conditional expression. This method is a shortcut forcreateExpression(HxOperator.If, a, b, c).- Since:
- 5.5
- See Also:
-
iif
Creates a ternary conditional expression. This method is a shortcut forcreateExpression(HxOperator.If, a, b, c).- Since:
- 5.5
- See Also:
-
iif
Creates a ternary conditional expression. This method is a shortcut forcreateExpression(HxOperator.If, a, b, c).- Since:
- 5.5
- See Also:
-
iif
Creates a ternary conditional expression. This method is a shortcut forcreateExpression(HxOperator.If, a, b, c).- Since:
- 5.5
- See Also:
-
not
Creates a NOT expression. This method is a shortcut forcreateExpression(HxOperator.Not, a).- Since:
- 5.5
- See Also:
-
and
Creates an AND expression. This method is a shortcut forcreateExpression(HxOperator.And).- Since:
- 5.5
- See Also:
-
and
Creates an AND expression. This method is a shortcut forcreateExpression(HxOperator.And, a).- Since:
- 12.5
- See Also:
-
and
Creates an AND expression. This method is a shortcut forcreateExpression(HxOperator.And, a, b).- Since:
- 5.5
- See Also:
-
and
Creates an AND expression. This method is a shortcut forcreateExpression(HxOperator.And, operands).- Since:
- 5.5
- See Also:
-
and
Creates an AND expression. This method is a shortcut forcreateExpression(HxOperator.And, operands).- Since:
- 5.5
- See Also:
-
or
Creates a OR expression. This method is a shortcut forcreateExpression(HxOperator.Or).- Since:
- 5.5
- See Also:
-
or
Creates a OR expression. This method is a shortcut forcreateExpression(HxOperator.Or, a).- Since:
- 12.5
- See Also:
-
or
Creates a OR expression. This method is a shortcut forcreateExpression(HxOperator.Or, a, b).- Since:
- 5.5
- See Also:
-
or
Creates a OR expression. This method is a shortcut forcreateExpression(HxOperator.Or, operands).- Since:
- 5.5
- See Also:
-
or
Creates a OR expression. This method is a shortcut forcreateExpression(HxOperator.Or, operands).- Since:
- 5.5
- See Also:
-
xor
Creates a XOR expression. This method is a shortcut forcreateExpression(HxOperator.Xor).- Since:
- 5.5
- See Also:
-
xor
Creates a XOR expression. This method is a shortcut forcreateExpression(HxOperator.Xor, a).- Since:
- 12.5
- See Also:
-
xor
Creates a XOR expression. This method is a shortcut forcreateExpression(HxOperator.Xor, operands).- Since:
- 5.5
- See Also:
-
xor
Creates a XOR expression. This method is a shortcut forcreateExpression(HxOperator.Xor, a, b).- Since:
- 5.5
- See Also:
-
xor
Creates a XOR expression. This method is a shortcut forcreateExpression(HxOperator.Xor, operands).- Since:
- 5.5
- See Also:
-
abs
Creates an absolute value expression. This method is a shortcut forcreateExpression(HxOperator.Abs, a).- Since:
- 5.5
- See Also:
-
dist
Creates a distance expression. This method is a shortcut forcreateExpression(HxOperator.Dist, a, b).- Since:
- 5.5
- See Also:
-
dist
Creates a distance expression. This method is a shortcut forcreateExpression(HxOperator.Dist, a, b).- Since:
- 5.5
- See Also:
-
dist
Creates a distance expression. This method is a shortcut forcreateExpression(HxOperator.Dist, a, b).- Since:
- 5.5
- See Also:
-
dist
Creates a distance expression. This method is a shortcut forcreateExpression(HxOperator.Dist, a, b).- Since:
- 5.5
- See Also:
-
dist
Creates a distance expression. This method is a shortcut forcreateExpression(HxOperator.Dist, a, b).- Since:
- 5.5
- See Also:
-
div
Creates a division expression. This method is a shortcut forcreateExpression(HxOperator.Div, a, b).- Since:
- 5.5
- See Also:
-
div
Creates a division expression. This method is a shortcut forcreateExpression(HxOperator.Div, a, b).- Since:
- 5.5
- See Also:
-
div
Creates a division expression. This method is a shortcut forcreateExpression(HxOperator.Div, a, b).- Since:
- 5.5
- See Also:
-
div
Creates a division expression. This method is a shortcut forcreateExpression(HxOperator.Div, a, b).- Since:
- 5.5
- See Also:
-
div
Creates a division expression. This method is a shortcut forcreateExpression(HxOperator.Div, a, b).- Since:
- 5.5
- See Also:
-
mod
Creates a modulo expression. This method is a shortcut forcreateExpression(HxOperator.Mod, a, b).- Since:
- 5.5
- See Also:
-
mod
Creates a modulo expression. This method is a shortcut forcreateExpression(HxOperator.Mod, a, b).- Since:
- 5.5
- See Also:
-
mod
Creates a modulo expression. This method is a shortcut forcreateExpression(HxOperator.Mod, a, b).- Since:
- 5.5
- See Also:
-
array
Creates an array expression. This method is a shortcut forcreateExpression(HxOperator.Array).- Since:
- 5.5
- See Also:
-
array
Creates an N-dimensional array expression. This method attempts to create array in a recursive way: if an operand is iterable, it will be turned into an array too, and so on.- Since:
- 5.5
- See Also:
-
array
Creates an array expression. This method is a shortcut forcreateExpression(HxOperator.Array, operands).- Since:
- 7.0
- See Also:
-
array
Creates an array expression. This method is a shortcut forcreateExpression(HxOperator.Array, operands).- Since:
- 5.5
- See Also:
-
array
Creates an array expression. This method is a shortcut forcreateExpression(HxOperator.Array, operands).- Since:
- 7.0
- See Also:
-
array
Creates an array expression. This method is a shortcut forcreateExpression(HxOperator.Array, operands).- Since:
- 5.5
- See Also:
-
array
Creates an array expression. This method is a shortcut forcreateExpression(HxOperator.Array, operands).- Since:
- 5.5
- See Also:
-
array
Creates an array expression. This method is a shortcut forcreateExpression(HxOperator.Array, operands).- Since:
- 12.0
- See Also:
-
array
Creates an array expression. This method is a shortcut forcreateExpression(HxOperator.Array, operands).- Since:
- 12.0
- See Also:
-
stepArray
Creates a stepArray expression. This method is a shortcut forcreateExpression(HxOperator.stepArray, array_1, array_2).- Since:
- 13.0
- See Also:
-
constArray
Creates a constant array expression. This method is a shortcut forcreateConstArray(values).- Since:
- 13.5
- See Also:
-
constArray
Creates a constant array expression. This method is a shortcut forcreateConstArray(values).- Since:
- 13.5
- See Also:
-
sort
Creates a sorted array in ascending order, containing integer if the input is a collection or an array with only integers or boolean, and containing doubles if the array has at least one double. This method is a shortcut forcreateExpression(HxOperator.Sort, expr).- Since:
- 11.0
- See Also:
-
sort
Creates a sorted array, containing integer if the input is a collection or an array with only integers or boolean, and containing doubles if the array has at least one double. It is sorted in ascending order based on the values returned by the lambda function given as second parameter. The sort operator guarantees that the order of elements having the same key is preserved, except when the object is a set. In that case, the order of elements having the same key will be determined by their ascending values. This method is a shortcut forcreateExpression(HxOperator.Sort, expr, lambda).- Since:
- 12.5
- See Also:
-
at
Creates a "at" expression for N-dimensional array. This method is a shortcut forcreateExpression(HxOperator.At, array, indices).- Since:
- 5.5
- See Also:
-
at
Creates a "at" expression. This method is a shortcut forcreateExpression(HxOperator.At, array, index).- Since:
- 5.5
- See Also:
-
scalar
Creates an expression for the scalar product between two arrays. This method is a shortcut forcreateExpression(HxOperator.Scalar, a, b).- Since:
- 5.5
- See Also:
-
ceil
Creates a ceil expression. This method is a shortcut forcreateExpression(HxOperator.Ceil, a).- Since:
- 5.5
- See Also:
-
floor
Creates a floor expression. This method is a shortcut forcreateExpression(HxOperator.Floor, a).- Since:
- 5.5
- See Also:
-
round
Creates a rounding expression. This method is a shortcut forcreateExpression(HxOperator.Round, a).- Since:
- 5.5
- See Also:
-
sqrt
Creates a square root expression. This method is a shortcut forcreateExpression(HxOperator.Sqrt, a).- Since:
- 5.5
- See Also:
-
log
Creates a log expression. This method is a shortcut forcreateExpression(HxOperator.Log, a).- Since:
- 5.5
- See Also:
-
exp
Creates an exponential expression. This method is a shortcut forcreateExpression(HxOperator.Exp, a).- Since:
- 5.5
- See Also:
-
pow
Creates a power expression. This method is a shortcut forcreateExpression(HxOperator.Pow, a, b).- Since:
- 5.5
- See Also:
-
pow
Creates a power expression. This method is a shortcut forcreateExpression(HxOperator.Pow, a, b).- Since:
- 5.5
- See Also:
-
pow
Creates a power expression. This method is a shortcut forcreateExpression(HxOperator.Pow, a, b).- Since:
- 5.5
- See Also:
-
pow
Creates a power expression. This method is a shortcut forcreateExpression(HxOperator.Pow, a, b).- Since:
- 5.5
- See Also:
-
pow
Creates a power expression. This method is a shortcut forcreateExpression(HxOperator.Pow, a, b).- Since:
- 5.5
- See Also:
-
cos
Creates a cosine expression. This method is a shortcut forcreateExpression(HxOperator.Cos, a).- Since:
- 5.5
- See Also:
-
sin
Creates a sine expression. This method is a shortcut forcreateExpression(HxOperator.Sin, a).- Since:
- 5.5
- See Also:
-
tan
Creates a tangent expression. This method is a shortcut forcreateExpression(HxOperator.Tan, a).- Since:
- 5.5
- See Also:
-
piecewise
Creates a piecewise linear expression. This method is a shortcut forcreateExpression(HxOperator.Piecewise, abscissae, ordinates, x). -
listVar
Creates a list decision with the given length. A list is an ordered collection of integers within a range [0, n-1]. This method is a shortcut forcreateExpression(HxOperator.List, n).- Parameters:
n- Collection size.- Since:
- 5.5
- See Also:
-
setVar
Creates a set decision with the given length. A set is an unordered collection of integers within a domain [0, n-1]. This method is a shortcut forcreateExpression(HxOperator.Set, n).- Parameters:
n- Collection size.- Since:
- 8.0
- See Also:
-
count
Creates a count expression. This method is a shortcut forcreateExpression(HxOperator.Count, a).- Since:
- 5.5
- See Also:
-
indexOf
Creates an indexOf expression. This method is a shortcut forcreateExpression(HxOperator.IndexOf, a, b).- Since:
- 5.5
- See Also:
-
indexOf
Creates an indexOf expression. This method is a shortcut forcreateExpression(HxOperator.IndexOf, a, b).- Since:
- 5.5
- See Also:
-
distinct
Creates an distinct expression. This method is a shortcut forcreateExpression(HxOperator.Distinct, a).- Since:
- 12.5
- See Also:
-
distinct
Creates an distinct expression. This method is a shortcut forcreateExpression(HxOperator.Distinct, a, b).- Since:
- 12.5
- See Also:
-
intersection
Creates an intersection expression. This method is a shortcut forcreateExpression(HxOperator.Intersection, a, b).- Since:
- 12.5
- See Also:
-
intersection
Creates an intersection expression of n intervals. This method is a shortcut forcreateExpression(HxOperator.Intersection, operands).- Since:
- 13.5
- See Also:
-
union
Creates an union expression of n iterables. This method is a shortcut forcreateExpression(HxOperator.Union, operands).- Since:
- 13.5
- See Also:
-
hull
Creates a hull expression. This method is a shortcut forcreateExpression(HxOperator.hull, operands).- Since:
- 13.0
- See Also:
-
hull
Creates a hull expression. This method is a shortcut forcreateExpression(HxOperator.hull, array).- Since:
- 13.0
- See Also:
-
hull
Creates a hull expression. This method is a shortcut forcreateExpression(HxOperator.hull).- Since:
- 13.0
- See Also:
-
contains
Creates a contains expression. This method is a shortcut forcreateExpression(HxOperator.Contains, a, b).- Since:
- 7.5
- See Also:
-
contains
Creates a contains expression. This method is a shortcut forcreateExpression(HxOperator.Contains, a, b).- Since:
- 7.5
- See Also:
-
partition
Creates a partition expression. This method is a shortcut forcreateExpression(HxOperator.Partition).- Since:
- 5.5
- See Also:
-
partition
Creates a partition expression. This method is a shortcut forcreateExpression(HxOperator.Partition, operands).- Since:
- 5.5
- See Also:
-
partition
Creates a partition expression. This method is a shortcut forcreateExpression(HxOperator.Partition, operands).- Since:
- 5.5
- See Also:
-
partition
Creates a partition expression. This method is a shortcut forcreateExpression(HxOperator.Partition, array).- Since:
- 10.5
- See Also:
-
disjoint
Creates a disjoint expression. This method is a shortcut forcreateExpression(HxOperator.Disjoint).- Since:
- 5.5
- See Also:
-
disjoint
Creates a disjoint expression. This method is a shortcut forcreateExpression(HxOperator.Disjoint, operands).- Since:
- 5.5
- See Also:
-
disjoint
Creates a disjoint expression. This method is a shortcut forcreateExpression(HxOperator.Disjoint, operands).- Since:
- 5.5
- See Also:
-
disjoint
Creates a disjoint expression. This method is a shortcut forcreateExpression(HxOperator.Disjoint, array).- Since:
- 10.5
- See Also:
-
cover
Creates a cover expression. This method is a shortcut forcreateExpression(HxOperator.Cover).- Since:
- 10.5
- See Also:
-
cover
Creates a cover expression. This method is a shortcut forcreateExpression(HxOperator.Cover, operands).- Since:
- 10.5
- See Also:
-
cover
Creates a cover expression. This method is a shortcut forcreateExpression(HxOperator.Cover, operands).- Since:
- 10.5
- See Also:
-
cover
Creates a cover expression. This method is a shortcut forcreateExpression(HxOperator.Cover, array).- Since:
- 10.5
- See Also:
-
find
Creates a find expression. This method is a shortcut forcreateExpression(HxOperator.Find, a, b).- Since:
- 10.5
- See Also:
-
find
Creates a find expression. This method is a shortcut forcreateExpression(HxOperator.Find, a, b).- Since:
- 10.5
- See Also:
-
intExternalFunction
Creates an external function expression. This method is a shortcut forcreateIntExternalFunction(func). -
doubleExternalFunction
Creates an external function expression. This method is a shortcut forcreateDoubleExternalFunction(func). -
intArrayExternalFunction
Creates an external function expression. This method is a shortcut forcreateIntArrayExternalFunction(func) -
doubleArrayExternalFunction
Creates an external function expression. This method is a shortcut forcreateDoubleArrayExternalFunction(func) -
lambdaFunction
Creates a lambda function expression. This method is a shortcut forcreateLambdaFunction(nbArgs, functor).- Since:
- 9.5
- See Also:
-
lambdaFunction
Creates a lambda function expression. This method is a shortcut forcreateLambdaFunction(functor).- Since:
- 9.5
- See Also:
-
lambdaFunction
Creates a lambda function expression. This method is a shortcut forcreateLambdaFunction(functor).- Since:
- 9.5
- See Also:
-
lambdaFunction
Creates a lambda function expression. This method is a shortcut forcreateLambdaFunction(functor).- Since:
- 9.5
- See Also:
-
lambdaFunction
Creates a lambda function expression. This method is a shortcut forcreateLambdaFunction(functor).- Since:
- 9.5
- See Also:
-
call
Creates a call expression. The first operand must be a function of typeHxOperator.LambdaFunctionorHxOperator.ExternalFunction. The other operands may be HxExpressions, booleans, integers, and doubles. They are passed to the function as arguments. This method is a shortcut forcreateExpression(HxOperator.Call).- Since:
- 6.0
- See Also:
-
call
Creates a call expression. The first operand must be a function of typeHxOperator.LambdaFunctionorHxOperator.ExternalFunction. The other operands may be HxExpressions, booleans, integers, and doubles. They are passed to the function as arguments. This method is a shortcut forcreateExpression(HxOperator.Call).- Since:
- 6.0
- See Also:
-
call
Creates a call expression. The first operand must be a function of typeHxOperator.LambdaFunctionorHxOperator.ExternalFunction. The other operands may be HxExpressions, booleans, integers, and doubles. They are passed to the function as arguments. This method is a shortcut forcreateExpression(HxOperator.Call).- Since:
- 6.0
- See Also:
-
call
Creates a call expression. The first operand must be a function of typeHxOperator.LambdaFunctionorHxOperator.ExternalFunction. The other operands may be HxExpressions, booleans, integers, and doubles. They are passed to the function as arguments. This method is a shortcut forcreateExpression(HxOperator.Call).- Since:
- 6.0
- See Also:
-
call
Creates a call expression. The first operand must be a function of typeHxOperator.LambdaFunctionorHxOperator.ExternalFunction. The other operands may be HxExpressions, booleans, integers, and doubles. They are passed to the function as arguments. This method is a shortcut forcreateExpression(HxOperator.Call).- Since:
- 6.0
- See Also:
-
call
Creates a call expression. The first operand must be a function of typeHxOperator.LambdaFunctionorHxOperator.ExternalFunction. The other operands may be HxExpressions, booleans, integers, and doubles. They are passed to the function as arguments. This method is a shortcut forcreateExpression(HxOperator.Call).- Since:
- 6.0
- See Also:
-
range
Creates a range expression, where a is the lower bound (inclusive) and b is the upper bound (exclusive). This method is a shortcut forcreateExpression(HxOperator.Range, a, b).- Since:
- 7.0
- See Also:
-
range
Creates a range expression, where a is the lower bound (inclusive) and b is the upper bound (exclusive). This method is a shortcut forcreateExpression(HxOperator.Range, a, b).- Since:
- 7.0
- See Also:
-
range
Creates a range expression, where a is the lower bound (inclusive) and b is the upper bound (exclusive). This method is a shortcut forcreateExpression(HxOperator.Range, a, b).- Since:
- 7.0
- See Also:
-
range
Creates a range expression, where a is the lower bound (inclusive) and b is the upper bound (exclusive). This method is a shortcut forcreateExpression(HxOperator.Range, a, b).- Since:
- 7.0
- See Also:
-
getNbExpressions
public int getNbExpressions()Gets the number of expressions added to this model.- Returns:
- Number of expressions.
-
getExpression
Gets the expression with the given index in this model.- Parameters:
exprIndex- Index of the expression.- Returns:
- Expression with the given index.
-
getExpression
Gets the expression with the given index in this model.- Parameters:
name- Name of the expression.- Returns:
- Expression with the given index.
-
getNbDecisions
public int getNbDecisions()Gets the number of decisions in the model. This corresponds to the number of decision variables declared in the model.- Returns:
- Number of decisions.
-
getDecision
Gets the decision with the given index.- Parameters:
decisionIndex- Index of the decision.- Returns:
- Decision with the given index.
-
addConstraint
Adds the given expression to the list of constraints. It means that the value of this expression must be constrained to be equal to 1 in any solution found by the optimizer. Hence, only boolean expressions (that is, expressions whose value is boolean) can be constrained. Only allowed in stateHxState.Modeling. If the expression is already a constraint, this method does nothing and returns immediately.- Parameters:
expr- Expression.
-
constraint
Shortcut for addConstraint(expr).- Parameters:
expr- Expression.- Since:
- 5.5
- See Also:
-
removeConstraint
Removes the given expression from the list of constraints. If the expression was not constrained, this method does nothing and returns immediately. Only allowed in stateHxState.Modeling.- Parameters:
expr- Expression.- Since:
- 5.0
-
removeConstraint
public void removeConstraint(int constraintIndex) Removes the constraint at the given position in the list of constraints. Only allowed in stateHxState.Modeling.- Parameters:
constraintIndex- position of the constraint to remove.- Since:
- 5.0
-
getNbConstraints
public int getNbConstraints()Gets the number of constraints added to this model.- Returns:
- Number of constraints.
-
getConstraint
Gets the constraint with the given index.- Parameters:
constraintIndex- Index of the constraint.- Returns:
- Constraint with the given index.
-
addObjective
Adds the given expression to the list of objectives to optimize. A same expression can be added more than once. Only allowed in stateHxState.Modeling. Note that the objectives will be optimized in the order in which they have been added to the model. It is useful for lexicographic multiobjective optimization, and more particularly for goal programming.- Parameters:
expr- Expression.direction- Optimization direction of this objective.
-
minimize
Shortcut for addObjective(expr, OD_Minimize).- Parameters:
expr- Expression.- Since:
- 5.5
- See Also:
-
maximize
Shortcut for addObjective(expr, OD_Maximize).- Parameters:
expr- Expression.- Since:
- 5.5
- See Also:
-
removeObjective
public void removeObjective(int objectiveIndex) Removes the objective at the given position in the list of objectives. Note that the objectives created after the removed one have their index decreased by 1. Phases are not modified when an objective is removed. It is the user's responsibility to change the objective index of each phase to keep it coherent (withHxPhase.setOptimizedObjective(int)), or to disable it (withHxPhase.setEnabled(boolean)). Only allowed in stateHxState.Modeling.- Parameters:
objectiveIndex- position of the objective to remove.- Since:
- 5.0
-
getNbObjectives
public int getNbObjectives()Gets the number of objectives added to this model.- Returns:
- Number of objectives.
-
getObjective
Gets the objective with the given index.- Parameters:
objectiveIndex- Index of the objective.- Returns:
- Objective with the given index.
-
getObjectiveDirection
Gets the direction of the objective with the given index.- Parameters:
objectiveIndex- Index of the objective.- Returns:
- Objective direction.
-
getNbOperands
public int getNbOperands()Gets the number of operands in the model. This corresponds to the number of operands for all expressions declared in the model. It is an analog of the number of non zeros in matrix model encountered in mathematical programming: it gives an hint about the size and the density of your model.- Returns:
- Number of operands.
-
close
public void close()Closes the model. Only allowed in stateHxState.Modeling. When this method is called, the optimizer is placed in stateHxState.Stopped. Once the model is closed, no expressions, constraints or objectives can be added or removed unless the model is reopened. The model must be closed before starting its resolution. -
open
public void open()Reopens the model. Only allowed in stateHxState.Stopped. When this method is called, the optimizer is placed in stateHxState.Modeling. In this state, the model can be modified: it is possible to add new expressions, constraints or objectives, modify expression operands, and remove existing constraints and objectives. However, existing expressions cannot be deleted. Note that the solution will be reset when the model is closed again. -
isClosed
public boolean isClosed()Returns true if the model is closed, false otherwise.- Returns:
- True if the model is closed.
-
toString
Returns a String representation of this model. This representation provides:- The number of expressions, decisions, constraints, and objectives.
- The density of the model.
-
hashCode
public int hashCode() -
equals
-