E-CE0302 — Conflicting constraint definition

Error Type

Compile Error

Phase

compiling the problem into an OMMX instance

Python exception

jijmodeling.ModelingError

Message

Constraint `{name}` already has a conflicting definition for subscript {subscript}.

  existing: {existing}
  new: {new}

Cause

The same constraint name and subscript was registered twice with different definitions. Some user-written conflicts are caught earlier, at model construction, as E-MD0005, but this error is still reachable through normal use: for example, by evaluating two different constraints that share a name via Compiler.eval_constraints, or by adding two forall (family) constraints with the same name whose subscript values overlap but whose definitions differ — subscript overlap is only checked at compilation, so this surfaces from Compiler.eval_problem as well.

Fix

Give each constraint a unique name, or make the definitions for overlapping subscripts identical. If you believe none of your constraints share a name with conflicting definitions, this may be a bug in JijModeling — please report it at the JijModeling community on Discord together with the full error output and, if possible, the model that produced it.