Using Optaplanner 7.3.0 with multiple planning variable hence multiple (2) construction heuristics phases. Here is how my CH phase 2 looks like:
<constructionHeuristic>
<queuedEntityPlacer>
<entitySelector id="taskChainEntitySelector">
<entityClass>....Task</entityClass>
</entitySelector>
<changeMoveSelector>
<entitySelector mimicSelectorRef="taskChainEntitySelector"/>
<valueSelector>
<variableName>previousTaskOrEmployee</variableName>
</valueSelector>
</changeMoveSelector>
</queuedEntityPlacer>
</constructionHeuristic>
I have 814 tasks and previousTaskOrEmployee is a chained planning variable. But this CH phase takes around 7-8 mins or more than that if I don't use any of these:
1. Caching in valueSelector (Cache:PHASE, selectionOrder:SORTED )
2. selectedCountLimit=100
The reason selectedCountLimit works as this CH phase creates a large number of moves as it goes with steps, a simple data without caching/limiting/filtering:
-814init = selectedMovesCOunt:1
..
-621init = selectedMovesCOunt:300
..
-421init = selectedMovesCOunt:500
..
-221init = selectedMovesCOunt:800// increases downwards
In same cases, I've seen moves per step to be more than 50k which is crazy
My questions:
A. Is generating so many steps by changeMove in CH normal?
B. Filtering does not make much sense in CH as variables are not initialised. So, should selectedCountLimit be used ideally?
C. My first CH phase does not take any time just a few 4-5 seconds because it's relatively lesser entities and no chains. What should be the ideal time for my CH phase 2 with 814 chained entities?