E-CE0303 — Inconsistent constraint subscript count
Error Type |
|
|---|---|
Phase |
compiling the problem into an OMMX instance |
Python exception |
|
Message
Constraint `{name}` received an inconsistent number of subscripts: expected {expected}, got {...} ({subscript})
Cause
The same constraint name was registered with subscript lists of different lengths. Constraints added to a Problem are validated at model construction, where user-written inconsistencies surface as E-MD0005 or E-MD0006. This error can still be reached without a bug when constraints sharing a name but using a different number of forall subscripts are evaluated on the same Compiler — for example via Compiler.eval_constraints, or via Compiler.eval_problem after an earlier eval_constraints call registered a conflicting constraint under the same name.
Fix
Use the same number of subscripts for every constraint registered under one name, or give the constraints distinct names. If this error occurs even though every constraint sharing the name uses the same number of subscripts, it may be a bug in JijModeling — please report it at the JijModeling community on Discord together with the full error output.