This page is for an old version of Hexaly Optimizer. We recommend that you update your version and read the documentation for the latest stable release.

LSBBExpression Class

class localsolver.LSBBExpression

Mathematical modeling expression. Expressions are used to build the mathematical optimization model associated to LocalSolverBlackBox. An expression is composed of an operator (which corresponds to its type) and its operands (which are other expressions of the model).

Summary

Methods
GetModel Returns the model object associated to this expression.
GetLocalSolverBlackBox Returns the LocalSolverBlackBox object associated to this expression.
IsDouble Returns true if this expression is a double, false otherwise.
IsInt Returns true if this expression is an integer, false otherwise.
IsBool Returns true if this expression is a boolean (ie 0 or 1), false otherwise.
AddOperand Add the given operand to this expression.

Instance methods

LSBBModel GetModel()

Returns the model object associated to this expression.

Returns:LSBBModel object.
Return type:LSBBModel
LocalSolverBlackBox GetLocalSolverBlackBox()

Returns the LocalSolverBlackBox object associated to this expression.

Returns:LocalSolverBlackBox object
Return type:LocalSolverBlackBox
bool IsDouble()

Returns true if this expression is a double, false otherwise. Only allowed in states LSBBState.Paused or LSBBState.Stopped.

Returns:True if the expression is a double.
Return type:bool
bool IsInt()

Returns true if this expression is an integer, false otherwise. Only allowed in states LSBBState.Paused or LSBBState.Stopped. Note that a boolean is also an integer.

Returns:True if the expression is an integer.
Return type:bool
bool IsBool()

Returns true if this expression is a boolean (ie 0 or 1), false otherwise. Only allowed in states LSBBState.Paused or LSBBState.Stopped.

Returns:True if the expression is a boolean.
Return type:bool
void AddOperand(LSExpression operand)

Add the given operand to this expression. The operand can be an LSBBExpression, a boolean, an integer or a double. Only allowed in state LSBBState.Modeling.

Arguments:operand (LSExpression) – Operand to add. Can be an LSBBExpression, a boolean, an integer or a double.