Class SolutionDescriptor<Solution_>

  • Type Parameters:
    Solution_ - the solution type, the class with the PlanningSolution annotation

    public class SolutionDescriptor<Solution_>
    extends Object
    • Constructor Detail

      • SolutionDescriptor

        public SolutionDescriptor​(Class<Solution_> solutionClass)
    • Method Detail

      • 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)
      • processAnnotations

        public void processAnnotations​(DescriptorPolicy descriptorPolicy,
                                       List<Class<?>> entityClassList)
      • assertProblemFactsExist

        public void assertProblemFactsExist()
        Only called if Drools score calculation is used.
      • getProblemFactCollectionMemberAccessorMap

        public Map<String,​MemberAccessor> getProblemFactCollectionMemberAccessorMap()
      • getProblemFactMemberAndProblemFactCollectionMemberNames

        public List<String> getProblemFactMemberAndProblemFactCollectionMemberNames()
      • getEntityCollectionMemberAccessorMap

        public Map<String,​MemberAccessor> getEntityCollectionMemberAccessorMap()
      • getEntityMemberAndEntityCollectionMemberNames

        public List<String> getEntityMemberAndEntityCollectionMemberNames()
      • getProblemFactOrEntityClassSet

        public Set<Class<?>> getProblemFactOrEntityClassSet()
      • getClassAndPlanningIdComparator

        public Comparator<Object> getClassAndPlanningIdComparator()
      • setAssertModelForCloning

        public void setAssertModelForCloning​(boolean assertModelForCloning)
      • getConstraintConfigurationMemberAccessor

        public MemberAccessor getConstraintConfigurationMemberAccessor()
      • getEntityClassSet

        public Set<Class<?>> getEntityClassSet()
      • hasEntityDescriptor

        public boolean hasEntityDescriptor​(Class<?> entitySubclass)
      • validateConstraintWeight

        public void validateConstraintWeight​(String constraintPackage,
                                             String constraintName,
                                             Score<?> constraintWeight)
      • getEntityCount

        public int getEntityCount​(Solution_ solution)
        Parameters:
        solution - never null
        Returns:
        >= 0
      • getEntityListByEntityClass

        public List<Object> getEntityListByEntityClass​(Solution_ solution,
                                                       Class<?> entityClass)
      • hasMovableEntities

        public boolean hasMovableEntities​(ScoreDirector<Solution_> scoreDirector)
        Parameters:
        scoreDirector - never null
        Returns:
        >= 0
      • getGenuineVariableCount

        public long getGenuineVariableCount​(Solution_ solution)
        Parameters:
        solution - never null
        Returns:
        >= 0
      • getMaximumValueCount

        public long getMaximumValueCount​(Solution_ solution)
      • getValueCount

        public int getValueCount​(Solution_ solution)
        Parameters:
        solution - never null
        Returns:
        >= 0
      • getProblemScale

        public long getProblemScale​(Solution_ solution)
        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

        public int countUninitialized​(Solution_ solution)
        Calculates the number of elements that need to be processed in the Construction Heuristics phase. The negative value of this is the initScore. It represents how many Construction Heuristics steps need to be taken before the solution is fully initialized.
        Parameters:
        solution - never null
        Returns:
        >= 0
      • getScore

        public Score getScore​(Solution_ solution)
        Parameters:
        solution - never null
        Returns:
        sometimes null, if the Score hasn't been calculated yet
      • setScore

        public void setScore​(Solution_ solution,
                             Score score)
        Called when the Score has been calculated or predicted.
        Parameters:
        solution - never null
        score - sometimes null, in rare occasions to indicate that the old Score is stale, but no new ones has been calculated