Class PartitionedSearchPhaseConfig
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringprotected List<PhaseConfig>protected Stringprotected Class<? extends SolutionPartitioner<?>>static final StringFields inherited from class ai.timefold.solver.core.config.phase.PhaseConfig
terminationConfig -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@NonNull PartitionedSearchPhaseConfigTypically implemented by constructing a new instance and callingAbstractConfig.inherit(AbstractConfig)on it.@Nullable List<@NonNull PhaseConfig>@Nullable String@Nullable Class<? extends SolutionPartitioner<?>>@NonNull PartitionedSearchPhaseConfiginherit(@NonNull PartitionedSearchPhaseConfig inheritedConfig) Inherits each property of theinheritedConfigunless that property (or a semantic alternative) is defined by this instance (which overwrites the inherited behaviour).voidsetPhaseConfigList(@Nullable List<@NonNull PhaseConfig> phaseConfigList) voidsetRunnablePartThreadLimit(@Nullable String runnablePartThreadLimit) voidsetSolutionPartitionerClass(@Nullable Class<? extends SolutionPartitioner<?>> solutionPartitionerClass) voidsetSolutionPartitionerCustomProperties(@Nullable Map<String, String> solutionPartitionerCustomProperties) voidvisitReferencedClasses(@NonNull Consumer<Class<?>> classVisitor) Call the class visitor on each (possibly null) Class instance provided to this config by the user (including those provided in child configs).@NonNull PartitionedSearchPhaseConfigwithPhaseConfigList(@NonNull List<@NonNull PhaseConfig> phaseConfigList) @NonNull PartitionedSearchPhaseConfigwithPhaseConfigs(@NonNull PhaseConfig @NonNull ... phaseConfigs) @NonNull PartitionedSearchPhaseConfigwithRunnablePartThreadLimit(@NonNull String runnablePartThreadLimit) @NonNull PartitionedSearchPhaseConfigwithSolutionPartitionerClass(@NonNull Class<? extends SolutionPartitioner<?>> solutionPartitionerClass) @NonNull PartitionedSearchPhaseConfigwithSolutionPartitionerCustomProperties(@NonNull Map<String, String> solutionPartitionerCustomProperties) Methods inherited from class ai.timefold.solver.core.config.phase.PhaseConfig
getTerminationConfig, setTerminationConfig, toString, withTerminationConfig
-
Field Details
-
XML_ELEMENT_NAME
- See Also:
-
ACTIVE_THREAD_COUNT_AUTO
- See Also:
-
ACTIVE_THREAD_COUNT_UNLIMITED
- See Also:
-
solutionPartitionerClass
-
solutionPartitionerCustomProperties
-
runnablePartThreadLimit
-
phaseConfigList
-
-
Constructor Details
-
PartitionedSearchPhaseConfig
public PartitionedSearchPhaseConfig()
-
-
Method Details
-
getSolutionPartitionerClass
-
setSolutionPartitionerClass
public void setSolutionPartitionerClass(@Nullable Class<? extends SolutionPartitioner<?>> solutionPartitionerClass) -
getSolutionPartitionerCustomProperties
-
setSolutionPartitionerCustomProperties
-
getRunnablePartThreadLimit
Similar to a thread pool size, but instead of limiting the number ofThreads, it limits the number ofrunnableThreads to avoid consuming all CPU resources (which would starve UI, Servlets and REST threads).The number of
Threads is always equal to the number of partitions returned bySolutionPartitioner.splitWorkingSolution(ScoreDirector, Integer), because otherwise some partitions would never run (especially withasynchronous termination). If this limit (orRuntime.availableProcessors()) is lower than the number of partitions, this results in a slower score calculation speed per partitionSolver.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.
- Returns:
- null, a number, "AUTO" or "UNLIMITED".
-
setRunnablePartThreadLimit
-
getPhaseConfigList
-
setPhaseConfigList
-
withSolutionPartitionerClass
public @NonNull PartitionedSearchPhaseConfig withSolutionPartitionerClass(@NonNull Class<? extends SolutionPartitioner<?>> solutionPartitionerClass) -
withSolutionPartitionerCustomProperties
public @NonNull PartitionedSearchPhaseConfig withSolutionPartitionerCustomProperties(@NonNull Map<String, String> solutionPartitionerCustomProperties) -
withRunnablePartThreadLimit
public @NonNull PartitionedSearchPhaseConfig withRunnablePartThreadLimit(@NonNull String runnablePartThreadLimit) -
withPhaseConfigList
public @NonNull PartitionedSearchPhaseConfig withPhaseConfigList(@NonNull List<@NonNull PhaseConfig> phaseConfigList) -
withPhaseConfigs
public @NonNull PartitionedSearchPhaseConfig withPhaseConfigs(@NonNull PhaseConfig @NonNull ... phaseConfigs) -
inherit
public @NonNull PartitionedSearchPhaseConfig inherit(@NonNull PartitionedSearchPhaseConfig inheritedConfig) Description copied from class:AbstractConfigInherits each property of theinheritedConfigunless that property (or a semantic alternative) is defined by this instance (which overwrites the inherited behaviour).After the inheritance, if a property on this
AbstractConfigcomposition is replaced, it should not affect the inherited composition instance.- Overrides:
inheritin classPhaseConfig<PartitionedSearchPhaseConfig>- Returns:
- this
-
copyConfig
Description copied from class:AbstractConfigTypically implemented by constructing a new instance and callingAbstractConfig.inherit(AbstractConfig)on it.- Specified by:
copyConfigin classAbstractConfig<PartitionedSearchPhaseConfig>- Returns:
- new instance
-
visitReferencedClasses
Description copied from class:AbstractConfigCall the class visitor on each (possibly null) Class instance provided to this config by the user (including those provided in child configs). Required to create the bean factory in Quarkus.- Specified by:
visitReferencedClassesin classAbstractConfig<PartitionedSearchPhaseConfig>- Parameters:
classVisitor- The visitor of classes. Can accept null instances of Class.
-