Annotation Interface PlanningSolution
A solution is mutable. For scalability reasons (to facilitate incremental score calculation), the same solution instance (called the working solution per move thread) is continuously modified. It's cloned to recall the best solution.
Each planning solution must have exactly 1 PlanningScore property.
Each planning solution must have at least 1 PlanningEntityCollectionProperty
or PlanningEntityProperty property.
Each planning solution is recommended to have 1 ConstraintWeightOverrides property too.
This will make it easy for a solution to override constraint weights provided in ConstraintProvider,
in turn making it possible to run different solutions with a different balance of constraint weights.
Each planning solution used with ConstraintStream score calculation must have at least 1
ProblemFactCollectionProperty
or ProblemFactProperty property.
The class should have a public no-arg constructor, so it can be cloned
(unless the solutionCloner() is specified).
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceWorkaround for annotation limitation insolutionCloner(). -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescription@NonNull AutoDiscoverMemberTypeEnable reflection through the members of the class to automatically assumePlanningScore,PlanningEntityCollectionProperty,PlanningEntityProperty,ProblemFactCollectionProperty,ProblemFactPropertyandConstraintWeightOverridesannotations based on the member type.@NonNull LookUpStrategyTypeDeprecated, for removal: This API element is subject to removal in a future version.Class<? extends SolutionCloner>Overrides the defaultSolutionClonerto implement a customPlanningSolutioncloning implementation.
-
Element Details
-
autoDiscoverMemberType
@NonNull AutoDiscoverMemberType autoDiscoverMemberTypeEnable reflection through the members of the class to automatically assumePlanningScore,PlanningEntityCollectionProperty,PlanningEntityProperty,ProblemFactCollectionProperty,ProblemFactPropertyandConstraintWeightOverridesannotations based on the member type.This feature is not supported under Quarkus. When using Quarkus, setting this to anything other than
AutoDiscoverMemberType.NONEwill result in a build-time exception.- Default:
- NONE
-
solutionCloner
Class<? extends SolutionCloner> solutionClonerOverrides the defaultSolutionClonerto implement a customPlanningSolutioncloning implementation.If this is not specified, then the default reflection-based
SolutionCloneris used, so you don't have to worry about it.- Returns:
PlanningSolution.NullSolutionClonerwhen it is null (workaround for annotation limitation)
- Default:
- ai.timefold.solver.core.api.domain.solution.PlanningSolution.NullSolutionCloner.class
-
lookUpStrategyType
Deprecated, for removal: This API element is subject to removal in a future version.When multi-threaded solving, ensure your domain classes use @PlanningIdinstead.- Default:
- PLANNING_ID_OR_NONE
-
PlanningIdinstead.