pyepo.model.opt
Abstract optimization model
Classes
This is an abstract class for optimization model |
Module Contents
- class pyepo.model.opt.optModel
Bases:
abc.ABC
This is an abstract class for optimization model
- _model
Gurobi model
- Type:
GurobiPy model
- __repr__()
- property num_cost
number of cost to be predicted
- 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
- 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:
- relax()
A unimplemented method to relax MIP model