Interface ScoreDirectorFactoryService<Solution_,Score_ extends Score<Score_>>
-
- Type Parameters:
Solution_
- the solution type, the class with thePlanningSolution
annotationScore_
- the score type to go with the solution
- All Known Implementing Classes:
ConstraintStreamsScoreDirectorFactoryService
,DrlScoreDirectorFactoryService
,EasyScoreDirectorFactoryService
,IncrementalScoreDirectorFactoryService
public interface ScoreDirectorFactoryService<Solution_,Score_ extends Score<Score_>>
AllScoreDirectorFactory
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 inScoreDirectorFactoryFactory
viaServiceLoader
.
-
-
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)
Returns aSupplier
which returns new instance of a score director defined bygetSupportedScoreDirectorType()
.ScoreDirectorType
getSupportedScoreDirectorType()
-
-
-
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)
Returns aSupplier
which 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 factory- Returns:
- null when this type is not configured
- Throws:
IllegalStateException
- if the configuration has an issue
-
-