Class SolutionDescriptor<Solution_>
java.lang.Object
org.optaplanner.core.impl.domain.solution.descriptor.SolutionDescriptor<Solution_>
- Type Parameters:
Solution_- the solution type, the class with thePlanningSolutionannotation
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddEntityDescriptor(EntityDescriptor<Solution_> entityDescriptor) voidOnly 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) intcountUninitialized(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) intgetEntityCount(Solution_ solution) getEntityDescriptorStrict(Class<?> entityClass) longgetGenuineVariableCount(Solution_ solution) longgetMaximumValueCount(Solution_ solution) longgetProblemScale(Solution_ solution) Calculates an indication on how big this problem instance is.intgetValueCount(Solution_ solution) booleanhasEntityDescriptor(Class<?> entitySubclass) booleanhasMovableEntities(ScoreDirector<Solution_> scoreDirector) voidprocessAnnotations(DescriptorPolicy descriptorPolicy, List<Class<?>> entityClassList) voidsetAssertModelForCloning(boolean assertModelForCloning) voidCalled when theScorehas been calculated or predicted.toString()voidvalidateConstraintWeight(String constraintPackage, String constraintName, Score<?> constraintWeight) voidvoidvisitAllEntities(Solution_ solution, Consumer<Object> visitor) voidvisitAllProblemFacts(Solution_ solution, Consumer<Object> visitor) voidvisitEntitiesByEntityClass(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
Scorehasn't been calculated yet
-
setScore
Called when theScorehas been calculated or predicted.- Parameters:
solution- never nullscore- sometimes null, in rare occasions to indicate that the oldScoreis stale, but no new ones has been calculated
-
toString
-