--
You received this message because you are subscribed to the Google Groups "Pyomo Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyomo-forum...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyomo-forum/a24eac0e-5fdb-4f88-9f56-dd265b6b6d05%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
import pyomo.environ as pyo
create model and variablesm.c = pyo.Constraint(pyo.Any)
m.c[name1] = m.x + m.y == 1m.c[name2] = …
I hope this helps.
Michael
On Jun 14, 2019, at 2:29 AM, Suhas Pai <suhasp...@gmail.com> wrote:
Hey guys,I'm using a constraint list for a concrete model, cause the number of constraints I have is around 50k, and so it's much easier using a constraint list and adding expressions. Is there any way I can add names to this constraints as well. As of now the Pyomo Documentation has the doc argument only for constraints of the form : Model.c=Constraint(expr=whatever,doc='Name of constraint')However, I want to add names to constraints like this:Model.l=ConstraintList()Model.l.add(Model.x+ Model.y >=2,name='Name of constraint')Is there any way this can be done?
Thanks in advanceSuhas--
You received this message because you are subscribed to the Google Groups "Pyomo Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyomo...@googlegroups.com.
If you want constraint names to show up in the Gams file you need to add “symbolic_solver_labels=True” to your call to the solver:
solver.solve(model, symbolic_solver_labels=True)
To unsubscribe from this group and stop receiving emails from it, send an email to
pyomo-forum...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/pyomo-forum/7063e1d5-10f6-4d09-84da-0bacbcadf618%40googlegroups.com.