Localsolver
5.5
|
Mathematical optimization model.
A model is composed of expressions (some of which are decisions), organized as a tree. Then, some expressions of the model can be constrained or optimized. Once your optimization model is created and closed, the solver can be launched to resolve it. Note that you cannot modify a model which has been closed: you must reopen-it (with Open()) or instantiate another LocalSolver environment to optimize another model.
Public Member Functions | |
LSExpression | CreateConstant (long value) |
Creates a constant expression representing the given value. | |
LSExpression | CreateConstant (double value) |
Creates a constant expression representing the given value. | |
LSExpression | CreateExpression (LSOperator op) |
Creates an expression of the given type. | |
LSExpression | CreateExpression (LSOperator op, LSExpression expr0) |
Creates an expression of the given type, with the given operand. | |
LSExpression | CreateExpression (LSOperator op, LSExpression expr0, LSExpression expr1) |
Creates an expression of the given type, with the given ordered operands. | |
LSExpression | CreateExpression (LSOperator op, LSExpression expr0, LSExpression expr1, LSExpression expr2) |
Creates an expression of the given type, with the given ordered operands. | |
LSExpression | Bool () |
Creates a boolean decision. | |
LSExpression | Float (double min, double max) |
Creates a float decision. | |
LSExpression | Int (long min, long max) |
Creates an integer decision. | |
LSExpression | Sum () |
Creates a sum expression. | |
LSExpression | Sum (IEnumerable< LSExpression > operands) |
Creates a sum expression. | |
LSExpression | Sum (params LSExpression[] operands) |
Creates a sum expression. | |
LSExpression | Sum (long a) |
Creates a sum expression. | |
LSExpression | Sum (double a) |
Creates a sum expression. | |
LSExpression | Sum (LSExpression a, LSExpression b) |
Creates a sum expression. | |
LSExpression | Sum (long a, LSExpression b) |
Creates a sum expression. | |
LSExpression | Sum (LSExpression a, long b) |
Creates a sum expression. | |
LSExpression | Sum (double a, LSExpression b) |
Creates a sum expression. | |
LSExpression | Sum (LSExpression a, double b) |
Creates a sum expression. | |
LSExpression | Sub (LSExpression a, LSExpression b) |
Creates a substraction expression. | |
LSExpression | Sub (long a, LSExpression b) |
Creates a substraction expression. | |
LSExpression | Sub (LSExpression a, long b) |
Creates a substraction expression. | |
LSExpression | Sub (double a, LSExpression b) |
Creates a substraction expression. | |
LSExpression | Sub (LSExpression a, double b) |
Creates a substraction expression. | |
LSExpression | Prod () |
Creates a product expression. | |
LSExpression | Prod (IEnumerable< LSExpression > operands) |
Creates a product expression. | |
LSExpression | Prod (params LSExpression[] operands) |
Creates a product expression. | |
LSExpression | Prod (long a) |
Creates a product expression. | |
LSExpression | Prod (double a) |
Creates a product expression. | |
LSExpression | Prod (LSExpression a, LSExpression b) |
Creates a product expression. | |
LSExpression | Prod (LSExpression a, long b) |
Creates a product expression. | |
LSExpression | Prod (long a, LSExpression b) |
Creates a product expression. | |
LSExpression | Prod (LSExpression a, double b) |
Creates a product expression. | |
LSExpression | Prod (double a, LSExpression b) |
Creates a product expression. | |
LSExpression | Max () |
Creates a maximum expression. | |
LSExpression | Max (IEnumerable< LSExpression > operands) |
Creates a maximum expression. | |
LSExpression | Max (params LSExpression[] operands) |
Creates a maximum expression. | |
LSExpression | Max (long a) |
Creates a maximum expression. | |
LSExpression | Max (double a) |
Creates a maximum expression. | |
LSExpression | Max (LSExpression a, LSExpression b) |
Creates a maximum expression. | |
LSExpression | Max (LSExpression a, long b) |
Creates a maximum expression. | |
LSExpression | Max (long a, LSExpression b) |
Creates a maximum expression. | |
LSExpression | Max (LSExpression a, double b) |
Creates a maximum expression. | |
LSExpression | Max (double a, LSExpression b) |
Creates a maximum expression. | |
LSExpression | Min () |
Creates a minimum expression. | |
LSExpression | Min (IEnumerable< LSExpression > operands) |
Creates a minimum expression. | |
LSExpression | Min (params LSExpression[] operands) |
Creates a minimum expression. | |
LSExpression | Min (long a) |
Creates a minimum expression. | |
LSExpression | Min (double a) |
Creates a minimum expression. | |
LSExpression | Min (LSExpression a, LSExpression b) |
Creates a minimum expression. | |
LSExpression | Min (LSExpression a, long b) |
Creates a minimum expression. | |
LSExpression | Min (long a, LSExpression b) |
Creates a minimum expression. | |
LSExpression | Min (LSExpression a, double b) |
Creates a minimum expression. | |
LSExpression | Min (double a, LSExpression b) |
Creates a minimum expression. | |
LSExpression | Eq (LSExpression a, LSExpression b) |
Creates an equality expression. | |
LSExpression | Eq (LSExpression a, long b) |
Creates an equality expression. | |
LSExpression | Eq (long a, LSExpression b) |
Creates an equality expression. | |
LSExpression | Eq (LSExpression a, double b) |
Creates an equality expression. | |
LSExpression | Eq (double a, LSExpression b) |
Creates an equality expression. | |
LSExpression | Neq (LSExpression a, LSExpression b) |
Creates a disequality expression. | |
LSExpression | Neq (LSExpression a, long b) |
Creates a disequality expression. | |
LSExpression | Neq (long a, LSExpression b) |
Creates a disequality expression. | |
LSExpression | Neq (LSExpression a, double b) |
Creates a disequality expression. | |
LSExpression | Neq (double a, LSExpression b) |
Creates a disequality expression. | |
LSExpression | Geq (LSExpression a, LSExpression b) |
Creates an inequality expression greater than or equal to. | |
LSExpression | Geq (LSExpression a, long b) |
Creates an inequality expression greater than or equal to. | |
LSExpression | Geq (long a, LSExpression b) |
Creates an inequality expression greater than or equal to. | |
LSExpression | Geq (LSExpression a, double b) |
Creates an inequality expression greater than or equal to. | |
LSExpression | Geq (double a, LSExpression b) |
Creates an inequality expression greater than or equal to. | |
LSExpression | Leq (LSExpression a, LSExpression b) |
Creates an inequality expression less than or equal to. | |
LSExpression | Leq (LSExpression a, long b) |
Creates an inequality expression less than or equal to. | |
LSExpression | Leq (long a, LSExpression b) |
Creates an inequality expression less than or equal to. | |
LSExpression | Leq (LSExpression a, double b) |
Creates an inequality expression less than or equal to. | |
LSExpression | Leq (double a, LSExpression b) |
Creates an inequality expression less than or equal to. | |
LSExpression | Gt (LSExpression a, LSExpression b) |
Creates an inequality expression greater than. | |
LSExpression | Gt (LSExpression a, long b) |
Creates an inequality expression greater than. | |
LSExpression | Gt (long a, LSExpression b) |
Creates an inequality expression greater than. | |
LSExpression | Gt (LSExpression a, double b) |
Creates an inequality expression greater than. | |
LSExpression | Gt (double a, LSExpression b) |
Creates an inequality expression greater than. | |
LSExpression | Lt (LSExpression a, LSExpression b) |
Creates an inequality expression less than. | |
LSExpression | Lt (LSExpression a, long b) |
Creates an inequality expression less than. | |
LSExpression | Lt (long a, LSExpression b) |
Creates an inequality expression less than. | |
LSExpression | Lt (LSExpression a, double b) |
Creates an inequality expression less than. | |
LSExpression | Lt (double a, LSExpression b) |
Creates an inequality expression less than. | |
LSExpression | If (LSExpression a, LSExpression b, LSExpression c) |
Creates a ternary conditionnal expression. | |
LSExpression | If (LSExpression a, LSExpression b, long c) |
Creates a ternary conditionnal expression. | |
LSExpression | If (LSExpression a, long b, LSExpression c) |
Creates a ternary conditionnal expression. | |
LSExpression | If (LSExpression a, long b, long c) |
Creates a ternary conditionnal expression. | |
LSExpression | If (LSExpression a, LSExpression b, double c) |
Creates a ternary conditionnal expression. | |
LSExpression | If (LSExpression a, double b, LSExpression c) |
Creates a ternary conditionnal expression. | |
LSExpression | If (LSExpression a, double b, double c) |
Creates a ternary conditionnal expression. | |
LSExpression | Not (LSExpression a) |
Creates a NOT expression. | |
LSExpression | And () |
Creates an AND expression. | |
LSExpression | And (IEnumerable< LSExpression > operands) |
Creates an AND expression. | |
LSExpression | And (params LSExpression[] operands) |
Creates an AND expression. | |
LSExpression | And (LSExpression a, LSExpression b) |
Creates an AND expression. | |
LSExpression | Or () |
Creates a OR expression. | |
LSExpression | Or (IEnumerable< LSExpression > operands) |
Creates a OR expression. | |
LSExpression | Or (params LSExpression[] operands) |
Creates a OR expression. | |
LSExpression | Or (LSExpression a, LSExpression b) |
Creates a OR expression. | |
LSExpression | Xor () |
Creates a XOR expression. | |
LSExpression | Xor (IEnumerable< LSExpression > operands) |
Creates a XOR expression. | |
LSExpression | Xor (params LSExpression[] operands) |
Creates a XOR expression. | |
LSExpression | Xor (LSExpression a, LSExpression b) |
Creates a XOR expression. | |
LSExpression | Abs (LSExpression a) |
Creates an absolute value expression. | |
LSExpression | Dist (LSExpression a, LSExpression b) |
Creates a distance expression. | |
LSExpression | Dist (LSExpression a, long b) |
Creates a distance expression. | |
LSExpression | Dist (long a, LSExpression b) |
Creates a distance expression. | |
LSExpression | Dist (LSExpression a, double b) |
Creates a distance expression. | |
LSExpression | Dist (double a, LSExpression b) |
Creates a distance expression. | |
LSExpression | Div (LSExpression a, LSExpression b) |
Creates a division expression. | |
LSExpression | Div (LSExpression a, long b) |
Creates a division expression. | |
LSExpression | Div (long a, LSExpression b) |
Creates a division expression. | |
LSExpression | Div (LSExpression a, double b) |
Creates a division expression. | |
LSExpression | Div (double a, LSExpression b) |
Creates a division expression. | |
LSExpression | Mod (LSExpression a, LSExpression b) |
Creates a modulo expression. | |
LSExpression | Mod (LSExpression a, long b) |
Creates a modulo expression. | |
LSExpression | Mod (long a, LSExpression b) |
Creates a modulo expression. | |
LSExpression | Array () |
Creates an array expression. | |
LSExpression | Array (IEnumerable< LSExpression > operands) |
Creates an array expression. | |
LSExpression | Array (IEnumerable< long > operands) |
Creates an array expression. | |
LSExpression | Array (IEnumerable< double > operands) |
Creates an array expression. | |
LSExpression | Array (params LSExpression[] operands) |
Creates an array expression. | |
LSExpression | Array (params long[] operands) |
Creates an array expression. | |
LSExpression | Array (params double[] operands) |
Creates an array expression. | |
LSExpression | At (LSExpression arrayExpr, params LSExpression[] indicesExpr) |
Creates a "at" expression. | |
LSExpression | At (LSExpression arrayExpr, long index) |
Creates a "at" expression. | |
LSExpression | Scalar (LSExpression a, LSExpression b) |
Creates a scalar product expression between 2 arrays. | |
LSExpression | Ceil (LSExpression a) |
Creates a ceil expression. | |
LSExpression | Floor (LSExpression a) |
Creates a floor expression. | |
LSExpression | Round (LSExpression a) |
Creates a round expression. | |
LSExpression | Sqrt (LSExpression a) |
Creates a square root expression. | |
LSExpression | Log (LSExpression a) |
Creates a natural logarithm expression. | |
LSExpression | Exp (LSExpression a) |
Creates an exponential expression. | |
LSExpression | Pow (LSExpression a, LSExpression b) |
Creates a power expression. | |
LSExpression | Pow (LSExpression a, long b) |
Creates a power expression. | |
LSExpression | Pow (long a, LSExpression b) |
Creates a power expression. | |
LSExpression | Pow (LSExpression a, double b) |
Creates a power expression. | |
LSExpression | Pow (double a, LSExpression b) |
Creates a power expression. | |
LSExpression | Cos (LSExpression a) |
Creates a cosine expression. | |
LSExpression | Sin (LSExpression a) |
Creates a sine expression. | |
LSExpression | Tan (LSExpression a) |
Creates a tangent expression. | |
LSExpression | Piecewise (LSExpression abscissae, LSExpression ordinates, LSExpression x) |
Creates a piecewise linear expression. | |
LSExpression | List (long a) |
Creates a list variable. | |
LSExpression | Count (LSExpression a) |
Creates a count expression. | |
LSExpression | IndexOf (LSExpression a, long b) |
Creates an indexOf expression. | |
LSExpression | IndexOf (LSExpression a, LSExpression b) |
Creates an indexOf expression. | |
LSExpression | Partition () |
Creates a partition expression. | |
LSExpression | Partition (params LSExpression[] operands) |
Creates a partition expression. | |
LSExpression | Disjoint () |
Creates a disjoint expression. | |
LSExpression | Disjoint (params LSExpression[] operands) |
Creates a disjoint expression. | |
int | GetNbExpressions () |
Gets the number of expressions added to this model. | |
LSExpression | GetExpression (int exprIndex) |
Gets the expression with the given index in this model. | |
LSExpression | GetExpression (string name) |
Gets the expression with the given name. | |
int | GetNbDecisions () |
Gets the number of decisions in the model. | |
LSExpression | GetDecision (int decisionIndex) |
Gets the decision with the given index. | |
void | AddConstraint (LSExpression expr) |
Adds the given expression to the list of constraints. | |
void | Constraint (LSExpression expr) |
Shortcut for addConstraint(expr). | |
void | RemoveConstraint (LSExpression expr) |
Removes the given expression from the list of constraints. | |
void | RemoveConstraint (int constraintIndex) |
Removes the constraint at the given position in the list of constraints. | |
int | GetNbConstraints () |
Gets the number of constraints added to this model. | |
LSExpression | GetConstraint (int constraintIndex) |
Gets the constraint with the given index. | |
void | AddObjective (LSExpression expr, LSObjectiveDirection direction) |
Adds the given expression to the list of objectives to optimize. | |
void | Minimize (LSExpression expr) |
Shortcut for addObjective(expr, OD_Minimize). | |
void | Maximize (LSExpression expr) |
Shortcut for addObjective(expr, OD_Maximize). | |
void | RemoveObjective (int objectiveIndex) |
Removes the objective at the given position in the list of objectives. | |
int | GetNbObjectives () |
Gets the number of objectives added to this model. | |
LSExpression | GetObjective (int objectiveIndex) |
Gets the objective with the given index. | |
LSObjectiveDirection | GetObjectiveDirection (int objectiveIndex) |
Gets the direction of the objective with the given index. | |
int | GetNbOperands () |
Gets the number of operands in the model. | |
void | Close () |
Closes the model. | |
void | Open () |
Opens or reopens the model. | |
bool | IsClosed () |
Returns true if the model is closed, false otherwise. | |
override string | ToString () |
Returns a string representation of this model. |
|
inline |
Creates a constant expression representing the given value.
Only allowed in state LSState.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.
value | Value of the constant. |
|
inline |
Creates a constant expression representing the given value.
Only allowed in state LSState.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.
value | Value of the constant |
|
inline |
Creates an expression of the given type.
The expression is created without operand. Only allowed in state LSState.Modeling. This method cannot be used to create constants: use CreateConstant(long) or CreateConstant(double) instead.
op | Type of expression to create. |
|
inline |
Creates an expression of the given type, with the given operand.
Only allowed in state LSState.Modeling. Useful for creating unary expressions. The operand can be a double, an integer or a previously declared LSExpression.
T0 | type of the operand to add. Types allowed: constant types or LSExpression. |
op | Type of expression to create. |
expr0 | Operand 0. |
|
inline |
Creates an expression of the given type, with the given ordered operands.
Only allowed in state LSState.Modeling. Useful for creating binary expressions. The operands can be doubles, integers or previously declared LSExpressions. It is also possible to use this method with iterators. In that case, expr0 and expr1 must be iterators of the same type, pointing respectively to the initial and final positions of the operands
T0 | type of the operand to add. Types allowed: constant types, LSExpression or iterator. |
T1 | type of the operand to add. Types allowed: constant types, LSExpression or iterator. |
op | Type of expression to create. |
expr0 | Operand 0. |
expr1 | Operand 1. |
|
inline |
Creates an expression of the given type, with the given ordered operands.
Only allowed in state LSState.Modeling. Useful for creating ternary expressions (in particular, LSOperator.If expressions). The operands can be doubles, integers or previously declared LSExpressions.
T0 | type of the operand to add. Types allowed: constant types or LSExpression. |
T1 | type of the operand to add. Types allowed: constant types or LSExpression. |
T2 | type of the operand to add. Types allowed: constant types or LSExpression. |
op | Type of expression to create. |
expr0 | Operand 0. |
expr1 | Operand 1. |
expr2 | Operand 2. |
|
inline |
Creates a boolean decision.
Binary decision with domain [0, 1].
LSOperator.Bool <since>5.5</since>
|
inline |
Creates a float decision.
Decision variable with domain [min, max].
LSOperator.Float <since>5.5</since>
|
inline |
Creates an integer decision.
Decision variable with domain [min, max].
LSOperator.Int <since>5.5</since>
|
inline |
Creates a sum expression.
LSOperator.Sum <since>5.5</since>
|
inline |
Creates a sum expression.
LSOperator.Sum <since>5.5</since>
|
inline |
Creates a sum expression.
LSOperator.Sum <since>5.5</since>
|
inline |
Creates a sum expression.
LSOperator.Sum <since>5.5</since>
|
inline |
Creates a sum expression.
LSOperator.Sum <since>5.5</since>
|
inline |
Creates a sum expression.
LSOperator.Sum <since>5.5</since>
|
inline |
Creates a sum expression.
LSOperator.Sum <since>5.5</since>
|
inline |
Creates a sum expression.
LSOperator.Sum <since>5.5</since>
|
inline |
Creates a sum expression.
LSOperator.Sum <since>5.5</since>
|
inline |
Creates a sum expression.
LSOperator.Sum <since>5.5</since>
|
inline |
Creates a substraction expression.
LSOperator.Sub <since>5.5</since>
|
inline |
Creates a substraction expression.
LSOperator.Sub <since>5.5</since>
|
inline |
Creates a substraction expression.
LSOperator.Sub <since>5.5</since>
|
inline |
Creates a substraction expression.
LSOperator.Sub <since>5.5</since>
|
inline |
Creates a substraction expression.
LSOperator.Sub <since>5.5</since>
|
inline |
Creates a product expression.
LSOperator.Prod <since>5.5</since>
|
inline |
Creates a product expression.
LSOperator.Prod <since>5.5</since>
|
inline |
Creates a product expression.
LSOperator.Prod <since>5.5</since>
|
inline |
Creates a product expression.
LSOperator.Prod <since>5.5</since>
|
inline |
Creates a product expression.
LSOperator.Prod <since>5.5</since>
|
inline |
Creates a product expression.
LSOperator.Prod <since>5.5</since>
|
inline |
Creates a product expression.
LSOperator.Prod <since>5.5</since>
|
inline |
Creates a product expression.
LSOperator.Prod <since>5.5</since>
|
inline |
Creates a product expression.
LSOperator.Prod <since>5.5</since>
|
inline |
Creates a product expression.
LSOperator.Prod <since>5.5</since>
|
inline |
Creates a maximum expression.
LSOperator.Max <since>5.5</since>
|
inline |
Creates a maximum expression.
LSOperator.Max <since>5.5</since>
|
inline |
Creates a maximum expression.
LSOperator.Max <since>5.5</since>
|
inline |
Creates a maximum expression.
LSOperator.Max <since>5.5</since>
|
inline |
Creates a maximum expression.
LSOperator.Max <since>5.5</since>
|
inline |
Creates a maximum expression.
LSOperator.Max <since>5.5</since>
|
inline |
Creates a maximum expression.
LSOperator.Max <since>5.5</since>
|
inline |
Creates a maximum expression.
LSOperator.Max <since>5.5</since>
|
inline |
Creates a maximum expression.
LSOperator.Max <since>5.5</since>
|
inline |
Creates a maximum expression.
LSOperator.Max <since>5.5</since>
|
inline |
Creates a minimum expression.
LSOperator.Min <since>5.5</since>
|
inline |
Creates a minimum expression.
LSOperator.Min <since>5.5</since>
|
inline |
Creates a minimum expression.
LSOperator.Min <since>5.5</since>
|
inline |
Creates a minimum expression.
LSOperator.Min <since>5.5</since>
|
inline |
Creates a minimum expression.
LSOperator.Min <since>5.5</since>
|
inline |
Creates a minimum expression.
LSOperator.Min <since>5.5</since>
|
inline |
Creates a minimum expression.
LSOperator.Min <since>5.5</since>
|
inline |
Creates a minimum expression.
LSOperator.Min <since>5.5</since>
|
inline |
Creates a minimum expression.
LSOperator.Min <since>5.5</since>
|
inline |
Creates a minimum expression.
LSOperator.Min <since>5.5</since>
|
inline |
Creates an equality expression.
LSOperator.Eq <since>5.5</since>
|
inline |
Creates an equality expression.
LSOperator.Eq <since>5.5</since>
|
inline |
Creates an equality expression.
LSOperator.Eq <since>5.5</since>
|
inline |
Creates an equality expression.
LSOperator.Eq <since>5.5</since>
|
inline |
Creates an equality expression.
LSOperator.Eq <since>5.5</since>
|
inline |
Creates a disequality expression.
LSOperator.Neq <since>5.5</since>
|
inline |
Creates a disequality expression.
LSOperator.Neq <since>5.5</since>
|
inline |
Creates a disequality expression.
LSOperator.Neq <since>5.5</since>
|
inline |
Creates a disequality expression.
LSOperator.Neq <since>5.5</since>
|
inline |
Creates a disequality expression.
LSOperator.Neq <since>5.5</since>
|
inline |
Creates an inequality expression greater than or equal to.
LSOperator.Geq <since>5.5</since>
|
inline |
Creates an inequality expression greater than or equal to.
LSOperator.Geq <since>5.5</since>
|
inline |
Creates an inequality expression greater than or equal to.
LSOperator.Geq <since>5.5</since>
|
inline |
Creates an inequality expression greater than or equal to.
LSOperator.Geq <since>5.5</since>
|
inline |
Creates an inequality expression greater than or equal to.
LSOperator.Geq <since>5.5</since>
|
inline |
Creates an inequality expression less than or equal to.
LSOperator.Leq <since>5.5</since>
|
inline |
Creates an inequality expression less than or equal to.
LSOperator.Leq <since>5.5</since>
|
inline |
Creates an inequality expression less than or equal to.
LSOperator.Leq <since>5.5</since>
|
inline |
Creates an inequality expression less than or equal to.
LSOperator.Leq <since>5.5</since>
|
inline |
Creates an inequality expression less than or equal to.
LSOperator.Leq <since>5.5</since>
|
inline |
Creates an inequality expression greater than.
LSOperator.Gt <since>5.5</since>
|
inline |
Creates an inequality expression greater than.
LSOperator.Gt <since>5.5</since>
|
inline |
Creates an inequality expression greater than.
LSOperator.Gt <since>5.5</since>
|
inline |
Creates an inequality expression greater than.
LSOperator.Gt <since>5.5</since>
|
inline |
Creates an inequality expression greater than.
LSOperator.Gt <since>5.5</since>
|
inline |
Creates an inequality expression less than.
LSOperator.Lt <since>5.5</since>
|
inline |
Creates an inequality expression less than.
LSOperator.Lt <since>5.5</since>
|
inline |
Creates an inequality expression less than.
LSOperator.Lt <since>5.5</since>
|
inline |
Creates an inequality expression less than.
LSOperator.Lt <since>5.5</since>
|
inline |
Creates an inequality expression less than.
LSOperator.Lt <since>5.5</since>
|
inline |
Creates a ternary conditionnal expression.
LSOperator.If <since>5.5</since>
|
inline |
Creates a ternary conditionnal expression.
LSOperator.If <since>5.5</since>
|
inline |
Creates a ternary conditionnal expression.
LSOperator.If <since>5.5</since>
|
inline |
Creates a ternary conditionnal expression.
LSOperator.If <since>5.5</since>
|
inline |
Creates a ternary conditionnal expression.
LSOperator.If <since>5.5</since>
|
inline |
Creates a ternary conditionnal expression.
LSOperator.If <since>5.5</since>
|
inline |
Creates a ternary conditionnal expression.
LSOperator.If <since>5.5</since>
|
inline |
Creates a NOT expression.
LSOperator.Not <since>5.5</since>
|
inline |
Creates an AND expression.
LSOperator.And <since>5.5</since>
|
inline |
Creates an AND expression.
LSOperator.And <since>5.5</since>
|
inline |
Creates an AND expression.
LSOperator.And <since>5.5</since>
|
inline |
Creates an AND expression.
LSOperator.And <since>5.5</since>
|
inline |
Creates a OR expression.
LSOperator.Or <since>5.5</since>
|
inline |
Creates a OR expression.
LSOperator.Or <since>5.5</since>
|
inline |
Creates a OR expression.
LSOperator.Or <since>5.5</since>
|
inline |
Creates a OR expression.
LSOperator.Or <since>5.5</since>
|
inline |
Creates a XOR expression.
LSOperator.Xor <since>5.5</since>
|
inline |
Creates a XOR expression.
LSOperator.Xor <since>5.5</since>
|
inline |
Creates a XOR expression.
LSOperator.Xor <since>5.5</since>
|
inline |
Creates a XOR expression.
LSOperator.Xor <since>5.5</since>
|
inline |
Creates an absolute value expression.
LSOperator.Abs <since>5.5</since>
|
inline |
Creates a distance expression.
LSOperator.Dist <since>5.5</since>
|
inline |
Creates a distance expression.
LSOperator.Dist <since>5.5</since>
|
inline |
Creates a distance expression.
LSOperator.Dist <since>5.5</since>
|
inline |
Creates a distance expression.
LSOperator.Dist <since>5.5</since>
|
inline |
Creates a distance expression.
LSOperator.Dist <since>5.5</since>
|
inline |
Creates a division expression.
LSOperator.Div <since>5.5</since>
|
inline |
Creates a division expression.
LSOperator.Div <since>5.5</since>
|
inline |
Creates a division expression.
LSOperator.Div <since>5.5</since>
|
inline |
Creates a division expression.
LSOperator.Div <since>5.5</since>
|
inline |
Creates a division expression.
LSOperator.Div <since>5.5</since>
|
inline |
Creates a modulo expression.
LSOperator.Mod <since>5.5</since>
|
inline |
Creates a modulo expression.
LSOperator.Mod <since>5.5</since>
|
inline |
Creates a modulo expression.
LSOperator.Mod <since>5.5</since>
|
inline |
Creates an array expression.
LSOperator.Array <since>5.5</since>
|
inline |
Creates an array expression.
LSOperator.Array <since>5.5</since>
|
inline |
Creates an array expression.
LSOperator.Array <since>5.5</since>
|
inline |
Creates an array expression.
LSOperator.Array <since>5.5</since>
|
inline |
Creates an array expression.
LSOperator.Array <since>5.5</since>
|
inline |
Creates an array expression.
LSOperator.Array <since>5.5</since>
|
inline |
Creates an array expression.
LSOperator.Array <since>5.5</since>
|
inline |
Creates a "at" expression.
LSOperator.At <since>5.5</since>
|
inline |
Creates a "at" expression.
Since version 5.5
|
inline |
Creates a scalar product expression between 2 arrays.
LSOperator.Scalar <since>5.5</since>
|
inline |
Creates a ceil expression.
LSOperator.Ceil <since>5.5</since>
|
inline |
Creates a floor expression.
LSOperator.Floor <since>5.5</since>
|
inline |
Creates a round expression.
LSOperator.Round <since>5.5</since>
|
inline |
Creates a square root expression.
LSOperator.Sqrt <since>5.5</since>
|
inline |
Creates a natural logarithm expression.
LSOperator.Log <since>5.5</since>
|
inline |
Creates an exponential expression.
LSOperator.Exp <since>5.5</since>
|
inline |
Creates a power expression.
LSOperator.Pow <since>5.5</since>
|
inline |
Creates a power expression.
LSOperator.Pow <since>5.5</since>
|
inline |
Creates a power expression.
LSOperator.Pow <since>5.5</since>
|
inline |
Creates a power expression.
LSOperator.Pow <since>5.5</since>
|
inline |
Creates a power expression.
LSOperator.Pow <since>5.5</since>
|
inline |
Creates a cosine expression.
LSOperator.Cos <since>5.5</since>
|
inline |
Creates a sine expression.
LSOperator.Sin <since>5.5</since>
|
inline |
Creates a tangent expression.
LSOperator.Tan <since>5.5</since>
|
inline |
Creates a piecewise linear expression.
LSOperator.Piecewise <since>5.5</since>
|
inline |
Creates a list variable.
LSOperator.List <since>5.5</since>
|
inline |
Creates a count expression.
LSOperator.Count <since>5.5</since>
|
inline |
Creates an indexOf expression.
LSOperator.IndexOf <since>5.5</since>
|
inline |
Creates an indexOf expression.
LSOperator.IndexOf <since>5.5</since>
|
inline |
Creates a partition expression.
LSOperator.Partition <since>5.5</since>
|
inline |
Creates a partition expression.
Since version 5.5
|
inline |
Creates a disjoint expression.
LSOperator.Disjoint <since>5.5</since>
|
inline |
Creates a disjoint expression.
Since version 5.5
|
inline |
Gets the number of expressions added to this model.
|
inline |
Gets the expression with the given index in this model.
exprIndex | Index of the expression. |
|
inline |
Gets the expression with the given name.
Throws an exception if no expression with the given name exists.
name | Name. |
|
inline |
Gets the number of decisions in the model.
This corresponds to the number of decision variables declared in the model.
|
inline |
Gets the decision with the given index.
decisionIndex | Index of the decision. |
|
inline |
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 solver. Hence, only boolean expressions (that is, expressions whose value is boolean) can be constrained. Only allowed in state LSState.Modeling. If the expression is already a constraint, this method does nothing and returns immediately. Try to avoid hard constraints as much as possible, because LocalSolver (and more generally local search) is not suited for solving hardly constrained problems. In particular, banish constraints that are not surely satisfied in practice. Ideally, only combinatorial constraints (which induce the combinatorial structure of your problem) have to be set. All the other constraints can be relaxed as primary objectives in order to be "softly" satisfied (goal programming). For instance, constraint a <= b can be transformed into minimize max(b-a, 0).
expr | Expression. |
|
inline |
Shortcut for addConstraint(expr).
expr | Expression. |
LSModel.AddConstraint Since version 5.5
|
inline |
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 state LSState.Modeling.
expr | Expression. |
Since version 5.0
|
inline |
Removes the constraint at the given position in the list of constraints.
Only allowed in state LSState.Modeling.
constraintIndex | position of the constraint to remove. |
Since version 5.0
|
inline |
Gets the number of constraints added to this model.
|
inline |
Gets the constraint with the given index.
constraintIndex | Index of the constraint. |
|
inline |
Adds the given expression to the list of objectives to optimize.
A same expression can be added more than once. Only allowed in state LSState.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.
expr | Expression. |
direction | Optimization direction of this objective. |
|
inline |
Shortcut for addObjective(expr, OD_Minimize).
expr | Expression. |
LSModel.AddObjective Since version 5.5
|
inline |
Shortcut for addObjective(expr, OD_Maximize).
expr | Expression. |
LSModel.AddObjective Since version 5.5
|
inline |
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 (with LSPhase#SetOptimizedObjective), or to disable it (with LSPhase#SetEnabled). Only allowed in state LSState.Modeling.
objectiveIndex | position of the objective to remove. |
Since version 5.0
|
inline |
Gets the number of objectives added to this model.
|
inline |
Gets the objective with the given index.
objectiveIndex | Index of the objective. |
|
inline |
Gets the direction of the objective with the given index.
objectiveIndex | Index of the objective. |
|
inline |
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.
|
inline |
Closes the model.
Only allowed in state LSState.Modeling. Once the model is closed, no expression, constraints or objectives can be added. The model must be closed before starting its resolution.
|
inline |
Opens or reopens the model.
When this method is called, the solver is placed in state LSState.Modeling. Only allowed in state LSState.Stopped.
|
inline |
Returns true if the model is closed, false otherwise.
|
inline |
Returns a string representation of this model.
This representation provides: