DecisionProgramming.JuMP module

Interface for Jump functionality necessary for optimizing models generated from diagrams.

class DecisionProgramming.JuMP.Array(model, dims, binary=False)[source]

Bases: DecisionProgramming.juliaUtils.JuliaName

An array of JuMP variables. Makes it easier to define contraints using the @constraint syntax.

Parameters
model: dp.Model

A JuMP Model object

dims: List of Integers

A list corresponding to the size of the array in each of its dimensions.

binary: Boolean (optional, default False)

Wether the variables are boolean.

class DecisionProgramming.JuMP.Expression(model, *args)[source]

Bases: DecisionProgramming.juliaUtils.JuliaName

Builds a JuMP expression from a string or set of strings.

model: dp.Model

A JuMP Model object

loop: String (optional)

Set of loop variables in the JuMP constraint format (see the contingent portfolio analysis page in examples)

constraint: String
The contraints in the JuMP format (see the contingent portfolio

analysis page in examples)

class DecisionProgramming.JuMP.Model[source]

Bases: DecisionProgramming.juliaUtils.JuliaName

Wraps a JuMP optimizer model and decision model variables.

constraint(*args)[source]

Set a model constraints

loop: String (optional)

Set of loop variables in the JuMP constraint format (see the contingent portfolio analysis page in examples)

constraint: String
The contraints in the JuMP format (see the contingent portfolio

analysis page in examples)

objective(objective, operator='Max')[source]

Set the objective for the optimizer

Parameters
op: “Min” or “Max”

Whether to minimize or maximize the objective

expected_value: ExpectedValue

An ExpectedValue object. Describes the objective function.

optimize()[source]

Run the current optimizer

setup_Gurobi_optimizer(*constraints)[source]

Set Gurobi as the optimizer for this model.

Parameters
constraints – Tuple

Formatted as (constraint_name, constraint_value)