E-MD0100 — Undefined name in expression
Error Type |
|
|---|---|
Phase |
building the model (may also surface while compiling to an OMMX instance) |
Python exception |
|
Message
No placeholder, named expression, decision variable, or category label named `{name}` is defined.
Currently defined names:
- decision variables: [{...}]
- placeholders: [{...}]
- named expressions: [{...}]
- category labels: [{...}]
Cause
An expression added to the problem refers to a placeholder, decision variable, named expression, or category label that is not declared in that problem’s namespace.
Since expressions are built from the objects returned by Problem factory methods, the usual trigger is mixing problems: using an object created on one Problem (e.g. x = p1.BinaryVar("x")) in an expression added to another (p2 += x).
Fix
Declare the entity on the same Problem that the expression is added to, or add the expression to the problem that declares it; the message lists all names that are currently in scope, grouped by kind.