The linear optimization service, used to model and solve linear and mixed-integer linear programs.
Classes
Name | Brief description |
---|---|
LinearOptimizationConstraint | Object storing a linear constraint of the form lowerBound ≤ Sum(a(i) x(i)) ≤ upperBound
where lowerBound and upperBound are constants, a(i) are constant
coefficients and x(i) are variables (unknowns). |
LinearOptimizationEngine | The engine used to model and solve a linear program. |
LinearOptimizationService | The linear optimization service, used to model and solve linear and mixed-integer linear programs. |
LinearOptimizationSolution | The solution of a linear program. |
Status | Status of the solution. |
VariableType | Type of variables created by the engine. |
LinearOptimizationConstraint
Methods
Method | Return type | Brief description |
---|---|---|
setCoefficient(variableName, coefficient) | LinearOptimizationConstraint | Sets the coefficient of a variable in the constraint. |
LinearOptimizationEngine
Methods
LinearOptimizationService
Properties
Property | Type | Description |
---|---|---|
Status | Status | Status of the solver. |
VariableType | VariableType | Type of variables created by the solver. |
Methods
Method | Return type | Brief description |
---|---|---|
createEngine() | LinearOptimizationEngine | Creates an engine to to solve linear programs (potentially mixed-integer programs). |
LinearOptimizationSolution
Methods
Method | Return type | Brief description |
---|---|---|
getObjectiveValue() | Number | Gets the value of the objective function in the current solution. |
getStatus() | Status | Gets the status of the solution. |
getVariableValue(variableName) | Number | Gets the value of a variable in the solution created by the last call to LinearOptimizationEngine.solve() . |
isValid() | Boolean | Determines whether the solution is either feasible or optimal. |
Status
Properties
Property | Type | Description |
---|---|---|
OPTIMAL | Enum | Status when an optimal solution has been found. |
FEASIBLE | Enum | Status when a feasible (not necessarily optimal) solution has been found. |
INFEASIBLE | Enum | Status when the current model is unfeasible (has no solution). |
UNBOUNDED | Enum | Status when the current model is unbound. |
ABNORMAL | Enum | Status when it failed to find a solution for unexpected reasons. |
MODEL_INVALID | Enum | Status when the model is invalid. |
NOT_SOLVED | Enum | Status when LinearOptimizationEngine.solve() has not been called yet. |
VariableType
Properties
Property | Type | Description |
---|---|---|
INTEGER | Enum | Type of variable that can only take integer values. |
CONTINUOUS | Enum | Type of variable that can take any real value. |