pyepo.model.opt

Abstract optimization model

Module Contents

Classes

optModel

This is an abstract class for optimization model

class pyepo.model.opt.optModel

Bases: abc.ABC

This is an abstract class for optimization model

_model

Gurobi model

Type:

GurobiPy model

property num_cost

number of cost to be predicted

__repr__()

Return repr(self).

abstract _getModel()

An abstract method to build a model from a optimization solver

Returns:

optimization model and variables

Return type:

tuple

abstract setObj(c)

An abstract method to set objective function

Parameters:

c (ndarray) – cost of objective function

abstract solve()

An abstract method to solve model

Returns:

optimal solution (list) and objective value (float)

Return type:

tuple

copy()

An abstract method to copy model

Returns:

new copied model

Return type:

optModel

abstract addConstr(coefs, rhs)

An abstract method to add new constraint

Parameters:
  • coefs (ndarray) – coeffcients of new constraint

  • rhs (float) – right-hand side of new constraint

Returns:

new model with the added constraint

Return type:

optModel

relax()

A unimplemented method to relax MIP model