Module org.chocosolver.solver
Class ArExpression.IntPrimitive
- java.lang.Object
-
- org.chocosolver.solver.expression.discrete.arithmetic.ArExpression.IntPrimitive
-
- All Implemented Interfaces:
ArExpression
- Enclosing interface:
- ArExpression
public static class ArExpression.IntPrimitive extends Object implements ArExpression
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.chocosolver.solver.expression.discrete.arithmetic.ArExpression
ArExpression.IntPrimitive, ArExpression.Operator
-
-
Field Summary
-
Fields inherited from interface org.chocosolver.solver.expression.discrete.arithmetic.ArExpression
NO_CHILD
-
-
Constructor Summary
Constructors Constructor Description IntPrimitive(int value, Model model)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
extractVar(HashSet<IntVar> variables)
Extract the variables from this expressionModel
getModel()
Return the associated modelint
ieval(int[] values, Map<IntVar,Integer> map)
IntVar
intVar()
boolean
isExpressionLeaf()
OptionalInt
primitive()
String
toString()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.chocosolver.solver.expression.discrete.arithmetic.ArExpression
abs, add, add, add, dist, dist, div, div, eq, eq, eq, ge, ge, getExpressionChild, getNoChild, gt, gt, in, in, le, le, lt, lt, max, max, max, min, min, min, mod, mod, mul, mul, mul, ne, ne, neg, pow, pow, sqr, sub, sub
-
-
-
-
Constructor Detail
-
IntPrimitive
public IntPrimitive(int value, Model model)
-
-
Method Detail
-
primitive
public OptionalInt primitive()
- Specified by:
primitive
in interfaceArExpression
- Returns:
- an
OptionalInt
which contains anint
this expression is a primitive.
-
getModel
public Model getModel()
Description copied from interface:ArExpression
Return the associated model- Specified by:
getModel
in interfaceArExpression
- Returns:
- a Model object
-
intVar
public IntVar intVar()
- Specified by:
intVar
in interfaceArExpression
- Returns:
- the arithmetic expression as an
IntVar
. If necessary, it creates intermediary variable and posts intermediary constraints
-
isExpressionLeaf
public boolean isExpressionLeaf()
- Specified by:
isExpressionLeaf
in interfaceArExpression
- Returns:
- true if this expression is a leaf, ie a variable, false otherwise
-
extractVar
public void extractVar(HashSet<IntVar> variables)
Description copied from interface:ArExpression
Extract the variables from this expression- Specified by:
extractVar
in interfaceArExpression
- Parameters:
variables
- set of variables
-
ieval
public int ieval(int[] values, Map<IntVar,Integer> map)
- Specified by:
ieval
in interfaceArExpression
- Parameters:
values
- int values to evaluatemap
- mapping between variables of the topmost expression and position in values- Returns:
- an evaluation of this expression with a tuple
-
-