Optimization, Operations Research, Data Science, Hands On Tutorials, Python.
callable that receives the model as the first argument followed by indices of its corresponding domain. We are almost done! Let us define the objective function. # Objective function def obj_func(model): return sum(model.x[j] * model.c[j] for j in model.J) model.obj = pyo.Objective(rule=obj_func,