E-IG0103 — Size range with inverted bounds

Error Type

Instance Generation Error

Phase

configuring random instance generation (the default= / options= arguments of Problem.generate_random_dataset / Problem.generate_random_instance)

Python exception

ValueError (builtin)

Message

The size range `{range}` has a lower bound greater than its upper bound.

Possible fix: adjust the bounds so that the lower bound does not exceed the upper bound.

({range} shows the range in mathematical interval notation, e.g. [7, 5))

Cause

The size entry of a random-generation hint was recognized, but its lower bound is greater than its upper bound, so the range could never contain any size — for example (7, 5) or jm.generation.size.closed(7, 5). Because sizes are integers, an exclusive bound counts as the nearest integer inside the interval; an all-exclusive range with equal endpoints such as jm.generation.size.open(3, 3) is therefore also rejected here. Ranges that are empty but not inverted, such as (5, 5) (the interval [5, 5)), are accepted at this point; if such a range is actually used, generation later fails with E-IG0003.

Fix

Swap or widen the bounds so that the lower bound does not exceed the upper bound:

problem.generate_random_dataset(
    options={"a": {"size": (5, 8)}},  # not (8, 5)
)