-
Notifications
You must be signed in to change notification settings - Fork 168
Closed
Labels
language/pythonIs related specifically to Python code.Is related specifically to Python code.
Description
Describe the bug
An error is encountered when attempting to annotate a ValueRangeProvider as a CountableValueRange
Expected behavior
No error is encountered
Actual behavior
java.lang.java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: The entityClass (class <domainobject>) has a @PlanningVariable annotated property (<property>) that refers to a @ValueRangeProvider annotated member (method $method$get_range on class <domainobject>) that does not return a Collection, an array or a ValueRange
To Reproduce
Attach the following to a planning entity and attempt to run the solver
val: Annotated[int, PlanningVariable(value_range_provider_refs=['val'])] = 0
def get_range(self) -> Annotated[CountableValueRange, ValueRangeProvider(id='val')]:
return ValueRangeFactory.create_int_value_range(0, 10)Environment
Timefold Solver Version or Git ref:
1.17.0
Output of java -version:
openjdk version "23" 2024-09-17
OpenJDK Runtime Environment (build 23)
OpenJDK 64-Bit Server VM (build 23, mixed mode, sharing)
Output of uname -a or ver:
Linux 6.6.63-1-MANJARO #1 SMP PREEMPT_DYNAMIC Sat Nov 23 02:15:34 UTC 2024 x86_64 GNU/Linux
Metadata
Metadata
Assignees
Labels
language/pythonIs related specifically to Python code.Is related specifically to Python code.