Interface ScoreDirectorFactoryService<Solution_,Score_ extends Score<Score_>>
-
- Type Parameters:
Solution_- the solution type, the class with thePlanningSolutionannotationScore_- the score type to go with the solution
- All Known Implementing Classes:
EasyScoreDirectorFactoryService,IncrementalScoreDirectorFactoryService
public interface ScoreDirectorFactoryService<Solution_,Score_ extends Score<Score_>>AllScoreDirectorFactoryimplementations must provide an implementation of this interface, as well as an entry in META-INF/services/ai.timefold.solver.core.impl.score.director.ScoreDirectorFactoryService file. This makes it available for discovery inScoreDirectorFactoryFactoryviaServiceLoader.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Supplier<AbstractScoreDirectorFactory<Solution_,Score_>>buildScoreDirectorFactory(ClassLoader classLoader, SolutionDescriptor<Solution_> solutionDescriptor, ScoreDirectorFactoryConfig config, EnvironmentMode environmentMode)Returns aSupplierwhich returns new instance of a score director defined bygetSupportedScoreDirectorType().ScoreDirectorTypegetSupportedScoreDirectorType()
-
-
-
Method Detail
-
getSupportedScoreDirectorType
ScoreDirectorType getSupportedScoreDirectorType()
- Returns:
- 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 aSupplierwhich returns new instance of a score director defined bygetSupportedScoreDirectorType(). This is done so that the actual factory is only instantiated after all the configuration fail-fasts have been performed.- Parameters:
classLoader-solutionDescriptor- never null, solution descriptor provided by the solverconfig- never null, configuration to use for instantiating the factoryenvironmentMode- never null- Returns:
- null when this type is not configured
- Throws:
IllegalStateException- if the configuration has an issue
-
-