Package org.optaplanner.benchmark.config
Class PlannerBenchmarkConfig
java.lang.Object
org.optaplanner.benchmark.config.PlannerBenchmarkConfig
To read it from XML, use
createFromXmlResource(String)
.
To build a PlannerBenchmarkFactory
with it, use PlannerBenchmarkFactory.create(PlannerBenchmarkConfig)
.-
Field Summary
-
Constructor Summary
ConstructorDescriptionCreate an empty benchmark config.PlannerBenchmarkConfig
(ClassLoader classLoader) -
Method Summary
Modifier and TypeMethodDescriptionstatic PlannerBenchmarkConfig
createFromFreemarkerXmlFile
(File templateFile) Reads a Freemarker XML benchmark configuration from the file system.static PlannerBenchmarkConfig
createFromFreemarkerXmlFile
(File templateFile, ClassLoader classLoader) As defined bycreateFromFreemarkerXmlFile(File)
.static PlannerBenchmarkConfig
createFromFreemarkerXmlFile
(File templateFile, Object model) As defined bycreateFromFreemarkerXmlFile(File)
.static PlannerBenchmarkConfig
createFromFreemarkerXmlFile
(File templateFile, Object model, ClassLoader classLoader) As defined bycreateFromFreemarkerXmlFile(File)
.static PlannerBenchmarkConfig
createFromFreemarkerXmlInputStream
(InputStream templateIn) static PlannerBenchmarkConfig
createFromFreemarkerXmlInputStream
(InputStream templateIn, ClassLoader classLoader) As defined bycreateFromFreemarkerXmlInputStream(InputStream)
.static PlannerBenchmarkConfig
createFromFreemarkerXmlInputStream
(InputStream templateIn, Object model) As defined bycreateFromFreemarkerXmlInputStream(InputStream)
.static PlannerBenchmarkConfig
createFromFreemarkerXmlInputStream
(InputStream templateIn, Object model, ClassLoader classLoader) As defined bycreateFromFreemarkerXmlInputStream(InputStream)
.static PlannerBenchmarkConfig
createFromFreemarkerXmlReader
(Reader templateReader) static PlannerBenchmarkConfig
createFromFreemarkerXmlReader
(Reader templateReader, ClassLoader classLoader) As defined bycreateFromFreemarkerXmlReader(Reader)
.static PlannerBenchmarkConfig
createFromFreemarkerXmlReader
(Reader templateReader, Object model) As defined bycreateFromFreemarkerXmlReader(Reader)
.static PlannerBenchmarkConfig
createFromFreemarkerXmlReader
(Reader templateReader, Object model, ClassLoader classLoader) As defined bycreateFromFreemarkerXmlReader(Reader)
.static PlannerBenchmarkConfig
createFromFreemarkerXmlResource
(String templateResource) Reads a Freemarker XML benchmark configuration from the classpath.static PlannerBenchmarkConfig
createFromFreemarkerXmlResource
(String templateResource, ClassLoader classLoader) As defined bycreateFromFreemarkerXmlResource(String)
.static PlannerBenchmarkConfig
createFromFreemarkerXmlResource
(String templateResource, Object model) As defined bycreateFromFreemarkerXmlResource(String)
.static PlannerBenchmarkConfig
createFromFreemarkerXmlResource
(String templateResource, Object model, ClassLoader classLoader) As defined bycreateFromFreemarkerXmlResource(String)
.static PlannerBenchmarkConfig
createFromSolverConfig
(SolverConfig solverConfig) static PlannerBenchmarkConfig
createFromSolverConfig
(SolverConfig solverConfig, File benchmarkDirectory) static PlannerBenchmarkConfig
createFromXmlFile
(File benchmarkConfigFile) Reads an XML benchmark configuration from the file system.static PlannerBenchmarkConfig
createFromXmlFile
(File benchmarkConfigFile, ClassLoader classLoader) As defined bycreateFromXmlFile(File)
.static PlannerBenchmarkConfig
static PlannerBenchmarkConfig
createFromXmlInputStream
(InputStream in, ClassLoader classLoader) static PlannerBenchmarkConfig
createFromXmlReader
(Reader reader) static PlannerBenchmarkConfig
createFromXmlReader
(Reader reader, ClassLoader classLoader) static PlannerBenchmarkConfig
createFromXmlResource
(String benchmarkConfigResource) Reads an XML benchmark configuration from the classpath.static PlannerBenchmarkConfig
createFromXmlResource
(String benchmarkConfigResource, ClassLoader classLoader) As defined bycreateFromXmlResource(String)
.getName()
Using multiple parallel benchmarks can decrease the reliability of the results.Class<? extends ThreadFactory>
void
setBenchmarkDirectory
(File benchmarkDirectory) void
setBenchmarkReportConfig
(BenchmarkReportConfig benchmarkReportConfig) void
setClassLoader
(ClassLoader classLoader) void
setInheritedSolverBenchmarkConfig
(SolverBenchmarkConfig inheritedSolverBenchmarkConfig) void
void
setParallelBenchmarkCount
(String parallelBenchmarkCount) void
setSolverBenchmarkBluePrintConfigList
(List<SolverBenchmarkBluePrintConfig> solverBenchmarkBluePrintConfigList) void
setSolverBenchmarkConfigList
(List<SolverBenchmarkConfig> solverBenchmarkConfigList) void
setThreadFactoryClass
(Class<? extends ThreadFactory> threadFactoryClass) void
setWarmUpDaysSpentLimit
(Long warmUpDaysSpentLimit) void
setWarmUpHoursSpentLimit
(Long warmUpHoursSpentLimit) void
setWarmUpMillisecondsSpentLimit
(Long warmUpMillisecondsSpentLimit) void
setWarmUpMinutesSpentLimit
(Long warmUpMinutesSpentLimit) void
setWarmUpSecondsSpentLimit
(Long warmUpSecondsSpentLimit) withBenchmarkDirectory
(File benchmarkDirectory) withBenchmarkReportConfig
(BenchmarkReportConfig benchmarkReportConfig) withClassLoader
(ClassLoader classLoader) withInheritedSolverBenchmarkConfig
(SolverBenchmarkConfig inheritedSolverBenchmarkConfig) withParallelBenchmarkCount
(String parallelBenchmarkCount) withSolverBenchmarkBluePrintConfigList
(List<SolverBenchmarkBluePrintConfig> solverBenchmarkBluePrintConfigList) withSolverBenchmarkBluePrintConfigs
(SolverBenchmarkBluePrintConfig... solverBenchmarkBluePrintConfigs) withSolverBenchmarkConfigList
(List<SolverBenchmarkConfig> solverBenchmarkConfigList) withSolverBenchmarkConfigs
(SolverBenchmarkConfig... solverBenchmarkConfigs) withThreadFactoryClass
(Class<? extends ThreadFactory> threadFactoryClass) withWarmUpDaysSpentLimit
(Long warmUpDaysSpentLimit) withWarmUpHoursSpentLimit
(Long warmUpHoursSpentLimit) withWarmUpMillisecondsSpentLimit
(Long warmUpMillisecondsSpentLimit) withWarmUpMinutesSpentLimit
(Long warmUpMinutesSpentLimit) withWarmUpSecondsSpentLimit
(Long warmUpSecondsSpentLimit)
-
Field Details
-
SOLVER_NAMESPACE_PREFIX
- See Also:
-
XML_ELEMENT_NAME
- See Also:
-
XML_NAMESPACE
- See Also:
-
PARALLEL_BENCHMARK_COUNT_AUTO
- See Also:
-
-
Constructor Details
-
PlannerBenchmarkConfig
public PlannerBenchmarkConfig()Create an empty benchmark config. -
PlannerBenchmarkConfig
- Parameters:
classLoader
- sometimes null
-
-
Method Details
-
createFromSolverConfig
- Parameters:
solverConfig
- never null
-
createFromSolverConfig
public static PlannerBenchmarkConfig createFromSolverConfig(SolverConfig solverConfig, File benchmarkDirectory) - Parameters:
solverConfig
- never nullbenchmarkDirectory
- never null
-
createFromXmlResource
Reads an XML benchmark configuration from the classpath.- Parameters:
benchmarkConfigResource
- never null, a classpath resource as defined byClassLoader.getResource(String)
- Returns:
- never null
-
createFromXmlResource
public static PlannerBenchmarkConfig createFromXmlResource(String benchmarkConfigResource, ClassLoader classLoader) As defined bycreateFromXmlResource(String)
.- Parameters:
benchmarkConfigResource
- never null, a classpath resource as defined byClassLoader.getResource(String)
classLoader
- sometimes null, theClassLoader
to use for loading all resources andClass
es, null to use the defaultClassLoader
- Returns:
- never null
-
createFromXmlFile
Reads an XML benchmark configuration from the file system.Warning: this leads to platform dependent code, it's recommend to use
createFromXmlResource(String)
instead.- Parameters:
benchmarkConfigFile
- never null- Returns:
- never null
-
createFromXmlFile
public static PlannerBenchmarkConfig createFromXmlFile(File benchmarkConfigFile, ClassLoader classLoader) As defined bycreateFromXmlFile(File)
.- Parameters:
benchmarkConfigFile
- never nullclassLoader
- sometimes null, theClassLoader
to use for loading all resources andClass
es, null to use the defaultClassLoader
- Returns:
- never null
-
createFromXmlInputStream
- Parameters:
in
- never null, gets closed- Returns:
- never null
-
createFromXmlInputStream
public static PlannerBenchmarkConfig createFromXmlInputStream(InputStream in, ClassLoader classLoader) - Parameters:
in
- never null, gets closedclassLoader
- sometimes null, theClassLoader
to use for loading all resources andClass
es, null to use the defaultClassLoader
- Returns:
- never null
-
createFromXmlReader
- Parameters:
reader
- never null, gets closed- Returns:
- never null
-
createFromXmlReader
- Parameters:
reader
- never null, gets closedclassLoader
- sometimes null, theClassLoader
to use for loading all resources andClass
es, null to use the defaultClassLoader
- Returns:
- never null
-
createFromFreemarkerXmlResource
Reads a Freemarker XML benchmark configuration from the classpath.- Parameters:
templateResource
- never null, a classpath resource as defined byClassLoader.getResource(String)
- Returns:
- never null
-
createFromFreemarkerXmlResource
public static PlannerBenchmarkConfig createFromFreemarkerXmlResource(String templateResource, ClassLoader classLoader) As defined bycreateFromFreemarkerXmlResource(String)
.- Parameters:
templateResource
- never null, a classpath resource as defined byClassLoader.getResource(String)
classLoader
- sometimes null, theClassLoader
to use for loading all resources andClass
es, null to use the defaultClassLoader
- Returns:
- never null
-
createFromFreemarkerXmlResource
public static PlannerBenchmarkConfig createFromFreemarkerXmlResource(String templateResource, Object model) As defined bycreateFromFreemarkerXmlResource(String)
.- Parameters:
templateResource
- never null, a classpath resource as defined byClassLoader.getResource(String)
model
- sometimes null- Returns:
- never null
-
createFromFreemarkerXmlResource
public static PlannerBenchmarkConfig createFromFreemarkerXmlResource(String templateResource, Object model, ClassLoader classLoader) As defined bycreateFromFreemarkerXmlResource(String)
.- Parameters:
templateResource
- never null, a classpath resource as defined byClassLoader.getResource(String)
model
- sometimes nullclassLoader
- sometimes null, theClassLoader
to use for loading all resources andClass
es, null to use the defaultClassLoader
- Returns:
- never null
-
createFromFreemarkerXmlFile
Reads a Freemarker XML benchmark configuration from the file system.Warning: this leads to platform dependent code, it's recommend to use
createFromFreemarkerXmlResource(String)
instead.- Parameters:
templateFile
- never null- Returns:
- never null
-
createFromFreemarkerXmlFile
public static PlannerBenchmarkConfig createFromFreemarkerXmlFile(File templateFile, ClassLoader classLoader) As defined bycreateFromFreemarkerXmlFile(File)
.- Parameters:
templateFile
- never nullclassLoader
- sometimes null, theClassLoader
to use for loading all resources andClass
es, null to use the defaultClassLoader
- Returns:
- never null
-
createFromFreemarkerXmlFile
As defined bycreateFromFreemarkerXmlFile(File)
.- Parameters:
templateFile
- never nullmodel
- sometimes null- Returns:
- never null
-
createFromFreemarkerXmlFile
public static PlannerBenchmarkConfig createFromFreemarkerXmlFile(File templateFile, Object model, ClassLoader classLoader) As defined bycreateFromFreemarkerXmlFile(File)
.- Parameters:
templateFile
- never nullmodel
- sometimes nullclassLoader
- sometimes null, theClassLoader
to use for loading all resources andClass
es, null to use the defaultClassLoader
- Returns:
- never null
-
createFromFreemarkerXmlInputStream
- Parameters:
templateIn
- never null, gets closed- Returns:
- never null
-
createFromFreemarkerXmlInputStream
public static PlannerBenchmarkConfig createFromFreemarkerXmlInputStream(InputStream templateIn, ClassLoader classLoader) As defined bycreateFromFreemarkerXmlInputStream(InputStream)
.- Parameters:
templateIn
- never null, gets closedclassLoader
- sometimes null, theClassLoader
to use for loading all resources andClass
es, null to use the defaultClassLoader
- Returns:
- never null
-
createFromFreemarkerXmlInputStream
public static PlannerBenchmarkConfig createFromFreemarkerXmlInputStream(InputStream templateIn, Object model) As defined bycreateFromFreemarkerXmlInputStream(InputStream)
.- Parameters:
templateIn
- never null, gets closedmodel
- sometimes null- Returns:
- never null
-
createFromFreemarkerXmlInputStream
public static PlannerBenchmarkConfig createFromFreemarkerXmlInputStream(InputStream templateIn, Object model, ClassLoader classLoader) As defined bycreateFromFreemarkerXmlInputStream(InputStream)
.- Parameters:
templateIn
- never null, gets closedmodel
- sometimes nullclassLoader
- sometimes null, theClassLoader
to use for loading all resources andClass
es, null to use the defaultClassLoader
- Returns:
- never null
-
createFromFreemarkerXmlReader
- Parameters:
templateReader
- never null, gets closed- Returns:
- never null
-
createFromFreemarkerXmlReader
public static PlannerBenchmarkConfig createFromFreemarkerXmlReader(Reader templateReader, ClassLoader classLoader) As defined bycreateFromFreemarkerXmlReader(Reader)
.- Parameters:
templateReader
- never null, gets closedclassLoader
- sometimes null, theClassLoader
to use for loading all resources andClass
es, null to use the defaultClassLoader
- Returns:
- never null
-
createFromFreemarkerXmlReader
public static PlannerBenchmarkConfig createFromFreemarkerXmlReader(Reader templateReader, Object model) As defined bycreateFromFreemarkerXmlReader(Reader)
.- Parameters:
templateReader
- never null, gets closedmodel
- sometimes null- Returns:
- never null
-
createFromFreemarkerXmlReader
public static PlannerBenchmarkConfig createFromFreemarkerXmlReader(Reader templateReader, Object model, ClassLoader classLoader) As defined bycreateFromFreemarkerXmlReader(Reader)
.- Parameters:
templateReader
- never null, gets closedmodel
- sometimes nullclassLoader
- sometimes null, theClassLoader
to use for loading all resources andClass
es, null to use the defaultClassLoader
- Returns:
- never null
-
getClassLoader
-
setClassLoader
-
getName
-
setName
-
getBenchmarkDirectory
-
setBenchmarkDirectory
-
getThreadFactoryClass
-
setThreadFactoryClass
-
getParallelBenchmarkCount
Using multiple parallel benchmarks can decrease the reliability of the results.If there aren't enough processors available, it will be decreased.
- Returns:
- null, a number or "AUTO".
-
setParallelBenchmarkCount
-
getWarmUpMillisecondsSpentLimit
-
setWarmUpMillisecondsSpentLimit
-
getWarmUpSecondsSpentLimit
-
setWarmUpSecondsSpentLimit
-
getWarmUpMinutesSpentLimit
-
setWarmUpMinutesSpentLimit
-
getWarmUpHoursSpentLimit
-
setWarmUpHoursSpentLimit
-
getWarmUpDaysSpentLimit
-
setWarmUpDaysSpentLimit
-
getBenchmarkReportConfig
-
setBenchmarkReportConfig
-
getInheritedSolverBenchmarkConfig
-
setInheritedSolverBenchmarkConfig
-
getSolverBenchmarkBluePrintConfigList
-
setSolverBenchmarkBluePrintConfigList
public void setSolverBenchmarkBluePrintConfigList(List<SolverBenchmarkBluePrintConfig> solverBenchmarkBluePrintConfigList) -
getSolverBenchmarkConfigList
-
setSolverBenchmarkConfigList
-
withClassLoader
-
withName
-
withBenchmarkDirectory
-
withThreadFactoryClass
public PlannerBenchmarkConfig withThreadFactoryClass(Class<? extends ThreadFactory> threadFactoryClass) -
withParallelBenchmarkCount
-
withWarmUpMillisecondsSpentLimit
-
withWarmUpSecondsSpentLimit
-
withWarmUpMinutesSpentLimit
-
withWarmUpHoursSpentLimit
-
withWarmUpDaysSpentLimit
-
withBenchmarkReportConfig
public PlannerBenchmarkConfig withBenchmarkReportConfig(BenchmarkReportConfig benchmarkReportConfig) -
withInheritedSolverBenchmarkConfig
public PlannerBenchmarkConfig withInheritedSolverBenchmarkConfig(SolverBenchmarkConfig inheritedSolverBenchmarkConfig) -
withSolverBenchmarkBluePrintConfigList
public PlannerBenchmarkConfig withSolverBenchmarkBluePrintConfigList(List<SolverBenchmarkBluePrintConfig> solverBenchmarkBluePrintConfigList) -
withSolverBenchmarkBluePrintConfigs
public PlannerBenchmarkConfig withSolverBenchmarkBluePrintConfigs(SolverBenchmarkBluePrintConfig... solverBenchmarkBluePrintConfigs) -
withSolverBenchmarkConfigList
public PlannerBenchmarkConfig withSolverBenchmarkConfigList(List<SolverBenchmarkConfig> solverBenchmarkConfigList) -
withSolverBenchmarkConfigs
public PlannerBenchmarkConfig withSolverBenchmarkConfigs(SolverBenchmarkConfig... solverBenchmarkConfigs)
-