Annotation Type PlanningSolution
-
@Target(TYPE) @Retention(RUNTIME) public @interface PlanningSolution
Specifies that the class is a planning solution. A solution represents a problem and a possible solution of that problem. A possible solution does not need to be optimal or even feasible. A solution's planning variables might not be initialized (especially when delivered as a problem).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
PlanningScoreproperty.Each planning solution must have at least 1
PlanningEntityCollectionPropertyorPlanningEntityPropertyproperty.Each planning solution is recommended to have 1
ConstraintConfigurationProviderproperty too.Each planning solution used with Drools score calculation must have at least 1
ProblemFactCollectionPropertyorProblemFactPropertyproperty.The class should have a public no-arg constructor, so it can be cloned (unless the
solutionCloner()is specified).
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description AutoDiscoverMemberTypeautoDiscoverMemberTypeEnable reflection through the members of the class to automatically assumePlanningScore,PlanningEntityCollectionProperty,PlanningEntityProperty,ProblemFactCollectionProperty,ProblemFactPropertyandConstraintConfigurationProviderannotations based on the member type.LookUpStrategyTypelookUpStrategyTypeClass<? extends SolutionCloner>solutionClonerOverrides the defaultSolutionClonerto implement a customPlanningSolutioncloning implementation.
-
-
-
Element Detail
-
autoDiscoverMemberType
AutoDiscoverMemberType autoDiscoverMemberType
Enable reflection through the members of the class to automatically assumePlanningScore,PlanningEntityCollectionProperty,PlanningEntityProperty,ProblemFactCollectionProperty,ProblemFactPropertyandConstraintConfigurationProviderannotations based on the member type.- Returns:
- never null
- Default:
- org.optaplanner.core.api.domain.autodiscover.AutoDiscoverMemberType.NONE
-
-
-
solutionCloner
Class<? extends SolutionCloner> solutionCloner
Overrides 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:
- org.optaplanner.core.api.domain.solution.PlanningSolution.NullSolutionCloner.class
-
-
-
lookUpStrategyType
LookUpStrategyType lookUpStrategyType
- Returns:
- never null
- Default:
- org.optaplanner.core.api.domain.lookup.LookUpStrategyType.PLANNING_ID_OR_NONE
-
-