from pyomo.opt import SolverFactory from DiseaseEstimation import model model.pprint() instance = model.create('DiseaseEstimation.dat') instance.pprint() opt = SolverFactory("ipopt") results = opt.solve(instance) results.write()
from pyomo.core import DataPortal from pyomo.opt import SolverFactory from DiseaseEstimation import model model.pprint() # @modeldata: modeldata = DataPortal(model=model) modeldata.load(filename='DiseaseEstimation.dat') modeldata.load(filename='DiseasePop.dat') # @:modeldata instance = model.create(modeldata) instance.pprint() opt = SolverFactory("ipopt") results = opt.solve(instance) results.write()
from pyomo.environ import SolverFactory, DataPortal from DiseaseEstimation import model model.pprint() data = DataPortal(model=model) data.load(filename='DiseaseEstimation.dat') data.load(filename='DiseasePop.dat') instance = model.create(data) instance.pprint() solver = SolverFactory("ipopt") results = solver.solve(instance) instance.display()