public abstract class PlannerBenchmarkFactory extends Object
PlannerBenchmark
instances.
Supports tweaking the configuration programmatically before a PlannerBenchmark
instance is build.
Constructor and Description |
---|
PlannerBenchmarkFactory() |
public static PlannerBenchmarkFactory createFromSolverConfigXmlResource(String solverConfigResource)
SolverConfig
to build a PlannerBenchmarkConfig
that in turn is used to build a PlannerBenchmarkFactory
.
The XML root element must be <solver>
.
To read an XML benchmark configuration instead, use createFromXmlResource(String)
.
solverConfigResource
- never null, a classpath resource
as defined by ClassLoader.getResource(String)
public static PlannerBenchmarkFactory createFromSolverConfigXmlResource(String solverConfigResource, ClassLoader classLoader)
createFromSolverConfigXmlResource(String)
.solverConfigResource
- never null, a classpath resource
as defined by ClassLoader.getResource(String)
.classLoader
- sometimes null, the ClassLoader
to use for loading all resources and Class
es,
null to use the default ClassLoader
public static PlannerBenchmarkFactory createFromSolverConfigXmlResource(String solverConfigResource, File benchmarkDirectory)
createFromSolverConfigXmlResource(String)
.solverConfigResource
- never null, a classpath resource
as defined by ClassLoader.getResource(String)
benchmarkDirectory
- never nullpublic static PlannerBenchmarkFactory createFromSolverConfigXmlResource(String solverConfigResource, File benchmarkDirectory, ClassLoader classLoader)
createFromSolverConfigXmlResource(String)
.solverConfigResource
- never null, a classpath resource
as defined by ClassLoader.getResource(String)
benchmarkDirectory
- never nullclassLoader
- sometimes null, the ClassLoader
to use for loading all resources and Class
es,
null to use the default ClassLoader
@Deprecated public static <Solution_> PlannerBenchmarkFactory createFromSolverFactory(SolverFactory<Solution_> solverFactory)
createFromSolverConfigXmlResource(String)
or in complex cases PlannerBenchmarkConfig.createFromSolverConfig(SolverConfig)
and create(PlannerBenchmarkConfig)
. Will be removed in 8.0.Solution_
- the solution type, the class with the PlanningSolution
annotationsolverFactory
- never null, also its ClassLoader
is reused if any was configured during creation@Deprecated public static <Solution_> PlannerBenchmarkFactory createFromSolverFactory(SolverFactory<Solution_> solverFactory, File benchmarkDirectory)
createFromSolverConfigXmlResource(String, File)
.
or in complex cases PlannerBenchmarkConfig.createFromSolverConfig(SolverConfig, File)
and create(PlannerBenchmarkConfig)
. Will be removed in 8.0.Solution_
- the solution type, the class with the PlanningSolution
annotationsolverFactory
- never null, also its ClassLoader
is reused if any was configured during creationbenchmarkDirectory
- never nullpublic static PlannerBenchmarkFactory createFromXmlResource(String benchmarkConfigResource)
PlannerBenchmarkConfig
to build a PlannerBenchmarkFactory
.
The XML root element must be <plannerBenchmark>
.
To read an XML solver configuration instead, use createFromSolverConfigXmlResource(String)
.
benchmarkConfigResource
- never null, a classpath resource
as defined by ClassLoader.getResource(String)
public static PlannerBenchmarkFactory createFromXmlResource(String benchmarkConfigResource, ClassLoader classLoader)
createFromXmlResource(String)
.benchmarkConfigResource
- never null, a classpath resource
as defined by ClassLoader.getResource(String)
classLoader
- sometimes null, the ClassLoader
to use for loading all resources and Class
es,
null to use the default ClassLoader
public static PlannerBenchmarkFactory createFromXmlFile(File benchmarkConfigFile)
PlannerBenchmarkConfig
to build a PlannerBenchmarkFactory
.
Warning: this leads to platform dependent code,
it's recommend to use createFromXmlResource(String)
instead.
benchmarkConfigFile
- never nullpublic static PlannerBenchmarkFactory createFromXmlFile(File benchmarkConfigFile, ClassLoader classLoader)
createFromXmlFile(File)
.benchmarkConfigFile
- never nullclassLoader
- sometimes null, the ClassLoader
to use for loading all resources and Class
es,
null to use the default ClassLoader
@Deprecated public static PlannerBenchmarkFactory createFromXmlInputStream(InputStream in)
PlannerBenchmarkConfig.createFromXmlInputStream(InputStream)
and create(PlannerBenchmarkConfig)
. Will be removed in 8.0.in
- never null, gets closed@Deprecated public static PlannerBenchmarkFactory createFromXmlInputStream(InputStream in, ClassLoader classLoader)
PlannerBenchmarkConfig.createFromXmlInputStream(InputStream, ClassLoader)
and create(PlannerBenchmarkConfig)
. Will be removed in 8.0.in
- never null, gets closedclassLoader
- sometimes null, the ClassLoader
to use for loading all resources and Class
es,
null to use the default ClassLoader
@Deprecated public static PlannerBenchmarkFactory createFromXmlReader(Reader reader)
PlannerBenchmarkConfig.createFromXmlReader(Reader)
and create(PlannerBenchmarkConfig)
. Will be removed in 8.0.reader
- never null, gets closed@Deprecated public static PlannerBenchmarkFactory createFromXmlReader(Reader reader, ClassLoader classLoader)
PlannerBenchmarkConfig.createFromXmlReader(Reader, ClassLoader)
and create(PlannerBenchmarkConfig)
. Will be removed in 8.0.reader
- never null, gets closedclassLoader
- sometimes null, the ClassLoader
to use for loading all resources and Class
es,
null to use the default ClassLoader
public static PlannerBenchmarkFactory createFromFreemarkerXmlResource(String templateResource)
PlannerBenchmarkConfig
to build a PlannerBenchmarkFactory
.
The generated XML root element must be <plannerBenchmark>
.templateResource
- never null, a classpath resource as defined by ClassLoader.getResource(String)
createFromFreemarkerXmlResource(String)
public static PlannerBenchmarkFactory createFromFreemarkerXmlResource(String templateResource, ClassLoader classLoader)
createFromFreemarkerXmlResource(String)
.templateResource
- never null, a classpath resource as defined by ClassLoader.getResource(String)
classLoader
- sometimes null, the ClassLoader
to use for loading all resources and Class
es,
null to use the default ClassLoader
public static PlannerBenchmarkFactory createFromFreemarkerXmlResource(String templateResource, Object model)
createFromFreemarkerXmlResource(String)
.templateResource
- never null, a classpath resource as defined by ClassLoader.getResource(String)
model
- sometimes nullpublic static PlannerBenchmarkFactory createFromFreemarkerXmlResource(String templateResource, Object model, ClassLoader classLoader)
createFromFreemarkerXmlResource(String)
.templateResource
- never null, a classpath resource as defined by ClassLoader.getResource(String)
model
- sometimes nullclassLoader
- sometimes null, the ClassLoader
to use for loading all resources and Class
es,
null to use the default ClassLoader
public static PlannerBenchmarkFactory createFromFreemarkerXmlFile(File templateFile)
PlannerBenchmarkConfig
to build a PlannerBenchmarkFactory
.
The generated XML root element must be <plannerBenchmark>
.
Warning: this leads to platform dependent code,
it's recommend to use createFromFreemarkerXmlResource(String)
instead.
templateFile
- never nullpublic static PlannerBenchmarkFactory createFromFreemarkerXmlFile(File templateFile, ClassLoader classLoader)
createFromFreemarkerXmlFile(File)
.templateFile
- never nullclassLoader
- sometimes null, the ClassLoader
to use for loading all resources and Class
es,
null to use the default ClassLoader
public static PlannerBenchmarkFactory createFromFreemarkerXmlFile(File templateFile, Object model)
createFromFreemarkerXmlFile(File)
.templateFile
- never nullmodel
- sometimes nullpublic static PlannerBenchmarkFactory createFromFreemarkerXmlFile(File templateFile, Object model, ClassLoader classLoader)
createFromFreemarkerXmlFile(File)
.templateFile
- never nullmodel
- sometimes nullclassLoader
- sometimes null, the ClassLoader
to use for loading all resources and Class
es,
null to use the default ClassLoader
@Deprecated public static PlannerBenchmarkFactory createFromFreemarkerXmlInputStream(InputStream templateIn)
PlannerBenchmarkConfig.createFromFreemarkerXmlInputStream(InputStream)
and create(PlannerBenchmarkConfig)
. Will be removed in 8.0.templateIn
- never null, gets closed@Deprecated public static PlannerBenchmarkFactory createFromFreemarkerXmlInputStream(InputStream templateIn, ClassLoader classLoader)
PlannerBenchmarkConfig.createFromFreemarkerXmlInputStream(InputStream, ClassLoader)
and create(PlannerBenchmarkConfig)
. Will be removed in 8.0.templateIn
- never null, gets closedclassLoader
- sometimes null, the ClassLoader
to use for loading all resources and Class
es,
null to use the default ClassLoader
@Deprecated public static PlannerBenchmarkFactory createFromFreemarkerXmlInputStream(InputStream templateIn, Object model)
PlannerBenchmarkConfig.createFromFreemarkerXmlInputStream(InputStream, Object)
and create(PlannerBenchmarkConfig)
. Will be removed in 8.0.templateIn
- never null, gets closedmodel
- sometimes null@Deprecated public static PlannerBenchmarkFactory createFromFreemarkerXmlInputStream(InputStream templateIn, Object model, ClassLoader classLoader)
PlannerBenchmarkConfig.createFromFreemarkerXmlInputStream(InputStream, Object, ClassLoader)
and create(PlannerBenchmarkConfig)
. Will be removed in 8.0.templateIn
- never null, gets closedmodel
- sometimes nullclassLoader
- sometimes null, the ClassLoader
to use for loading all resources and Class
es,
null to use the default ClassLoader
@Deprecated public static PlannerBenchmarkFactory createFromFreemarkerXmlReader(Reader templateReader)
PlannerBenchmarkConfig.createFromFreemarkerXmlReader(Reader)
and create(PlannerBenchmarkConfig)
. Will be removed in 8.0.templateReader
- never null, gets closed@Deprecated public static PlannerBenchmarkFactory createFromFreemarkerXmlReader(Reader templateReader, ClassLoader classLoader)
PlannerBenchmarkConfig.createFromFreemarkerXmlReader(Reader, ClassLoader)
and create(PlannerBenchmarkConfig)
. Will be removed in 8.0.templateReader
- never null, gets closedclassLoader
- sometimes null, the ClassLoader
to use for loading all resources and Class
es,
null to use the default ClassLoader
@Deprecated public static PlannerBenchmarkFactory createFromFreemarkerXmlReader(Reader templateReader, Object model)
PlannerBenchmarkConfig.createFromFreemarkerXmlReader(Reader, Object)
and create(PlannerBenchmarkConfig)
. Will be removed in 8.0.templateReader
- never null, gets closedmodel
- sometimes null@Deprecated public static PlannerBenchmarkFactory createFromFreemarkerXmlReader(Reader templateReader, Object model, ClassLoader classLoader)
PlannerBenchmarkConfig.createFromFreemarkerXmlReader(Reader, Object, ClassLoader)
and create(PlannerBenchmarkConfig)
. Will be removed in 8.0.templateReader
- never null, gets closedmodel
- sometimes nullclassLoader
- sometimes null, the ClassLoader
to use for loading all resources and Class
es,
null to use the default ClassLoader
public static PlannerBenchmarkFactory create(PlannerBenchmarkConfig benchmarkConfig)
PlannerBenchmarkConfig
to build a PlannerBenchmarkFactory
.
If you don't need to manipulate the PlannerBenchmarkConfig
programmatically,
use createFromXmlResource(String)
instead.benchmarkConfig
- never nullpublic static PlannerBenchmarkFactory createFromKieContainerXmlResource(String benchmarkConfigResource)
PlannerBenchmarkFactory
that uses KieServices.getKieClasspathContainer()
.benchmarkConfigResource
- never null, a classpath resource in the KieContainer
as defined by ClassLoader.getResource(String)
public static PlannerBenchmarkFactory createFromKieContainerXmlResource(org.kie.api.builder.ReleaseId releaseId, String benchmarkConfigResource)
PlannerBenchmarkFactory
that uses a KieModule
represented by its releaseId.releaseId
- never nullbenchmarkConfigResource
- never null, a classpath resource in the KieContainer
as defined by ClassLoader.getResource(String)
public static PlannerBenchmarkFactory createFromKieContainerXmlResource(org.kie.api.runtime.KieContainer kieContainer, String benchmarkConfigResource)
kieContainer
- never nullbenchmarkConfigResource
- never null, a classpath resource in the KieContainer
as defined by ClassLoader.getResource(String)
public abstract PlannerBenchmark buildPlannerBenchmark()
PlannerBenchmark
instance.public <Solution_> PlannerBenchmark buildPlannerBenchmark(List<Solution_> problemList)
PlannerBenchmark
instance for datasets that are already in memory.Solution_
- the solution type, the class with the PlanningSolution
annotationproblemList
- never null, can be emptypublic abstract <Solution_> PlannerBenchmark buildPlannerBenchmark(Solution_... problems)
PlannerBenchmark
instance for datasets that are already in memory.Solution_
- the solution type, the class with the PlanningSolution
annotationproblems
- never null, can be none@Deprecated public abstract PlannerBenchmarkConfig getPlannerBenchmarkConfig()
PlannerBenchmarkConfig()
and create(PlannerBenchmarkConfig)
. Will be removed in 8.0.PlannerBenchmarkFactory
dynamically (without parsing XML each time),
use create(PlannerBenchmarkConfig)
instead.
This method is not thread-safe.
Copyright © 2006–2021 JBoss by Red Hat. All rights reserved.