Hi OptaPlanners,
I have a problem to find a preferred solution in combination with a pair of planning entities.
Following simplified data model to plan the gates and stands for a flight on an airport:
- 3 gates "A", "B", "HOLD", where HOLD means the "unplanned" resource
- 3 stands "A", "B", "HOLD", where HOLD means the "unplanned" resource
- Two flight allocations, one for a stand, one for a gate, both initially set to the HOLD resources
- A constraint that penaltes allocations on HOLD with one medium, so the initial score is 0hard/-2medium/0soft
- A constaint that rewards only the combination stand=A/gate=A with 300 soft
- A constraint that penaltes a moved allocation with 10 soft, but not for a move from HOLD (called movement costs to reduce the desruption like described here:
https://www.optaplanner.org/docs/optaplanner/latest/repeated-planning/repeated-planning.html#nonvolatileReplanning)
First test:
- Initial state: Both allocations on HOLD, score: 0hard/-2medium/0soft
- Solver result (as expected): stand=A/gate=A, score: 0hard/0medium/300soft
Intermediate solutions: A/HOLD (0/-1/0); A/B (0,0,0); A/B (0,0,300)
Second test:
- Initial state: stand=A/gate=B, score: 0hard/0medium/0soft
- Solver result (as expected): stand=A/gate=A, score: 0hard/0medium/290soft
Third test:
- Initial state: stand=B/gate=B, score: 0hard/0medium/0soft
- Expected result: stand=A/gate=A, score: 0hard/0medium/280soft
- But: Solver finds no better solution as the initial state, also no intermediates (calls of bestSolutionChanged), I stopped the solver after one minute
Interresting finding: When I disable the movement costs constaint, the solver finds the expected result, obviously with score 0hard/0medium/300soft
I tried some solver config changes e.g. with <localSearchType>GREAT_DELUGE</localSearchType> to prevent local maxima but found no improvement :-(
Has anyone an idea how to fix this issue?
Thanks in advance,
Frank