pyepo.model.omo
Optimization Model based on Pyomo
Submodules
Classes
This is an abstract class for Pyomo-based optimization model |
|
This class is optimization model for shortest path problem |
|
This class is optimization model for knapsack problem |
|
This class is relaxed optimization model for knapsack problem. |
Package Contents
- class pyepo.model.omo.optOmoModel(solver='glpk')
Bases:
pyepo.model.opt.optModel
This is an abstract class for Pyomo-based optimization model
- _model
Pyomo model
- Type:
PyOmo model
- solver
optimization solver in the background
- Type:
str
- solver = 'glpk'
- __repr__()
- setObj(c)
A method to set objective function
- Parameters:
c (np.ndarray / list) – cost of objective function
- solve()
A method to solve model
- Returns:
optimal solution (list) and objective value (float)
- Return type:
tuple
- class pyepo.model.omo.shortestPathModel(grid, solver='glpk')
Bases:
pyepo.model.omo.omomodel.optOmoModel
This class is optimization model for shortest path problem
- _model
Pyomo model
- Type:
PyOmo model
- solver
optimization solver in the background
- Type:
str
- grid
size of grid network
- Type:
tuple of int
- arcs
list of arcs
- Type:
list
- grid
- arcs = []
- _getArcs()
A method to get list of arcs for grid network
- Returns:
arcs
- Return type:
list
- _getModel()
A method to build pyomo model
- class pyepo.model.omo.knapsackModel(weights, capacity, solver='glpk')
Bases:
pyepo.model.omo.omomodel.optOmoModel
This class is optimization model for knapsack problem
- _model
Pyomo model
- Type:
PyOmo model
- solver
optimization solver in the background
- Type:
str
- weights
weights of items
- Type:
np.ndarray
- capacity
total capacity
- Type:
np.ndarray
- items
list of item index
- Type:
list
- weights
- capacity
- items
- _getModel()
A method to build pyomo model
- relax()
A method to get linear relaxation model
- class pyepo.model.omo.knapsackModelRel(weights, capacity, solver='glpk')
Bases:
knapsackModel
This class is relaxed optimization model for knapsack problem.
- _getModel()
A method to build pyomo
- relax()
A forbidden method to relax MIP model