How to define CH, if both basic and list variables are included in the model, there is an error as below: The entity (class com.app.planner.domain.Machine) has both basic and list variables and cannot be deduced automatically. Maybe customize the phase configuration and add separate construction heuristic phases for each variable.
-
1heyif: What version of Timefold are you working with? Mixed models are relatively new, so you'd need a version higher than 1.24. If the error persists, please add an issue on our GitHub so we can have a look: github.com/TimefoldAI/timefold-solver/issuesTom Cools– Tom Cools2025-09-19 07:23:22 +00:00Commented Sep 19 at 7:23
-
I used the version of 1.26heyif– heyif2025-09-22 01:14:20 +00:00Commented Sep 22 at 1:14
-
Try 1.26.1. 1.26.0 had some issues apparently. But even then, 1.26 shouldn't have this issue. If it persists, please add issue on GitHub, preferably with a reproducer.Tom Cools– Tom Cools2025-09-24 04:00:41 +00:00Commented Sep 24 at 4:00
Add a comment
|
1 Answer
It means OptaPlanner can’t guess how to build a solution when an entity has both a basic variable like boolean or int and a list variable. You need to define separate construction heuristic phases in your solver config, one for the basic variable another for the list variable.
1 Comment
heyif
list variable no need to define CH, if I define one for the basic, it also show error:"java.lang.IllegalStateException: Local Search phase (1) needs to start from an initialized solution, but planning list variable (Machine.tasks variable) has (133) unexpected unassigned values."