Class MoveAdapters

java.lang.Object
ai.timefold.solver.core.impl.heuristic.move.MoveAdapters

@NullMarked public final class MoveAdapters extends Object
While the Neighborhoods API and Move Selectors API need to coexist, there are places where moves need to be converted between the old and new types. This class provides static methods to perform these conversions.
  • Method Details

    • unadapt

      public static <Solution_> Move<Solution_> unadapt(Move<Solution_> possibleLegacyMove)
    • toLegacyMoveIterator

      public static <Solution_> Iterator<Move<Solution_>> toLegacyMoveIterator(Iterator<Move<Solution_>> newIterator)
    • isDoable

      public static <Solution_> boolean isDoable(MoveDirector<Solution_,?> moveDirector, Move<Solution_> move)
      Used to determine if a move is doable. A move is only doable if:
      Parameters:
      moveDirector - never null
      move - never null
      Returns:
      true if the move is doable
    • testWhenLegacyMove

      public static <Solution_> boolean testWhenLegacyMove(Move<Solution_> move, Predicate<Move<Solution_>> predicate)