Gurobi

final class Gurobi extends MPSolver

Gurobi solver.

trait MPSolver
trait StrictLogging
class Object
trait Matchable
class Any

Type members

Types

type Solver = GRBModel

Value members

Concrete methods

def addConstraint(mpConstraint: MPConstraint): Unit

Add a mathematical programming constraint to the solver.

Add a mathematical programming constraint to the solver.

Value parameters:
mpConstraint

the mathematical programming constraint

def buildModel(numberOfVars: Int): Unit

Problem builder, should configure the solver and append mathematical model variables and constraints.

Problem builder, should configure the solver and append mathematical model variables and constraints.

Value parameters:
numberOfVars

number of variables in the model

def getVarValue(colId: Int): Double

Get value of the variable in the specified position. Solution should exist in order for a value to exist.

Get value of the variable in the specified position. Solution should exist in order for a value to exist.

Value parameters:
colId

position of the variable

Returns:

the value of the variable in the solution

def release(): Unit

Release memory associated to the problem.

Release memory associated to the problem.

def setBinary(colId: Int): Unit

Set the column / variable as an binary integer variable

Set the column / variable as an binary integer variable

Value parameters:
colId

position of the variable

def setBounds(colId: Int, lower: Double, upper: Double): Unit

Set bounds of variable in the specified position.

Set bounds of variable in the specified position.

Value parameters:
colId

position of the variable

lower

domain lower bound

upper

domain upper bound

def setFloat(colId: Int): Unit

Set the column/variable as a float variable

Set the column/variable as a float variable

Value parameters:
colId

position of the variable

def setInteger(colId: Int): Unit

Set the column/variable as an integer variable

Set the column/variable as an integer variable

Value parameters:
colId

position of the variable

def setObjective(objective: Expression, minimize: Boolean): Unit

Add objective expression to be optimized by the solver.

Add objective expression to be optimized by the solver.

Value parameters:
minimize

flag for minimization instead of maximization

objective

the expression to be optimized

def setTimeout(limit: Int): Unit

Set a time limit for solver optimization. After the limit is reached the solver stops running.

Set a time limit for solver optimization. After the limit is reached the solver stops running.

Value parameters:
limit

the time limit

def setUnboundLowerBound(colId: Int): Unit

Set lower bound to unbounded (infinite)

Set lower bound to unbounded (infinite)

Value parameters:
colId

position of the variable

def setUnboundUpperBound(colId: Int): Unit

Set upper bound to unbounded (infinite)

Set upper bound to unbounded (infinite)

Value parameters:
colId

position of the variable

def solve(preSolve: PreSolve): SolutionStatus

Solve the problem.

Solve the problem.

Returns:

status code indicating the nature of the solution

Inherited methods

def addAllConstraints(constraints: ArrayBuffer[MPConstraint]): Unit

Add all given mathematical programming constraints to the solver.

Add all given mathematical programming constraints to the solver.

Value parameters:
constraints

an array buffer containing the constraints

Inherited from:
MPSolver
Returns:

the number of constraints in the solver.

Inherited from:
MPSolver
Returns:

the number of variables in the solver.

Inherited from:
MPSolver
def objectiveValue: Option[Double]
Returns:

the objective value of the solution found by the solver

Note:

The objective value may be the best feasible solution if optimality is not attained or proven.

Inherited from:
MPSolver
def setDoubleUnbounded(colId: Int): Unit

Set bot upper and lower bounds to unbounded (infinite).

Set bot upper and lower bounds to unbounded (infinite).

Value parameters:
colId

position of the variable

Inherited from:
MPSolver
def solution: Array[Double]
Returns:

the solution found by the solver, for each variable

Note:

the solution may be the best feasible solution found so far if optimality is not attained or proven.

Inherited from:
MPSolver
def solutionStatus: SolutionStatus
Returns:

the status of the solution found by the solver

Inherited from:
MPSolver

Concrete fields

protected var underlyingSolver: Solver

Inherited fields

protected var _objectiveValue: Option[Double]
Inherited from:
MPSolver
protected var _solution: Array[Double]
Inherited from:
MPSolver
protected var _solutionStatus: SolutionStatus
Inherited from:
MPSolver
protected val logger: Logger
Inherited from:
StrictLogging
protected var numberOfCons: Int
Inherited from:
MPSolver
protected var numberOfVars: Int
Inherited from:
MPSolver