New to pyomo so apologies if this is simple.
Have a variable x that represents day of the year. It cannot take on Sundays, in this case stored in a list [7, 14, …].
I initially tried setting the domain according to a rule:
model.x = pyo.Var(model.months, model.cycles, domain=x_domain)
The domain looks exactly as I would expect when I inspect it, but the solver is still finding solutions that violate the domain.
January Domain
Key | Lower | Value | Upper | Fixed | Stale | Domain
(1, 6) : 1 : 7.0 : 31 : False : False : jan
So the variable finds 7 as a value when that is explicitly not in the domain.
What’s best practice on how to block values from a variable? I expected the above to work but could try using a dummy variable and constraints.
Ariel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.