4

I am developing a solver using Optaplanner 6.1.0, similar to the Vehicle Routing Problem. When I run my solver on 700 installers and 200 bookings, it will successfully solve the planning problem. But, when I used against a larger dataset (700 installers and 1220 bookings), I get

Caused by: java.lang.IllegalStateException: Local Search phase started with an uninitialized Solution. First initialize the Solution. For example, run a Construction Heuristic phase first.

but right before the exception,

16:10:40,378 INFO [DefaultConstructionHeuristicPhase] [http-listener-1(4)] Construction Heuristic phase (0) ended: step total (194), time spent (30693), best score (-1hard/-688803soft).

I am using <constructionHeuristicType>FIRST_FIT_DECREASING</constructionHeuristicType> in my config.

Am I using it wrong?

Pejal Hebat
  • 116
  • 6

1 Answers1

2

Maybe the value range for a planning variable is empty. Especially with value range provider from entity, this is more likely. Feel free to file a jira that the error message should improve in such a case.

Diagnostic todo: Comment out the local solver phase, run the solver (so it only does the construction heuristic) and then iterate through the planning entities and print out the value for each planning value. Check if there are any nulls in there.

The fact that you have 194 steps, instead 200 steps in your CH indicates this. (If those other 6 planning entities are immovable, this won't trigger this exception (more info), so that's not the problem.)

Geoffrey De Smet
  • 26,223
  • 11
  • 73
  • 120
  • Thank you @geoffrey. I listed the planning entities, and some of the planning values are null. I am currently trying to allocate all planning entities, so that none of them is null, but it seems that I can only use FIRST_FIT and FIRST_FIT_DECREASING for constructionHeuristicType. Is there a workaround where I can manually allocate the planning entities before constructionHeuristic phase starts? – Pejal Hebat Feb 27 '15 at 03:40
  • What I did was I increase the HardConstraintScore for not having any previousStandstill from -1 to -3, and all the planning entities got assigned/has value. – Pejal Hebat Feb 27 '15 at 08:19
  • That all sounds impossible, because the CH's will always a assign value, unless nullabe=true (in which case LS wouldn't be bothered by it). Do you have a null in your value range? – Geoffrey De Smet Feb 27 '15 at 08:51