You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
CountableValueRange is not meant to be used as an annotation. Instead, a value range provider may return instances of this type as a means of providing values, if a collection is not used. (Which is what you're doing.)
Value ranges should only be annotated with ValueRangeProvider - and if there is only one value range, it doesn't need to be annotated at all.
Please remove the annotation and let us know if the issue persists.
I’m not using it as an annotation here - I’m using it as the return type. This matches how the docs say to specify the return type of a function using ValueRangeFactory. (Nb: Annotated[ValueRangeProvider] would mean that the return type of the function is ValueRangeProvider)
Describe the bug
An error is encountered when attempting to annotate a ValueRangeProvider as a CountableValueRange
Expected behavior
No error is encountered
Actual behavior
To Reproduce
Attach the following to a planning entity and attempt to run the solver
Environment
Timefold Solver Version or Git ref:
1.17.0
Output of
java -version
:Output of
uname -a
orver
:The text was updated successfully, but these errors were encountered: