Package org.optaplanner.core.impl.solver
Class DefaultSolverFactory<Solution_>
- java.lang.Object
-
- org.optaplanner.core.api.solver.SolverFactory<Solution_>
-
- org.optaplanner.core.impl.solver.DefaultSolverFactory<Solution_>
-
- Type Parameters:
Solution_- the solution type, the class with thePlanningSolutionannotation
public final class DefaultSolverFactory<Solution_> extends SolverFactory<Solution_>
- See Also:
SolverFactory
-
-
Constructor Summary
Constructors Constructor Description DefaultSolverFactory(SolverConfig solverConfig)DefaultSolverFactory(SolverConfig solverConfig, SolverConfigContext solverConfigContext)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Solver<Solution_>buildSolver()Creates a newSolverinstance.SolverFactory<Solution_>cloneSolverFactory()Deprecated.ScoreDirectorFactory<Solution_>getScoreDirectorFactory()Useful to reuse theScorecalculation (for example in a UI) and to explain theScoreto the user with theConstraintMatchTotalandIndictmentAPI.SolverConfiggetSolverConfig()Deprecated.SolverConfigContextgetSolverConfigContext()-
Methods inherited from class org.optaplanner.core.api.solver.SolverFactory
create, createEmpty, createEmpty, createEmptyFromKieContainer, createEmptyFromKieContainer, createFromKieContainer, createFromKieContainerXmlResource, createFromKieContainerXmlResource, createFromKieContainerXmlResource, createFromXmlFile, createFromXmlFile, createFromXmlInputStream, createFromXmlInputStream, createFromXmlReader, createFromXmlReader, createFromXmlResource, createFromXmlResource
-
-
-
-
Constructor Detail
-
DefaultSolverFactory
public DefaultSolverFactory(SolverConfig solverConfig)
-
DefaultSolverFactory
public DefaultSolverFactory(SolverConfig solverConfig, SolverConfigContext solverConfigContext)
-
-
Method Detail
-
buildSolver
public Solver<Solution_> buildSolver()
Description copied from class:SolverFactoryCreates a newSolverinstance.- Specified by:
buildSolverin classSolverFactory<Solution_>- Returns:
- never null
-
getScoreDirectorFactory
public ScoreDirectorFactory<Solution_> getScoreDirectorFactory()
Description copied from class:SolverFactoryUseful to reuse theScorecalculation (for example in a UI) and to explain theScoreto the user with theConstraintMatchTotalandIndictmentAPI.- Specified by:
getScoreDirectorFactoryin classSolverFactory<Solution_>- Returns:
- never null
-
getSolverConfig
@Deprecated public SolverConfig getSolverConfig()
Deprecated.Description copied from class:SolverFactoryDeprecated. To configure aSolverFactorydynamically (without parsing XML each time), useSolverFactory.create(SolverConfig)instead.This method is not thread-safe. To configure a
SolverConfigdifferently for parallel requests, build a templateSolverFactoryfrom XML and clone itSolverFactory.cloneSolverFactory()for each request, before before calling this method.- Specified by:
getSolverConfigin classSolverFactory<Solution_>- Returns:
- never null
-
cloneSolverFactory
@Deprecated public SolverFactory<Solution_> cloneSolverFactory()
Deprecated.Description copied from class:SolverFactoryDeprecated. To configure aSolverFactorydynamically (without parsing XML each time), useSolverConfig(SolverConfig)andSolverFactory.create(SolverConfig)instead.Build a
SolverFactoryquickly (without parsing XML) that builds the exact sameSolverwithSolverFactory.buildSolver(), but can also be modified withSolverFactory.getSolverConfig()to build a differentSolverwithout affecting the originalSolverFactory.- Specified by:
cloneSolverFactoryin classSolverFactory<Solution_>- Returns:
- never null, often a different
SolverFactorysubclass implementation than this instance
-
getSolverConfigContext
public SolverConfigContext getSolverConfigContext()
-
-