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 ThreadFactory> |
threadFactoryClass |
Constructor and Description |
---|
PartitionedSearchPhaseConfig() |
Modifier and Type | Method and Description |
---|---|
PartitionedSearchPhase |
buildPhase(int phaseIndex,
HeuristicConfigPolicy solverConfigPolicy,
BestSolutionRecaller bestSolutionRecaller,
Termination solverTermination) |
List<PhaseConfig> |
getPhaseConfigList() |
String |
getRunnablePartThreadLimit()
|
Class<SolutionPartitioner> |
getSolutionPartitionerClass() |
Class<? extends ThreadFactory> |
getThreadFactoryClass() |
void |
inherit(PartitionedSearchPhaseConfig inheritedConfig)
Inherits each property of the
inheritedConfig unless that property (or a semantic alternative)
is defined by this instance (which overwrites the inherited behaviour). |
void |
setPhaseConfigList(List<PhaseConfig> phaseConfigList) |
void |
setRunnablePartThreadLimit(String runnablePartThreadLimit) |
void |
setSolutionPartitionerClass(Class<SolutionPartitioner> solutionPartitionerClass) |
void |
setThreadFactoryClass(Class<? extends ThreadFactory> threadFactoryClass) |
buildPhaseTermination, getTerminationConfig, setTerminationConfig, toString
deduceEntityDescriptor, deduceVariableDescriptor, deduceVariableDescriptorList, newInstance
public static final String ACTIVE_THREAD_COUNT_AUTO
public static final String ACTIVE_THREAD_COUNT_UNLIMITED
protected Class<? extends ThreadFactory> threadFactoryClass
protected String runnablePartThreadLimit
protected List<PhaseConfig> phaseConfigList
public Class<? extends ThreadFactory> getThreadFactoryClass()
public void setThreadFactoryClass(Class<? extends ThreadFactory> threadFactoryClass)
public String getRunnablePartThreadLimit()
Thread
s,
it limits the number of Thread.State#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)
,
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 {@link Solver}.
Defaults to {@value #ACTIVE_THREAD_COUNT_AUTO} which consumes the majority
but not all of the CPU cores on multi-core machines, preventing other processes (including your IDE or SSH connection)
on the machine from hanging.
Use {@value #ACTIVE_THREAD_COUNT_UNLIMITED} to give it all CPU cores.
This is usefull if you're handling the CPU consumption on an OS level.public void setRunnablePartThreadLimit(String runnablePartThreadLimit)
public Class<SolutionPartitioner> getSolutionPartitionerClass()
public void setSolutionPartitionerClass(Class<SolutionPartitioner> solutionPartitionerClass)
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–2016 JBoss by Red Hat. All rights reserved.