Interface ScoreDirectorFactoryService<Solution_,Score_ extends Score<Score_>>

Type Parameters:
Solution_ - the solution type, the class with the PlanningSolution annotation
Score_ - the score type to go with the solution
All Known Implementing Classes:
DrlScoreDirectorFactoryService, EasyScoreDirectorFactoryService, IncrementalScoreDirectorFactoryService

public interface ScoreDirectorFactoryService<Solution_,Score_ extends Score<Score_>>
All ScoreDirectorFactory implementations must provide an implementation of this interface, as well as an entry in META-INF/services/org.optaplanner.core.impl.score.director.ScoreDirectorFactoryService file. This makes it available for discovery in ScoreDirectorFactoryFactory via ServiceLoader.
  • Method Details

    • getPriority

      default int getPriority()
      If multiple services are available for the same config, the one with the higher priority is picked. Used by the CS services to ensure Drools is picked if both Drools and Bavet are available.
    • getSupportedScoreDirectorType

      ScoreDirectorType getSupportedScoreDirectorType()
      never null, the score director type that is implemented by the factory
    • buildScoreDirectorFactory

      Supplier<AbstractScoreDirectorFactory<Solution_,Score_>> buildScoreDirectorFactory(ClassLoader classLoader, SolutionDescriptor<Solution_> solutionDescriptor, ScoreDirectorFactoryConfig config, EnvironmentMode environmentMode)
      Returns a Supplier which returns new instance of a score director defined by getSupportedScoreDirectorType(). This is done so that the actual factory is only instantiated after all the configuration fail-fasts have been performed.
      classLoader -
      solutionDescriptor - never null, solution descriptor provided by the solver
      config - never null, configuration to use for instantiating the factory
      environmentMode - never null
      null when this type is not configured
      IllegalStateException - if the configuration has an issue