public class PartitionedSearchPhaseConfig extends PhaseConfig<PartitionedSearchPhaseConfig>
Modifier and Type | Field and Description |
---|---|
static String |
ACTIVE_THREAD_COUNT_AUTO |
static String |
ACTIVE_THREAD_COUNT_UNLIMITED |
protected List<PhaseConfig> |
phaseConfigList |
protected String |
runnablePartThreadLimit |
protected Class<? extends SolutionPartitioner<?>> |
solutionPartitionerClass |
protected Map<String,String> |
solutionPartitionerCustomProperties |
protected Class<? extends ThreadFactory> |
threadFactoryClass
Deprecated.
Use
SolverConfig.threadFactoryClass instead. |
Constructor and Description |
---|
PartitionedSearchPhaseConfig() |
buildPhaseTermination, getTerminationConfig, setTerminationConfig, toString
copyConfig, deduceEntityDescriptor, deduceVariableDescriptor, deduceVariableDescriptorList, newInstance
public static final String ACTIVE_THREAD_COUNT_AUTO
public static final String ACTIVE_THREAD_COUNT_UNLIMITED
protected Class<? extends SolutionPartitioner<?>> solutionPartitionerClass
@XStreamConverter(value=KeyAsElementMapConverter.class) protected Map<String,String> solutionPartitionerCustomProperties
@Deprecated protected Class<? extends ThreadFactory> threadFactoryClass
SolverConfig.threadFactoryClass
instead.protected String runnablePartThreadLimit
protected List<PhaseConfig> phaseConfigList
public Class<? extends SolutionPartitioner<?>> getSolutionPartitionerClass()
public void setSolutionPartitionerClass(Class<? extends SolutionPartitioner<?>> solutionPartitionerClass)
public Map<String,String> getSolutionPartitionerCustomProperties()
public void setSolutionPartitionerCustomProperties(Map<String,String> solutionPartitionerCustomProperties)
@Deprecated public Class<? extends ThreadFactory> getThreadFactoryClass()
SolverConfig.getThreadFactoryClass()
instead@Deprecated public void setThreadFactoryClass(Class<? extends ThreadFactory> threadFactoryClass)
SolverConfig.setThreadFactoryClass(java.lang.Class<? extends java.util.concurrent.ThreadFactory>)
instead.public String getRunnablePartThreadLimit()
Thread
s,
it limits the number of runnable
Thread
s to avoid consuming all
CPU resources (which would starve UI, Servlets and REST threads).
The number of Thread
s is always equal to the number of partitions returned by
SolutionPartitioner.splitWorkingSolution(ScoreDirector, Integer)
,
because otherwise some partitions would never run (especially with asynchronous termination
).
If this limit (or Runtime.availableProcessors()
) is lower than the number of partitions,
this results in a slower score calculation speed per partition Solver
.
Defaults to "AUTO" which consumes the majority
but not all of the CPU cores on multi-core machines, to prevent a livelock that hangs other processes
(such as your IDE, REST servlets threads or SSH connections) on the machine.
Use "UNLIMITED" to give it all CPU cores.
This is useful if you're handling the CPU consumption on an OS level.public void setRunnablePartThreadLimit(String runnablePartThreadLimit)
public List<PhaseConfig> getPhaseConfigList()
public void setPhaseConfigList(List<PhaseConfig> phaseConfigList)
public PartitionedSearchPhase buildPhase(int phaseIndex, HeuristicConfigPolicy solverConfigPolicy, BestSolutionRecaller bestSolutionRecaller, Termination solverTermination)
buildPhase
in class PhaseConfig<PartitionedSearchPhaseConfig>
public void inherit(PartitionedSearchPhaseConfig inheritedConfig)
AbstractConfig
inheritedConfig
unless that property (or a semantic alternative)
is defined by this instance (which overwrites the inherited behaviour).
After the inheritance, if a property on this AbstractConfig
composition is replaced,
it should not affect the inherited composition instance.
inherit
in class PhaseConfig<PartitionedSearchPhaseConfig>
inheritedConfig
- never nullCopyright © 2006–2019 JBoss by Red Hat. All rights reserved.