Class ChangeMoveProvider<Solution_,Entity_,Value_>

java.lang.Object
ai.timefold.solver.core.impl.move.streams.generic.provider.ChangeMoveProvider<Solution_,Entity_,Value_>
All Implemented Interfaces:
MoveProvider<Solution_>, Function<MoveStreamFactory<Solution_>,MoveProducer<Solution_>>

@NullMarked public class ChangeMoveProvider<Solution_,Entity_,Value_> extends Object implements MoveProvider<Solution_>
  • Constructor Details

  • Method Details

    • apply

      public MoveProducer<Solution_> apply(MoveStreamFactory<Solution_> moveStreamFactory)
      Specified by:
      apply in interface Function<Solution_,Entity_>
    • acceptEntity

      protected boolean acceptEntity(Entity_ entity)
      Determines whether the given entity should be accepted to produce a move.
      Parameters:
      entity - the entity to evaluate
      Returns:
      true if the entity is accepted, false otherwise; defaults to true.
    • acceptValue

      protected boolean acceptValue(@Nullable Value_ value)
      Evaluates whether the given value (from the applicable value range) should be accepted to produce a move.
      Parameters:
      value - the value to evaluate
      Returns:
      true if the value is accepted, false otherwise; by default, it rejects null values if the PlanningVariable.allowsUnassigned() is false.
    • acceptEntityValuePair

      protected boolean acceptEntityValuePair(Entity_ entity, @Nullable Value_ value)
      Determines whether a given entity and value pair should be accepted to produce a move.
      Parameters:
      entity - the entity to evaluate, already accepted by acceptEntity(Object)
      value - the value to evaluate, already accepted by acceptValue(Object)
      Returns:
      true if the entity-value pair is accepted, false otherwise; by default, the pair is accepted if the entity's value is different from the value to evaluate.