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 Summary
ConstructorsConstructorDescriptionChangeMoveProvider(PlanningVariableMetaModel<Solution_, Entity_, Value_> variableMetaModel) -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanacceptEntity(Entity_ entity) Determines whether the given entity should be accepted to produce a move.protected booleanacceptEntityValuePair(Entity_ entity, @Nullable Value_ value) Determines whether a given entity and value pair should be accepted to produce a move.protected booleanacceptValue(@Nullable Value_ value) Evaluates whether the given value (from the applicable value range) should be accepted to produce a move.apply(MoveStreamFactory<Solution_> moveStreamFactory)
-
Constructor Details
-
ChangeMoveProvider
-
-
Method Details
-
apply
-
acceptEntity
Determines whether the given entity should be accepted to produce a move.- Parameters:
entity- the entity to evaluate- Returns:
trueif the entity is accepted,falseotherwise; defaults to true.
-
acceptValue
Evaluates whether the given value (from the applicable value range) should be accepted to produce a move.- Parameters:
value- the value to evaluate- Returns:
trueif the value is accepted,falseotherwise; by default, it rejects null values if thePlanningVariable.allowsUnassigned()is false.
-
acceptEntityValuePair
Determines whether a given entity and value pair should be accepted to produce a move.- Parameters:
entity- the entity to evaluate, already accepted byacceptEntity(Object)value- the value to evaluate, already accepted byacceptValue(Object)- Returns:
trueif the entity-value pair is accepted,falseotherwise; by default, the pair is accepted if the entity's value is different from the value to evaluate.
-