Optimization, Operations Research, Data Science, Hands On Tutorials, Python.
constraint def availability_rule_cstr(model, i): return sum(model.f[i, j] * model.x[j] for j in model.J) <= model.b[i] model.cstr_available = pyo.Constraint(model.I, rule=availability_rule_cstr) Observe that the constraint was instantiated passing the rule keyword argument. The rule must be a