Class SolutionDescriptor<Solution_>

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

    public class SolutionDescriptor<Solution_>
    extends Object
    • Field Detail

      • logger

        protected final transient org.slf4j.Logger logger
    • 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)
      • checkIfProblemFactsExist

        public void checkIfProblemFactsExist()
        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()
      • getConstraintConfigurationMemberAccessor

        public MemberAccessor getConstraintConfigurationMemberAccessor()
      • getEntityClassSet

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

        public boolean hasEntityDescriptorStrict​(Class<?> entityClass)
      • 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)
      • getMovableEntityCount

        public int getMovableEntityCount​(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
      • countUninitializedVariables

        public int countUninitializedVariables​(Solution_ solution)
      • 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