Example #1
0
from pyomo.core import DataPortal
from pyomo.opt import SolverFactory
from DiseaseEstimation import model

# create the instance from multiple data files
data = DataPortal(model=model)
data.load(filename='DiseaseEstimation.dat')
data.load(filename='DiseasePop.dat')
instance = model.create_instance(data)

# create the solver and solve
with SolverFactory("ipopt") as solver:
    solver.solve(instance, tee=True)

# report results
instance.pprint()
Example #2
0
from pyomo.opt import SolverFactory
from DiseaseEstimation import model

# create the instance
instance = model.create_instance('DiseaseEstimation.dat')

# create the solver and solve
with SolverFactory("ipopt") as solver:
    solver.solve(instance)

# report results
instance.pprint()
Example #3
0
from pyomo.core import DataPortal
from pyomo.opt import SolverFactory
from DiseaseEstimation import model

# create the instance from multiple data files
data = DataPortal(model=model)
data.load(filename='DiseaseEstimation.dat')
data.load(filename='DiseasePop.dat')
instance = model.create_instance(data)

# create the solver and solve
with SolverFactory("ipopt") as solver:
    solver.solve(instance, tee=True)

# report results
instance.pprint()