Package net.bmahe.genetics4j.gpu.spec
Class ImmutableGPUEAExecutionContext<T extends Comparable<T>>
java.lang.Object
net.bmahe.genetics4j.core.spec.AbstractEAExecutionContext<T>
net.bmahe.genetics4j.gpu.spec.GPUEAExecutionContext<T>
net.bmahe.genetics4j.gpu.spec.ImmutableGPUEAExecutionContext<T>
@Generated(from="GPUEAExecutionContext",
generator="Immutables")
@Generated("org.immutables.processor.ProxyProcessor")
public final class ImmutableGPUEAExecutionContext<T extends Comparable<T>>
extends GPUEAExecutionContext<T>
Immutable implementation of
GPUEAExecutionContext.
Use the builder to create immutable instances:
ImmutableGPUEAExecutionContext.builder().
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classImmutableGPUEAExecutionContext.Builder<T extends Comparable<T>>Builds instances of typeGPUEAExecutionContext.private final class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List<ChromosomeCombinatorHandlerFactory<T>> private final List<ChromosomeCombinatorHandler<T>> private final ChromosomeFactoryProviderprivate final List<ChromosomeMutationHandlerFactory<T>> private final List<ChromosomeMutationHandler<? extends Chromosome>> private final List<ChromosomeCombinatorHandler<T>> private final List<ChromosomeMutationHandler<? extends Chromosome>> private final List<MutationPolicyHandler<T>> private final List<ReplacementStrategyHandler<T>> private final List<SelectionPolicyHandler<T>> private final List<EvolutionListener<T>> private ImmutableGPUEAExecutionContext<T>.InitShimprivate final List<MutationPolicyHandlerFactory<T>> private final List<MutationPolicyHandler<T>> private final intprivate final RandomGeneratorprivate final List<ReplacementStrategyHandlerFactory<T>> private final List<ReplacementStrategyHandler<T>> private final List<SelectionPolicyHandlerFactory<T>> private final List<SelectionPolicyHandler<T>> private static final byteprivate static final byteprivate static final byteFields inherited from class net.bmahe.genetics4j.core.spec.AbstractEAExecutionContext
DEFAULT_POPULATION_SIZE -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateImmutableGPUEAExecutionContext(List<ChromosomeCombinatorHandler<T>> defaultChromosomeCombinatorHandlers, List<ChromosomeCombinatorHandlerFactory<T>> chromosomeCombinatorHandlerFactories, List<SelectionPolicyHandler<T>> defaultSelectionPolicyHandlers, List<SelectionPolicyHandlerFactory<T>> selectionPolicyHandlerFactories, List<MutationPolicyHandler<T>> defaultMutationPolicyHandlers, List<MutationPolicyHandlerFactory<T>> mutationPolicyHandlerFactories, List<ChromosomeMutationHandler<? extends Chromosome>> defaultChromosomeMutationPolicyHandlers, List<ChromosomeMutationHandlerFactory<T>> chromosomeMutationPolicyHandlerFactories, List<ReplacementStrategyHandler<T>> defaultReplacementStrategyHandlers, List<ReplacementStrategyHandlerFactory<T>> replacementStrategyHandlerFactories, RandomGenerator randomGenerator, int populationSize, ChromosomeFactoryProvider chromosomeFactoryProvider, List<EvolutionListener<T>> evolutionListeners, Predicate<Platform> platformFilters, Predicate<Device> deviceFilters) private -
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends Comparable<T>>
ImmutableGPUEAExecutionContext.Builder<T> builder()Creates a builder forGPUEAExecutionContext.List<ChromosomeMutationHandler<? extends Chromosome>> static <T extends Comparable<T>>
GPUEAExecutionContext<T> copyOf(GPUEAExecutionContext<T> instance) Creates an immutable copy of aGPUEAExecutionContextvalue.private static <T> List<T> createSafeList(Iterable<? extends T> iterable, boolean checkNulls, boolean skipNulls) private static <T> List<T> createUnmodifiableList(boolean clone, List<? extends T> list) List<ChromosomeMutationHandler<? extends Chromosome>> Default list of ChromosomeMutationPolicyHandlerDefault list for MutationPolicyHandlerDefault list of ReplacementStrategyHandlerDefault list of SelectionPolicyHandlerReturns the predicate used to filter OpenCL devices during device discovery.booleanThis instance is equal to all instances ofImmutableGPUEAExecutionContextthat have equal attribute values.private booleanequalsByValue(ImmutableGPUEAExecutionContext<?> another) inthashCode()Computes a hash code from attributes:defaultChromosomeCombinatorHandlers,chromosomeCombinatorHandlerFactories,chromosomeCombinatorHandlers,defaultSelectionPolicyHandlers,selectionPolicyHandlerFactories,selectionPolicyHandlers,defaultMutationPolicyHandlers,mutationPolicyHandlerFactories,mutationPolicyHandlers,defaultChromosomeMutationPolicyHandlers,chromosomeMutationPolicyHandlerFactories,chromosomeMutationPolicyHandlers,defaultReplacementStrategyHandlers,replacementStrategyHandlerFactories,replacementStrategyHandlers,randomGenerator,populationSize,chromosomeFactoryProvider,evolutionListeners,platformFilters,deviceFilters.Returns the predicate used to filter OpenCL platforms during device discovery.intDefault Random GeneratortoString()Prints the immutable valueGPUEAExecutionContextwith attribute values.final ImmutableGPUEAExecutionContext<T> withChromosomeCombinatorHandlerFactories(Iterable<? extends ChromosomeCombinatorHandlerFactory<T>> elements) Copy the current immutable object with elements that replace the content ofchromosomeCombinatorHandlerFactories.final ImmutableGPUEAExecutionContext<T> Copy the current immutable object with elements that replace the content ofchromosomeCombinatorHandlerFactories.final ImmutableGPUEAExecutionContext<T> Copy the current immutable object by setting a value for thechromosomeFactoryProviderattribute.final ImmutableGPUEAExecutionContext<T> withChromosomeMutationPolicyHandlerFactories(Iterable<? extends ChromosomeMutationHandlerFactory<T>> elements) Copy the current immutable object with elements that replace the content ofchromosomeMutationPolicyHandlerFactories.final ImmutableGPUEAExecutionContext<T> Copy the current immutable object with elements that replace the content ofchromosomeMutationPolicyHandlerFactories.final ImmutableGPUEAExecutionContext<T> withDefaultChromosomeCombinatorHandlers(Iterable<? extends ChromosomeCombinatorHandler<T>> elements) Copy the current immutable object with elements that replace the content ofdefaultChromosomeCombinatorHandlers.final ImmutableGPUEAExecutionContext<T> Copy the current immutable object with elements that replace the content ofdefaultChromosomeCombinatorHandlers.final ImmutableGPUEAExecutionContext<T> withDefaultChromosomeMutationPolicyHandlers(Iterable<? extends ChromosomeMutationHandler<? extends Chromosome>> elements) Copy the current immutable object with elements that replace the content ofdefaultChromosomeMutationPolicyHandlers.final ImmutableGPUEAExecutionContext<T> withDefaultChromosomeMutationPolicyHandlers(ChromosomeMutationHandler<? extends Chromosome>... elements) Copy the current immutable object with elements that replace the content ofdefaultChromosomeMutationPolicyHandlers.final ImmutableGPUEAExecutionContext<T> withDefaultMutationPolicyHandlers(Iterable<? extends MutationPolicyHandler<T>> elements) Copy the current immutable object with elements that replace the content ofdefaultMutationPolicyHandlers.final ImmutableGPUEAExecutionContext<T> withDefaultMutationPolicyHandlers(MutationPolicyHandler<T>... elements) Copy the current immutable object with elements that replace the content ofdefaultMutationPolicyHandlers.final ImmutableGPUEAExecutionContext<T> withDefaultReplacementStrategyHandlers(Iterable<? extends ReplacementStrategyHandler<T>> elements) Copy the current immutable object with elements that replace the content ofdefaultReplacementStrategyHandlers.final ImmutableGPUEAExecutionContext<T> Copy the current immutable object with elements that replace the content ofdefaultReplacementStrategyHandlers.final ImmutableGPUEAExecutionContext<T> withDefaultSelectionPolicyHandlers(Iterable<? extends SelectionPolicyHandler<T>> elements) Copy the current immutable object with elements that replace the content ofdefaultSelectionPolicyHandlers.final ImmutableGPUEAExecutionContext<T> withDefaultSelectionPolicyHandlers(SelectionPolicyHandler<T>... elements) Copy the current immutable object with elements that replace the content ofdefaultSelectionPolicyHandlers.final ImmutableGPUEAExecutionContext<T> withDeviceFilters(Predicate<Device> value) Copy the current immutable object by setting a value for thedeviceFiltersattribute.final ImmutableGPUEAExecutionContext<T> withEvolutionListeners(Iterable<? extends EvolutionListener<T>> elements) Copy the current immutable object with elements that replace the content ofevolutionListeners.final ImmutableGPUEAExecutionContext<T> withEvolutionListeners(EvolutionListener<T>... elements) Copy the current immutable object with elements that replace the content ofevolutionListeners.final ImmutableGPUEAExecutionContext<T> withMutationPolicyHandlerFactories(Iterable<? extends MutationPolicyHandlerFactory<T>> elements) Copy the current immutable object with elements that replace the content ofmutationPolicyHandlerFactories.final ImmutableGPUEAExecutionContext<T> withMutationPolicyHandlerFactories(MutationPolicyHandlerFactory<T>... elements) Copy the current immutable object with elements that replace the content ofmutationPolicyHandlerFactories.final ImmutableGPUEAExecutionContext<T> withPlatformFilters(Predicate<Platform> value) Copy the current immutable object by setting a value for theplatformFiltersattribute.final ImmutableGPUEAExecutionContext<T> withPopulationSize(int value) Copy the current immutable object by setting a value for thepopulationSizeattribute.final ImmutableGPUEAExecutionContext<T> Copy the current immutable object by setting a value for therandomGeneratorattribute.final ImmutableGPUEAExecutionContext<T> withReplacementStrategyHandlerFactories(Iterable<? extends ReplacementStrategyHandlerFactory<T>> elements) Copy the current immutable object with elements that replace the content ofreplacementStrategyHandlerFactories.final ImmutableGPUEAExecutionContext<T> Copy the current immutable object with elements that replace the content ofreplacementStrategyHandlerFactories.final ImmutableGPUEAExecutionContext<T> withSelectionPolicyHandlerFactories(Iterable<? extends SelectionPolicyHandlerFactory<T>> elements) Copy the current immutable object with elements that replace the content ofselectionPolicyHandlerFactories.final ImmutableGPUEAExecutionContext<T> Copy the current immutable object with elements that replace the content ofselectionPolicyHandlerFactories.
-
Field Details
-
defaultChromosomeCombinatorHandlers
private final List<ChromosomeCombinatorHandler<T extends Comparable<T>>> defaultChromosomeCombinatorHandlers -
chromosomeCombinatorHandlerFactories
private final List<ChromosomeCombinatorHandlerFactory<T extends Comparable<T>>> chromosomeCombinatorHandlerFactories -
chromosomeCombinatorHandlers
private final transient List<ChromosomeCombinatorHandler<T extends Comparable<T>>> chromosomeCombinatorHandlers -
defaultSelectionPolicyHandlers
-
selectionPolicyHandlerFactories
private final List<SelectionPolicyHandlerFactory<T extends Comparable<T>>> selectionPolicyHandlerFactories -
selectionPolicyHandlers
private final transient List<SelectionPolicyHandler<T extends Comparable<T>>> selectionPolicyHandlers -
defaultMutationPolicyHandlers
-
mutationPolicyHandlerFactories
private final List<MutationPolicyHandlerFactory<T extends Comparable<T>>> mutationPolicyHandlerFactories -
mutationPolicyHandlers
-
defaultChromosomeMutationPolicyHandlers
private final List<ChromosomeMutationHandler<? extends Chromosome>> defaultChromosomeMutationPolicyHandlers -
chromosomeMutationPolicyHandlerFactories
private final List<ChromosomeMutationHandlerFactory<T extends Comparable<T>>> chromosomeMutationPolicyHandlerFactories -
chromosomeMutationPolicyHandlers
private final transient List<ChromosomeMutationHandler<? extends Chromosome>> chromosomeMutationPolicyHandlers -
defaultReplacementStrategyHandlers
private final List<ReplacementStrategyHandler<T extends Comparable<T>>> defaultReplacementStrategyHandlers -
replacementStrategyHandlerFactories
private final List<ReplacementStrategyHandlerFactory<T extends Comparable<T>>> replacementStrategyHandlerFactories -
replacementStrategyHandlers
private final transient List<ReplacementStrategyHandler<T extends Comparable<T>>> replacementStrategyHandlers -
randomGenerator
-
populationSize
private final int populationSize -
chromosomeFactoryProvider
-
evolutionListeners
-
platformFilters
-
deviceFilters
-
STAGE_INITIALIZING
private static final byte STAGE_INITIALIZING- See Also:
-
STAGE_UNINITIALIZED
private static final byte STAGE_UNINITIALIZED- See Also:
-
STAGE_INITIALIZED
private static final byte STAGE_INITIALIZED- See Also:
-
initShim
private transient volatile ImmutableGPUEAExecutionContext<T extends Comparable<T>>.InitShim initShim
-
-
Constructor Details
-
ImmutableGPUEAExecutionContext
-
ImmutableGPUEAExecutionContext
private ImmutableGPUEAExecutionContext(List<ChromosomeCombinatorHandler<T>> defaultChromosomeCombinatorHandlers, List<ChromosomeCombinatorHandlerFactory<T>> chromosomeCombinatorHandlerFactories, List<SelectionPolicyHandler<T>> defaultSelectionPolicyHandlers, List<SelectionPolicyHandlerFactory<T>> selectionPolicyHandlerFactories, List<MutationPolicyHandler<T>> defaultMutationPolicyHandlers, List<MutationPolicyHandlerFactory<T>> mutationPolicyHandlerFactories, List<ChromosomeMutationHandler<? extends Chromosome>> defaultChromosomeMutationPolicyHandlers, List<ChromosomeMutationHandlerFactory<T>> chromosomeMutationPolicyHandlerFactories, List<ReplacementStrategyHandler<T>> defaultReplacementStrategyHandlers, List<ReplacementStrategyHandlerFactory<T>> replacementStrategyHandlerFactories, RandomGenerator randomGenerator, int populationSize, ChromosomeFactoryProvider chromosomeFactoryProvider, List<EvolutionListener<T>> evolutionListeners, Predicate<Platform> platformFilters, Predicate<Device> deviceFilters)
-
-
Method Details
-
defaultChromosomeCombinatorHandlers
- Overrides:
defaultChromosomeCombinatorHandlersin classAbstractEAExecutionContext<T extends Comparable<T>>- Returns:
- The value of the
defaultChromosomeCombinatorHandlersattribute
-
chromosomeCombinatorHandlerFactories
- Specified by:
chromosomeCombinatorHandlerFactoriesin classAbstractEAExecutionContext<T extends Comparable<T>>- Returns:
- The value of the
chromosomeCombinatorHandlerFactoriesattribute
-
chromosomeCombinatorHandlers
- Overrides:
chromosomeCombinatorHandlersin classAbstractEAExecutionContext<T extends Comparable<T>>- Returns:
- The computed-at-construction value of the
chromosomeCombinatorHandlersattribute
-
defaultSelectionPolicyHandlers
Description copied from class:AbstractEAExecutionContextDefault list of SelectionPolicyHandler- Overrides:
defaultSelectionPolicyHandlersin classAbstractEAExecutionContext<T extends Comparable<T>>- Returns:
- The value of the
defaultSelectionPolicyHandlersattribute
-
selectionPolicyHandlerFactories
- Specified by:
selectionPolicyHandlerFactoriesin classAbstractEAExecutionContext<T extends Comparable<T>>- Returns:
- The value of the
selectionPolicyHandlerFactoriesattribute
-
selectionPolicyHandlers
- Overrides:
selectionPolicyHandlersin classAbstractEAExecutionContext<T extends Comparable<T>>- Returns:
- The computed-at-construction value of the
selectionPolicyHandlersattribute
-
defaultMutationPolicyHandlers
Description copied from class:AbstractEAExecutionContextDefault list for MutationPolicyHandler- Overrides:
defaultMutationPolicyHandlersin classAbstractEAExecutionContext<T extends Comparable<T>>- Returns:
- The value of the
defaultMutationPolicyHandlersattribute
-
mutationPolicyHandlerFactories
- Specified by:
mutationPolicyHandlerFactoriesin classAbstractEAExecutionContext<T extends Comparable<T>>- Returns:
- The value of the
mutationPolicyHandlerFactoriesattribute
-
mutationPolicyHandlers
- Overrides:
mutationPolicyHandlersin classAbstractEAExecutionContext<T extends Comparable<T>>- Returns:
- The computed-at-construction value of the
mutationPolicyHandlersattribute
-
defaultChromosomeMutationPolicyHandlers
public List<ChromosomeMutationHandler<? extends Chromosome>> defaultChromosomeMutationPolicyHandlers()Description copied from class:AbstractEAExecutionContextDefault list of ChromosomeMutationPolicyHandler- Overrides:
defaultChromosomeMutationPolicyHandlersin classAbstractEAExecutionContext<T extends Comparable<T>>- Returns:
- The value of the
defaultChromosomeMutationPolicyHandlersattribute
-
chromosomeMutationPolicyHandlerFactories
- Specified by:
chromosomeMutationPolicyHandlerFactoriesin classAbstractEAExecutionContext<T extends Comparable<T>>- Returns:
- The value of the
chromosomeMutationPolicyHandlerFactoriesattribute
-
chromosomeMutationPolicyHandlers
- Overrides:
chromosomeMutationPolicyHandlersin classAbstractEAExecutionContext<T extends Comparable<T>>- Returns:
- The computed-at-construction value of the
chromosomeMutationPolicyHandlersattribute
-
defaultReplacementStrategyHandlers
Description copied from class:AbstractEAExecutionContextDefault list of ReplacementStrategyHandler- Overrides:
defaultReplacementStrategyHandlersin classAbstractEAExecutionContext<T extends Comparable<T>>- Returns:
- The value of the
defaultReplacementStrategyHandlersattribute
-
replacementStrategyHandlerFactories
- Specified by:
replacementStrategyHandlerFactoriesin classAbstractEAExecutionContext<T extends Comparable<T>>- Returns:
- The value of the
replacementStrategyHandlerFactoriesattribute
-
replacementStrategyHandlers
- Overrides:
replacementStrategyHandlersin classAbstractEAExecutionContext<T extends Comparable<T>>- Returns:
- The computed-at-construction value of the
replacementStrategyHandlersattribute
-
randomGenerator
Description copied from class:AbstractEAExecutionContextDefault Random Generator- Overrides:
randomGeneratorin classAbstractEAExecutionContext<T extends Comparable<T>>- Returns:
- The value of the
randomGeneratorattribute
-
populationSize
public int populationSize()- Overrides:
populationSizein classAbstractEAExecutionContext<T extends Comparable<T>>- Returns:
- The value of the
populationSizeattribute
-
chromosomeFactoryProvider
- Overrides:
chromosomeFactoryProviderin classAbstractEAExecutionContext<T extends Comparable<T>>- Returns:
- The value of the
chromosomeFactoryProviderattribute
-
evolutionListeners
- Overrides:
evolutionListenersin classAbstractEAExecutionContext<T extends Comparable<T>>- Returns:
- The value of the
evolutionListenersattribute
-
platformFilters
Returns the predicate used to filter OpenCL platforms during device discovery.Platform filtering allows selective use of OpenCL platforms based on vendor, version, profile, or other platform characteristics. This enables optimization for specific hardware configurations or requirements.
Common filtering criteria:
- Profile support: Filter by FULL_PROFILE vs EMBEDDED_PROFILE
- Vendor preference: Select platforms from specific vendors
- Version requirements: Ensure minimum OpenCL version support
- Extension support: Filter platforms with required extensions
- Overrides:
platformFiltersin classGPUEAExecutionContext<T extends Comparable<T>>- Returns:
- the platform filtering predicate (default accepts all platforms)
-
deviceFilters
Returns the predicate used to filter OpenCL devices during device discovery.Device filtering enables selection of appropriate compute devices based on type, capabilities, memory, and performance characteristics. This allows optimization for specific workload requirements and hardware constraints.
Common filtering criteria:
- Device type: GPU, CPU, ACCELERATOR, or combinations
- Memory capacity: Minimum global or local memory requirements
- Compute units: Minimum parallel processing capability
- OpenCL version: Required feature support level
- Extensions: Specific OpenCL extension requirements
- Overrides:
deviceFiltersin classGPUEAExecutionContext<T extends Comparable<T>>- Returns:
- the device filtering predicate (default accepts all devices)
-
withDefaultChromosomeCombinatorHandlers
@SafeVarargs public final ImmutableGPUEAExecutionContext<T> withDefaultChromosomeCombinatorHandlers(ChromosomeCombinatorHandler<T>... elements) Copy the current immutable object with elements that replace the content ofdefaultChromosomeCombinatorHandlers.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withDefaultChromosomeCombinatorHandlers
public final ImmutableGPUEAExecutionContext<T> withDefaultChromosomeCombinatorHandlers(Iterable<? extends ChromosomeCombinatorHandler<T>> elements) Copy the current immutable object with elements that replace the content ofdefaultChromosomeCombinatorHandlers. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of defaultChromosomeCombinatorHandlers elements to set- Returns:
- A modified copy or
thisif not changed
-
withChromosomeCombinatorHandlerFactories
@SafeVarargs public final ImmutableGPUEAExecutionContext<T> withChromosomeCombinatorHandlerFactories(ChromosomeCombinatorHandlerFactory<T>... elements) Copy the current immutable object with elements that replace the content ofchromosomeCombinatorHandlerFactories.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withChromosomeCombinatorHandlerFactories
public final ImmutableGPUEAExecutionContext<T> withChromosomeCombinatorHandlerFactories(Iterable<? extends ChromosomeCombinatorHandlerFactory<T>> elements) Copy the current immutable object with elements that replace the content ofchromosomeCombinatorHandlerFactories. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of chromosomeCombinatorHandlerFactories elements to set- Returns:
- A modified copy or
thisif not changed
-
withDefaultSelectionPolicyHandlers
@SafeVarargs public final ImmutableGPUEAExecutionContext<T> withDefaultSelectionPolicyHandlers(SelectionPolicyHandler<T>... elements) Copy the current immutable object with elements that replace the content ofdefaultSelectionPolicyHandlers.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withDefaultSelectionPolicyHandlers
public final ImmutableGPUEAExecutionContext<T> withDefaultSelectionPolicyHandlers(Iterable<? extends SelectionPolicyHandler<T>> elements) Copy the current immutable object with elements that replace the content ofdefaultSelectionPolicyHandlers. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of defaultSelectionPolicyHandlers elements to set- Returns:
- A modified copy or
thisif not changed
-
withSelectionPolicyHandlerFactories
@SafeVarargs public final ImmutableGPUEAExecutionContext<T> withSelectionPolicyHandlerFactories(SelectionPolicyHandlerFactory<T>... elements) Copy the current immutable object with elements that replace the content ofselectionPolicyHandlerFactories.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withSelectionPolicyHandlerFactories
public final ImmutableGPUEAExecutionContext<T> withSelectionPolicyHandlerFactories(Iterable<? extends SelectionPolicyHandlerFactory<T>> elements) Copy the current immutable object with elements that replace the content ofselectionPolicyHandlerFactories. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of selectionPolicyHandlerFactories elements to set- Returns:
- A modified copy or
thisif not changed
-
withDefaultMutationPolicyHandlers
@SafeVarargs public final ImmutableGPUEAExecutionContext<T> withDefaultMutationPolicyHandlers(MutationPolicyHandler<T>... elements) Copy the current immutable object with elements that replace the content ofdefaultMutationPolicyHandlers.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withDefaultMutationPolicyHandlers
public final ImmutableGPUEAExecutionContext<T> withDefaultMutationPolicyHandlers(Iterable<? extends MutationPolicyHandler<T>> elements) Copy the current immutable object with elements that replace the content ofdefaultMutationPolicyHandlers. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of defaultMutationPolicyHandlers elements to set- Returns:
- A modified copy or
thisif not changed
-
withMutationPolicyHandlerFactories
@SafeVarargs public final ImmutableGPUEAExecutionContext<T> withMutationPolicyHandlerFactories(MutationPolicyHandlerFactory<T>... elements) Copy the current immutable object with elements that replace the content ofmutationPolicyHandlerFactories.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withMutationPolicyHandlerFactories
public final ImmutableGPUEAExecutionContext<T> withMutationPolicyHandlerFactories(Iterable<? extends MutationPolicyHandlerFactory<T>> elements) Copy the current immutable object with elements that replace the content ofmutationPolicyHandlerFactories. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of mutationPolicyHandlerFactories elements to set- Returns:
- A modified copy or
thisif not changed
-
withDefaultChromosomeMutationPolicyHandlers
@SafeVarargs public final ImmutableGPUEAExecutionContext<T> withDefaultChromosomeMutationPolicyHandlers(ChromosomeMutationHandler<? extends Chromosome>... elements) Copy the current immutable object with elements that replace the content ofdefaultChromosomeMutationPolicyHandlers.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withDefaultChromosomeMutationPolicyHandlers
public final ImmutableGPUEAExecutionContext<T> withDefaultChromosomeMutationPolicyHandlers(Iterable<? extends ChromosomeMutationHandler<? extends Chromosome>> elements) Copy the current immutable object with elements that replace the content ofdefaultChromosomeMutationPolicyHandlers. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of defaultChromosomeMutationPolicyHandlers elements to set- Returns:
- A modified copy or
thisif not changed
-
withChromosomeMutationPolicyHandlerFactories
@SafeVarargs public final ImmutableGPUEAExecutionContext<T> withChromosomeMutationPolicyHandlerFactories(ChromosomeMutationHandlerFactory<T>... elements) Copy the current immutable object with elements that replace the content ofchromosomeMutationPolicyHandlerFactories.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withChromosomeMutationPolicyHandlerFactories
public final ImmutableGPUEAExecutionContext<T> withChromosomeMutationPolicyHandlerFactories(Iterable<? extends ChromosomeMutationHandlerFactory<T>> elements) Copy the current immutable object with elements that replace the content ofchromosomeMutationPolicyHandlerFactories. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of chromosomeMutationPolicyHandlerFactories elements to set- Returns:
- A modified copy or
thisif not changed
-
withDefaultReplacementStrategyHandlers
@SafeVarargs public final ImmutableGPUEAExecutionContext<T> withDefaultReplacementStrategyHandlers(ReplacementStrategyHandler<T>... elements) Copy the current immutable object with elements that replace the content ofdefaultReplacementStrategyHandlers.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withDefaultReplacementStrategyHandlers
public final ImmutableGPUEAExecutionContext<T> withDefaultReplacementStrategyHandlers(Iterable<? extends ReplacementStrategyHandler<T>> elements) Copy the current immutable object with elements that replace the content ofdefaultReplacementStrategyHandlers. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of defaultReplacementStrategyHandlers elements to set- Returns:
- A modified copy or
thisif not changed
-
withReplacementStrategyHandlerFactories
@SafeVarargs public final ImmutableGPUEAExecutionContext<T> withReplacementStrategyHandlerFactories(ReplacementStrategyHandlerFactory<T>... elements) Copy the current immutable object with elements that replace the content ofreplacementStrategyHandlerFactories.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withReplacementStrategyHandlerFactories
public final ImmutableGPUEAExecutionContext<T> withReplacementStrategyHandlerFactories(Iterable<? extends ReplacementStrategyHandlerFactory<T>> elements) Copy the current immutable object with elements that replace the content ofreplacementStrategyHandlerFactories. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of replacementStrategyHandlerFactories elements to set- Returns:
- A modified copy or
thisif not changed
-
withRandomGenerator
Copy the current immutable object by setting a value for therandomGeneratorattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for randomGenerator- Returns:
- A modified copy or the
thisobject
-
withPopulationSize
Copy the current immutable object by setting a value for thepopulationSizeattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for populationSize- Returns:
- A modified copy or the
thisobject
-
withChromosomeFactoryProvider
public final ImmutableGPUEAExecutionContext<T> withChromosomeFactoryProvider(ChromosomeFactoryProvider value) Copy the current immutable object by setting a value for thechromosomeFactoryProviderattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for chromosomeFactoryProvider- Returns:
- A modified copy or the
thisobject
-
withEvolutionListeners
@SafeVarargs public final ImmutableGPUEAExecutionContext<T> withEvolutionListeners(EvolutionListener<T>... elements) Copy the current immutable object with elements that replace the content ofevolutionListeners.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withEvolutionListeners
public final ImmutableGPUEAExecutionContext<T> withEvolutionListeners(Iterable<? extends EvolutionListener<T>> elements) Copy the current immutable object with elements that replace the content ofevolutionListeners. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of evolutionListeners elements to set- Returns:
- A modified copy or
thisif not changed
-
withPlatformFilters
Copy the current immutable object by setting a value for theplatformFiltersattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for platformFilters- Returns:
- A modified copy or the
thisobject
-
withDeviceFilters
Copy the current immutable object by setting a value for thedeviceFiltersattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for deviceFilters- Returns:
- A modified copy or the
thisobject
-
equals
This instance is equal to all instances ofImmutableGPUEAExecutionContextthat have equal attribute values. -
equalsByValue
-
hashCode
public int hashCode()Computes a hash code from attributes:defaultChromosomeCombinatorHandlers,chromosomeCombinatorHandlerFactories,chromosomeCombinatorHandlers,defaultSelectionPolicyHandlers,selectionPolicyHandlerFactories,selectionPolicyHandlers,defaultMutationPolicyHandlers,mutationPolicyHandlerFactories,mutationPolicyHandlers,defaultChromosomeMutationPolicyHandlers,chromosomeMutationPolicyHandlerFactories,chromosomeMutationPolicyHandlers,defaultReplacementStrategyHandlers,replacementStrategyHandlerFactories,replacementStrategyHandlers,randomGenerator,populationSize,chromosomeFactoryProvider,evolutionListeners,platformFilters,deviceFilters. -
toString
Prints the immutable valueGPUEAExecutionContextwith attribute values. -
copyOf
public static <T extends Comparable<T>> GPUEAExecutionContext<T> copyOf(GPUEAExecutionContext<T> instance) Creates an immutable copy of aGPUEAExecutionContextvalue. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Type Parameters:
T- generic parameter T- Parameters:
instance- The instance to copy- Returns:
- A copied immutable GPUEAExecutionContext instance
-
builder
Creates a builder forGPUEAExecutionContext.ImmutableGPUEAExecutionContext.<T>builder() .addDefaultChromosomeCombinatorHandlers|addAllDefaultChromosomeCombinatorHandlers(net.bmahe.genetics4j.core.combination.ChromosomeCombinatorHandler<T>) //defaultChromosomeCombinatorHandlerselements .addChromosomeCombinatorHandlerFactories|addAllChromosomeCombinatorHandlerFactories(net.bmahe.genetics4j.core.spec.ChromosomeCombinatorHandlerFactory<T>) //chromosomeCombinatorHandlerFactorieselements .addDefaultSelectionPolicyHandlers|addAllDefaultSelectionPolicyHandlers(net.bmahe.genetics4j.core.selection.SelectionPolicyHandler<T>) //defaultSelectionPolicyHandlerselements .addSelectionPolicyHandlerFactories|addAllSelectionPolicyHandlerFactories(net.bmahe.genetics4j.core.spec.SelectionPolicyHandlerFactory<T>) //selectionPolicyHandlerFactorieselements .addDefaultMutationPolicyHandlers|addAllDefaultMutationPolicyHandlers(net.bmahe.genetics4j.core.mutation.MutationPolicyHandler<T>) //defaultMutationPolicyHandlerselements .addMutationPolicyHandlerFactories|addAllMutationPolicyHandlerFactories(net.bmahe.genetics4j.core.spec.MutationPolicyHandlerFactory<T>) //mutationPolicyHandlerFactorieselements .addDefaultChromosomeMutationPolicyHandlers|addAllDefaultChromosomeMutationPolicyHandlers(net.bmahe.genetics4j.core.mutation.chromosome.ChromosomeMutationHandler<? extends net.bmahe.genetics4j.core.chromosomes.Chromosome>) //defaultChromosomeMutationPolicyHandlerselements .addChromosomeMutationPolicyHandlerFactories|addAllChromosomeMutationPolicyHandlerFactories(net.bmahe.genetics4j.core.mutation.chromosome.ChromosomeMutationHandlerFactory<T>) //chromosomeMutationPolicyHandlerFactorieselements .addDefaultReplacementStrategyHandlers|addAllDefaultReplacementStrategyHandlers(net.bmahe.genetics4j.core.replacement.ReplacementStrategyHandler<T>) //defaultReplacementStrategyHandlerselements .addReplacementStrategyHandlerFactories|addAllReplacementStrategyHandlerFactories(net.bmahe.genetics4j.core.spec.ReplacementStrategyHandlerFactory<T>) //replacementStrategyHandlerFactorieselements .randomGenerator(random.RandomGenerator) // optionalrandomGenerator.populationSize(int) // optionalpopulationSize.chromosomeFactoryProvider(net.bmahe.genetics4j.core.chromosomes.factory.ChromosomeFactoryProvider) // optionalchromosomeFactoryProvider.addEvolutionListeners|addAllEvolutionListeners(net.bmahe.genetics4j.core.evolutionlisteners.EvolutionListener<T>) //evolutionListenerselements .platformFilters(function.Predicate<net.bmahe.genetics4j.gpu.opencl.model.Platform>) // optionalplatformFilters.deviceFilters(function.Predicate<net.bmahe.genetics4j.gpu.opencl.model.Device>) // optionaldeviceFilters.build();- Type Parameters:
T- generic parameter T- Returns:
- A new GPUEAExecutionContext builder
-
createSafeList
-
createUnmodifiableList
-