E-IG0002 — Empty value-range hint
Error Type |
|
|---|---|
Phase |
generating random instance data |
Python exception |
|
Message
Cannot generate a random scalar of type `{dtype}`: the value range hint `{range}` contains no value of that type
Cause
The value-range hint supplied to the random generator contains no value that the placeholder’s type can take. For Float and Integer placeholders this happens when the range collapses through exclusive bounds (for example jm.generation.value.open(1.0, 1.0)). For Natural and Binary placeholders it also happens when the range contains no non-negative integer, such as jm.generation.value.closed(-3.0, -1.0) or jm.generation.value.open(0.25, 0.75).
Fix
Widen the value entry for the placeholder in the options argument of Problem.generate_random_dataset (or Problem.generate_random_instance) so that it contains at least one admissible value; for Natural and Binary placeholders the range must include a non-negative integer:
problem.generate_random_dataset(
options={"n": {"value": jm.generation.value.closed(0, 10)}},
)