Class SolutionDescriptor<Solution_>
java.lang.Object
org.optaplanner.core.impl.domain.solution.descriptor.SolutionDescriptor<Solution_>
- Type Parameters:
Solution_
- the solution type, the class with thePlanningSolution
annotation
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addEntityDescriptor
(EntityDescriptor<Solution_> entityDescriptor) void
Only called if Drools score calculation is used.static <Solution_>
SolutionDescriptor<Solution_>buildSolutionDescriptor
(Class<Solution_> solutionClass, Class<?>... entityClasses) static <Solution_>
SolutionDescriptor<Solution_>buildSolutionDescriptor
(Class<Solution_> solutionClass, List<Class<?>> entityClassList) static <Solution_>
SolutionDescriptor<Solution_>buildSolutionDescriptor
(DomainAccessType domainAccessType, Class<Solution_> solutionClass, Map<String, MemberAccessor> memberAccessorMap, Map<String, SolutionCloner> solutionClonerMap, List<Class<?>> entityClassList) int
countUninitialized
(Solution_ solution) Calculates the number of elements that need to be processed in the Construction Heuristics phase.findEntityDescriptor
(Class<?> entitySubclass) findEntityDescriptorOrFail
(Class<?> entitySubclass) findVariableDescriptorOrFail
(Object entity, String variableName) getAllEntitiesAndProblemFacts
(Solution_ solution) int
getEntityCount
(Solution_ solution) getEntityDescriptorStrict
(Class<?> entityClass) long
getGenuineVariableCount
(Solution_ solution) long
getMaximumValueCount
(Solution_ solution) long
getProblemScale
(Solution_ solution) Calculates an indication on how big this problem instance is.int
getValueCount
(Solution_ solution) boolean
hasEntityDescriptor
(Class<?> entitySubclass) boolean
hasMovableEntities
(ScoreDirector<Solution_> scoreDirector) void
processAnnotations
(DescriptorPolicy descriptorPolicy, List<Class<?>> entityClassList) void
setAssertModelForCloning
(boolean assertModelForCloning) void
Called when theScore
has been calculated or predicted.toString()
void
validateConstraintWeight
(String constraintPackage, String constraintName, Score<?> constraintWeight) void
void
visitAllEntities
(Solution_ solution, Consumer<Object> visitor) void
visitAllProblemFacts
(Solution_ solution, Consumer<Object> visitor) void
visitEntitiesByEntityClass
(Solution_ solution, Class<?> entityClass, Consumer<Object> visitor)
-
Method Details
-
buildSolutionDescriptor
public static <Solution_> SolutionDescriptor<Solution_> buildSolutionDescriptor(Class<Solution_> solutionClass, Class<?>... entityClasses) -
buildSolutionDescriptor
public static <Solution_> SolutionDescriptor<Solution_> buildSolutionDescriptor(Class<Solution_> solutionClass, List<Class<?>> entityClassList) -
buildSolutionDescriptor
public static <Solution_> SolutionDescriptor<Solution_> buildSolutionDescriptor(DomainAccessType domainAccessType, Class<Solution_> solutionClass, Map<String, MemberAccessor> memberAccessorMap, Map<String, SolutionCloner> solutionClonerMap, List<Class<?>> entityClassList) -
addEntityDescriptor
-
processAnnotations
-
assertProblemFactsExist
public void assertProblemFactsExist()Only called if Drools score calculation is used. -
getSolutionClass
-
getMemberAccessorFactory
-
getDomainAccessType
-
getScoreDefinition
-
getProblemFactMemberAccessorMap
-
getProblemFactCollectionMemberAccessorMap
-
getProblemFactMemberAndProblemFactCollectionMemberNames
-
getEntityMemberAccessorMap
-
getEntityCollectionMemberAccessorMap
-
getEntityMemberAndEntityCollectionMemberNames
-
getProblemFactOrEntityClassSet
-
getListVariableDescriptors
-
getSolutionCloner
-
getClassAndPlanningIdComparator
-
setAssertModelForCloning
public void setAssertModelForCloning(boolean assertModelForCloning) -
getConstraintConfigurationMemberAccessor
-
getConstraintConfigurationDescriptor
- Returns:
- sometimes null
-
getEntityClassSet
-
getEntityDescriptors
-
getGenuineEntityDescriptors
-
getEntityDescriptorStrict
-
hasEntityDescriptor
-
findEntityDescriptorOrFail
-
findEntityDescriptor
-
findVariableDescriptorOrFail
public VariableDescriptor<Solution_> findVariableDescriptorOrFail(Object entity, String variableName) -
getLookUpStrategyResolver
-
validateConstraintWeight
-
getAllEntitiesAndProblemFacts
-
getEntityCount
- Parameters:
solution
- never null- Returns:
>= 0
-
visitAllEntities
-
visitEntitiesByEntityClass
-
visitAllProblemFacts
-
visitAll
-
hasMovableEntities
- Parameters:
scoreDirector
- never null- Returns:
>= 0
-
getGenuineVariableCount
- Parameters:
solution
- never null- Returns:
>= 0
-
getMaximumValueCount
-
getValueCount
- Parameters:
solution
- never null- Returns:
>= 0
-
getProblemScale
Calculates an indication on how big this problem instance is. This is intentionally very loosely defined for now.- Parameters:
solution
- never null- Returns:
>= 0
-
countUninitialized
Calculates the number of elements that need to be processed in the Construction Heuristics phase. The negative value of this is theinitScore
. It represents how many Construction Heuristics steps need to be taken before the solution is fully initialized.- Parameters:
solution
- never null- Returns:
>= 0
-
getScore
- Parameters:
solution
- never null- Returns:
- sometimes null, if the
Score
hasn't been calculated yet
-
setScore
Called when theScore
has been calculated or predicted.- Parameters:
solution
- never nullscore
- sometimes null, in rare occasions to indicate that the oldScore
is stale, but no new ones has been calculated
-
toString
-