Package org.optaplanner.core.config.partitionedsearch

## Class PartitionedSearchPhaseConfig

- java.lang.Object
- - org.optaplanner.core.config.AbstractConfig<C>
  - - org.optaplanner.core.config.phase.PhaseConfig<PartitionedSearchPhaseConfig>
    - - org.optaplanner.core.config.partitionedsearch.PartitionedSearchPhaseConfig

-     public class PartitionedSearchPhaseConfig
      extends PhaseConfig<PartitionedSearchPhaseConfig>

- - ### Field Summary

    Fields
    Modifier and Type | Field | 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 Summary

    Constructors
    Constructor | Description
    --- | ---
    `PartitionedSearchPhaseConfig()` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `PartitionedSearchPhase` | `buildPhase​(int phaseIndex, HeuristicConfigPolicy solverConfigPolicy, BestSolutionRecaller bestSolutionRecaller, Termination solverTermination)` |
    `PartitionedSearchPhaseConfig` | `copyConfig()` | Typically implemented by constructing a new instance and calling `AbstractConfig.inherit(AbstractConfig)` on it
    `List<PhaseConfig>` | `getPhaseConfigList()` |
    `String` | `getRunnablePartThreadLimit()` | Similar to a thread pool size, but instead of limiting the number of `Thread`s, it limits the number of `runnable` `Thread`s to avoid consuming all CPU resources (which would starve UI, Servlets and REST threads).
    `Class<? extends SolutionPartitioner<?>>` | `getSolutionPartitionerClass()` |
    `Map<String,​String>` | `getSolutionPartitionerCustomProperties()` |
    `Class<? extends ThreadFactory>` | `getThreadFactoryClass()` | Deprecated. Use `SolverConfig.getThreadFactoryClass()` instead
    `PartitionedSearchPhaseConfig` | `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<? extends SolutionPartitioner<?>> solutionPartitionerClass)` |
    `void` | `setSolutionPartitionerCustomProperties​(Map<String,​String> solutionPartitionerCustomProperties)` |
    `void` | `setThreadFactoryClass​(Class<? extends ThreadFactory> threadFactoryClass)` | Deprecated. Use `SolverConfig.setThreadFactoryClass(java.lang.Class<? extends java.util.concurrent.ThreadFactory>)` instead.

    - ### Methods inherited from class org.optaplanner.core.config.phase.PhaseConfig

      `buildPhaseTermination, getTerminationConfig, setTerminationConfig, toString`

    - ### Methods inherited from class org.optaplanner.core.config.AbstractConfig

      `deduceEntityDescriptor, deduceVariableDescriptor, deduceVariableDescriptorList`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### ACTIVE_THREAD_COUNT_AUTO

          public static final String ACTIVE_THREAD_COUNT_AUTO

      See Also:
        Constant Field Values

    - #### ACTIVE_THREAD_COUNT_UNLIMITED

          public static final String ACTIVE_THREAD_COUNT_UNLIMITED

      See Also:
        Constant Field Values

    - #### solutionPartitionerClass

          protected Class<? extends SolutionPartitioner<?>> solutionPartitionerClass

    - #### solutionPartitionerCustomProperties

          @XStreamConverter(KeyAsElementMapConverter.class)
          protected Map<String,​String> solutionPartitionerCustomProperties

    - #### threadFactoryClass

          @Deprecated
          protected Class<? extends ThreadFactory> threadFactoryClass

      Deprecated.
      Use `SolverConfig.threadFactoryClass` instead.

    - #### runnablePartThreadLimit

          protected String runnablePartThreadLimit

    - #### phaseConfigList

          protected List<PhaseConfig> phaseConfigList

  - ### Constructor Detail

    - #### PartitionedSearchPhaseConfig

          public PartitionedSearchPhaseConfig()

  - ### Method Detail

    - #### getSolutionPartitionerClass

          public Class<? extends SolutionPartitioner<?>> getSolutionPartitionerClass()

    - #### setSolutionPartitionerClass

          public void setSolutionPartitionerClass​(Class<? extends SolutionPartitioner<?>> solutionPartitionerClass)

    - #### getSolutionPartitionerCustomProperties

          public Map<String,​String> getSolutionPartitionerCustomProperties()

    - #### setSolutionPartitionerCustomProperties

          public void setSolutionPartitionerCustomProperties​(Map<String,​String> solutionPartitionerCustomProperties)

    - #### getThreadFactoryClass

          @Deprecated
          public Class<? extends ThreadFactory> getThreadFactoryClass()

      Deprecated.
      Use `SolverConfig.getThreadFactoryClass()` instead

    - #### setThreadFactoryClass

          @Deprecated
          public void setThreadFactoryClass​(Class<? extends ThreadFactory> threadFactoryClass)

      Deprecated.
      Use `SolverConfig.setThreadFactoryClass(java.lang.Class<? extends java.util.concurrent.ThreadFactory>)` instead.

    - #### getRunnablePartThreadLimit

          public String getRunnablePartThreadLimit()

      Similar to a thread pool size, but instead of limiting the number of `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.
      Returns:
        null, a number, "AUTO", "UNLIMITED" or a JavaScript calculation using "availableProcessorCount".

    - #### setRunnablePartThreadLimit

          public void setRunnablePartThreadLimit​(String runnablePartThreadLimit)

    - #### getPhaseConfigList

          public List<PhaseConfig> getPhaseConfigList()

    - #### setPhaseConfigList

          public void setPhaseConfigList​(List<PhaseConfig> phaseConfigList)

    - #### buildPhase

          public PartitionedSearchPhase buildPhase​(int phaseIndex,
                                                   HeuristicConfigPolicy solverConfigPolicy,
                                                   BestSolutionRecaller bestSolutionRecaller,
                                                   Termination solverTermination)

      Specified by:
        `buildPhase` in class `PhaseConfig<PartitionedSearchPhaseConfig>`

    - #### inherit

          public PartitionedSearchPhaseConfig inherit​(PartitionedSearchPhaseConfig inheritedConfig)

      Description copied from class: `AbstractConfig`
      Inherits each property of the `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.

      Overrides:
        `inherit` in class `PhaseConfig<PartitionedSearchPhaseConfig>`
      Parameters:
        `inheritedConfig` - never null
      Returns:
        this

    - #### copyConfig

          public PartitionedSearchPhaseConfig copyConfig()

      Description copied from class: `AbstractConfig`
      Typically implemented by constructing a new instance and calling `AbstractConfig.inherit(AbstractConfig)` on it
      Specified by:
        `copyConfig` in class `AbstractConfig<PartitionedSearchPhaseConfig>`
      Returns:
        new instance