E-TE0506 — Category label used in a constraint
Error Type |
|
|---|---|
Phase |
building constraints |
Python exception |
|
Message
The category label `{name}` cannot be used in a constraint
Cause
A comparison over category labels was used directly as a constraint. Constraints must relate numeric expressions, and a category-label comparison does not yield a numeric relation.
In typical Python usage this situation is reported earlier as E-TE0004, because a category-label comparison has type bool rather than a constraint comparison; if you encounter this error, please report it as a bug together with the model that produced it.
Fix
Use category-label comparisons only where boolean conditions are allowed (e.g. as a filter/guard on indices), and express the constraint itself in terms of numeric expressions.