E-MD0005 — Conflicting constraint definition
Error Type |
|
|---|---|
Phase |
building the model (adding a constraint) |
Python exception |
|
Message
Constraint `{name}` has a conflicting definition.
existing: {existing}
defined at: {existing_loc}
new: {new}
defined at: {new_loc}
Possible fix: use a unique name or make the definitions identical.
Cause
A plain (non-subscripted) constraint with the same name was added to the problem twice with different definitions, or a plain constraint and a subscripted constraint family were added under the same name. Re-adding an identical plain definition is tolerated. Subscripted families may be added several times under one name as long as their subscript arity matches (see E-MD0006); overlapping subscript values are checked later, at compile time.
Fix
Give the second constraint a different name, or remove the duplicate addition; the message shows both definitions and where each was defined.