Starting from the following configuration in configSolver.xml.
If I want to override this configuration by adding a filter selection class for the ChangeMove and SwapMove classes (AFAIK, those 2 moves are used by default in the Local Search Phase, and a Cartesian product with ChangeMove for each planning value is used in the Construction Heuristics Phase) in this configSolver.xml, how should I proceed?
Should I have to reproduce the default config for those 2 phases, then overwrite it with the selection filter applied, or is there a better approach? I tried to do the following (at the moment it seems that it works properly, but I don’t know if this is best practice):
<!-- Construction Heuristics generic config -->
<constructionHeuristic>
<constructionHeuristicType>ALLOCATE_ENTITY_FROM_QUEUE</constructionHeuristicType>
<entitySorterManner>DECREASING_DIFFICULTY_IF_AVAILABLE</entitySorterManner>
<valueSorterManner>DECREASING_STRENGTH_IF_AVAILABLE</valueSorterManner>
<cartesianProductMoveSelector>
<changeMoveSelector>
<!-- Apply the filter only for Timeslot planning value --><filterClass>com.patrick.timetableappbackend.utils.LessonChangeMoveFilter</filterClass>
<valueSelector variableName="timeslot"/>
</changeMoveSelector>
<changeMoveSelector>
<valueSelector variableName="room"/>
</changeMoveSelector>
</cartesianProductMoveSelector>
</constructionHeuristic>
<!-- Late_Acceptance configuration-->
<localSearch>
<!-- Termination configuration -->
<unionMoveSelector>
<changeMoveSelector>
<filterClass>com.patrick.timetableappbackend.utils.LessonChangeMoveFilter</filterClass>
</changeMoveSelector>
<swapMoveSelector>
<filterClass>com.patrick.timetableappbackend.utils.LessonSwapMoveFilter</filterClass>
</swapMoveSelector>
</unionMoveSelector>
<!-- Acceptor and forager -->
</localSearch>
<!-- Tabu_Search configuration-->
<localSearch>
<unionMoveSelector>
<changeMoveSelector>
<filterClass>com.patrick.timetableappbackend.utils.LessonChangeMoveFilter</filterClass>
</changeMoveSelector>
<swapMoveSelector>
<filterClass>com.patrick.timetableappbackend.utils.LessonSwapMoveFilter</filterClass>
</swapMoveSelector>
</unionMoveSelector>
<!-- Acceptor and forager -->
</localSearch>
Note that I have implemented the filters (for both ChangeMove and SwapMove) separately in a similar way to the examples from the documentation.
EDIT: It seems that the above solution works pretty well, but I don’t know if this is best practice to override the default configuration of Construction Heuristics and Local Search phases with Selection Filter since the quality of the scheduling problem’s solution is slightly poorer.