You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/modules/ROOT/pages/optimization-algorithms/move-selector-reference.adoc
+11-16Lines changed: 11 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -436,12 +436,9 @@ For example, don't change a gym lecture to a room which is not a gym room.
436
436
It's usually better to not use move filtering for such cases,
437
437
because it allows the metaheuristics to temporarily break hard constraints to escape local optima.
438
438
+
439
-
[NOTE]
440
-
====
441
-
Any built-in hard constraint must probably be filtered on every move type of every solver phase.
439
+
NOTE: Any built-in hard constraint must probably be filtered on every move type of every solver phase.
442
440
For example if it filters the change move of Local Search, it must also filter the swap move that swaps the room of a gym lecture with another lecture for which the other lecture's original room isn't a gym room.
443
441
Furthermore, it must also filter the change moves of the Construction Heuristics (which requires an advanced configuration).
444
-
====
445
442
446
443
If a move is unaccepted by the filter, it's not executed and the score isn't calculated.
447
444
@@ -459,21 +456,16 @@ public interface SelectionFilter<Solution_, T> {
459
456
----
460
457
461
458
Implement the `accept` method to return `false` on a discarded `selection` (see below).
459
+
Implementations are expected to be stateless,
460
+
as the solver may choose to reuse them in different contexts.
461
+
462
462
Filtered selection can happen on any Selector in the selector tree, including any ``MoveSelector``, `EntitySelector`
463
463
or ``ValueSelector``.
464
464
It works with any `cacheType` and ``selectionOrder``.
465
465
466
-
[NOTE]
467
-
====
468
466
Apply the filter on the lowest level possible.
469
467
In most cases, you'll need to know both the entity and the value involved so you'll have to apply it on the move selector.
470
-
====
471
468
472
-
[NOTE]
473
-
====
474
-
`SelectionFilter` implementations are expected to be stateless.
475
-
The solver may choose to reuse them in different contexts.
476
-
====
477
469
478
470
[#filteredMoveSelection]
479
471
===== Filtered move selection
@@ -482,12 +474,14 @@ Unaccepted moves will not be selected and will therefore never need to be undone
482
474
483
475
[source,java,options="nowrap"]
484
476
----
485
-
public class DifferentCourseSwapMoveFilter implements SelectionFilter<CourseSchedule, SwapMove> {
0 commit comments