Package net.bmahe.genetics4j.core.spec
Class ImmutableEAExecutionContext<T extends Comparable<T>>
java.lang.Object
net.bmahe.genetics4j.core.spec.AbstractEAExecutionContext<T>
net.bmahe.genetics4j.core.spec.EAExecutionContext<T>
net.bmahe.genetics4j.core.spec.ImmutableEAExecutionContext<T>
@Generated(from="EAExecutionContext",
generator="Immutables")
@Generated("org.immutables.processor.ProxyProcessor")
public final class ImmutableEAExecutionContext<T extends Comparable<T>>
extends EAExecutionContext<T>
Immutable implementation of
EAExecutionContext.
Use the builder to create immutable instances:
ImmutableEAExecutionContext.builder().
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classImmutableEAExecutionContext.Builder<T extends Comparable<T>>Builds instances of typeEAExecutionContext.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 ImmutableEAExecutionContext<T>.InitShimprivate final List<MutationPolicyHandlerFactory<T>> private final List<MutationPolicyHandler<T>> private final intprivate 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
ConstructorsModifierConstructorDescriptionprivateImmutableEAExecutionContext(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, int numberOfPartitions) private -
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends Comparable<T>>
ImmutableEAExecutionContext.Builder<T> builder()Creates a builder forEAExecutionContext.List<ChromosomeMutationHandler<? extends Chromosome>> static <T extends Comparable<T>>
EAExecutionContext<T> copyOf(EAExecutionContext<T> instance) Creates an immutable copy of aEAExecutionContextvalue.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 SelectionPolicyHandlerbooleanThis instance is equal to all instances ofImmutableEAExecutionContextthat have equal attribute values.private booleanequalsByValue(ImmutableEAExecutionContext<?> 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,numberOfPartitions.intintDefault Random GeneratortoString()Prints the immutable valueEAExecutionContextwith attribute values.final ImmutableEAExecutionContext<T> withChromosomeCombinatorHandlerFactories(Iterable<? extends ChromosomeCombinatorHandlerFactory<T>> elements) Copy the current immutable object with elements that replace the content ofchromosomeCombinatorHandlerFactories.final ImmutableEAExecutionContext<T> Copy the current immutable object with elements that replace the content ofchromosomeCombinatorHandlerFactories.final ImmutableEAExecutionContext<T> Copy the current immutable object by setting a value for thechromosomeFactoryProviderattribute.final ImmutableEAExecutionContext<T> withChromosomeMutationPolicyHandlerFactories(Iterable<? extends ChromosomeMutationHandlerFactory<T>> elements) Copy the current immutable object with elements that replace the content ofchromosomeMutationPolicyHandlerFactories.final ImmutableEAExecutionContext<T> Copy the current immutable object with elements that replace the content ofchromosomeMutationPolicyHandlerFactories.final ImmutableEAExecutionContext<T> withDefaultChromosomeCombinatorHandlers(Iterable<? extends ChromosomeCombinatorHandler<T>> elements) Copy the current immutable object with elements that replace the content ofdefaultChromosomeCombinatorHandlers.final ImmutableEAExecutionContext<T> Copy the current immutable object with elements that replace the content ofdefaultChromosomeCombinatorHandlers.final ImmutableEAExecutionContext<T> withDefaultChromosomeMutationPolicyHandlers(Iterable<? extends ChromosomeMutationHandler<? extends Chromosome>> elements) Copy the current immutable object with elements that replace the content ofdefaultChromosomeMutationPolicyHandlers.final ImmutableEAExecutionContext<T> withDefaultChromosomeMutationPolicyHandlers(ChromosomeMutationHandler<? extends Chromosome>... elements) Copy the current immutable object with elements that replace the content ofdefaultChromosomeMutationPolicyHandlers.final ImmutableEAExecutionContext<T> withDefaultMutationPolicyHandlers(Iterable<? extends MutationPolicyHandler<T>> elements) Copy the current immutable object with elements that replace the content ofdefaultMutationPolicyHandlers.final ImmutableEAExecutionContext<T> withDefaultMutationPolicyHandlers(MutationPolicyHandler<T>... elements) Copy the current immutable object with elements that replace the content ofdefaultMutationPolicyHandlers.final ImmutableEAExecutionContext<T> withDefaultReplacementStrategyHandlers(Iterable<? extends ReplacementStrategyHandler<T>> elements) Copy the current immutable object with elements that replace the content ofdefaultReplacementStrategyHandlers.final ImmutableEAExecutionContext<T> Copy the current immutable object with elements that replace the content ofdefaultReplacementStrategyHandlers.final ImmutableEAExecutionContext<T> withDefaultSelectionPolicyHandlers(Iterable<? extends SelectionPolicyHandler<T>> elements) Copy the current immutable object with elements that replace the content ofdefaultSelectionPolicyHandlers.final ImmutableEAExecutionContext<T> withDefaultSelectionPolicyHandlers(SelectionPolicyHandler<T>... elements) Copy the current immutable object with elements that replace the content ofdefaultSelectionPolicyHandlers.final ImmutableEAExecutionContext<T> withEvolutionListeners(Iterable<? extends EvolutionListener<T>> elements) Copy the current immutable object with elements that replace the content ofevolutionListeners.final ImmutableEAExecutionContext<T> withEvolutionListeners(EvolutionListener<T>... elements) Copy the current immutable object with elements that replace the content ofevolutionListeners.final ImmutableEAExecutionContext<T> withMutationPolicyHandlerFactories(Iterable<? extends MutationPolicyHandlerFactory<T>> elements) Copy the current immutable object with elements that replace the content ofmutationPolicyHandlerFactories.final ImmutableEAExecutionContext<T> withMutationPolicyHandlerFactories(MutationPolicyHandlerFactory<T>... elements) Copy the current immutable object with elements that replace the content ofmutationPolicyHandlerFactories.final ImmutableEAExecutionContext<T> withNumberOfPartitions(int value) Copy the current immutable object by setting a value for thenumberOfPartitionsattribute.final ImmutableEAExecutionContext<T> withPopulationSize(int value) Copy the current immutable object by setting a value for thepopulationSizeattribute.final ImmutableEAExecutionContext<T> Copy the current immutable object by setting a value for therandomGeneratorattribute.final ImmutableEAExecutionContext<T> withReplacementStrategyHandlerFactories(Iterable<? extends ReplacementStrategyHandlerFactory<T>> elements) Copy the current immutable object with elements that replace the content ofreplacementStrategyHandlerFactories.final ImmutableEAExecutionContext<T> Copy the current immutable object with elements that replace the content ofreplacementStrategyHandlerFactories.final ImmutableEAExecutionContext<T> withSelectionPolicyHandlerFactories(Iterable<? extends SelectionPolicyHandlerFactory<T>> elements) Copy the current immutable object with elements that replace the content ofselectionPolicyHandlerFactories.final ImmutableEAExecutionContext<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
-
numberOfPartitions
private final int numberOfPartitions -
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
-
-
Constructor Details
-
ImmutableEAExecutionContext
-
ImmutableEAExecutionContext
private ImmutableEAExecutionContext(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, int numberOfPartitions)
-
-
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
Default list of SelectionPolicyHandler- Overrides:
defaultSelectionPolicyHandlersin classAbstractEAExecutionContext<T extends Comparable<T>>
-
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
Default list for MutationPolicyHandler- Overrides:
defaultMutationPolicyHandlersin classAbstractEAExecutionContext<T extends Comparable<T>>
-
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()Default list of ChromosomeMutationPolicyHandler- Overrides:
defaultChromosomeMutationPolicyHandlersin classAbstractEAExecutionContext<T extends Comparable<T>>
-
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
Default list of ReplacementStrategyHandler- Overrides:
defaultReplacementStrategyHandlersin classAbstractEAExecutionContext<T extends Comparable<T>>
-
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
Default Random Generator- Overrides:
randomGeneratorin classAbstractEAExecutionContext<T extends Comparable<T>>
-
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
-
numberOfPartitions
public int numberOfPartitions()- Overrides:
numberOfPartitionsin classEAExecutionContext<T extends Comparable<T>>- Returns:
- The value of the
numberOfPartitionsattribute
-
withDefaultChromosomeCombinatorHandlers
@SafeVarargs public final ImmutableEAExecutionContext<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 ImmutableEAExecutionContext<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 ImmutableEAExecutionContext<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 ImmutableEAExecutionContext<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 ImmutableEAExecutionContext<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 ImmutableEAExecutionContext<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 ImmutableEAExecutionContext<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 ImmutableEAExecutionContext<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 ImmutableEAExecutionContext<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 ImmutableEAExecutionContext<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 ImmutableEAExecutionContext<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 ImmutableEAExecutionContext<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 ImmutableEAExecutionContext<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 ImmutableEAExecutionContext<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 ImmutableEAExecutionContext<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 ImmutableEAExecutionContext<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 ImmutableEAExecutionContext<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 ImmutableEAExecutionContext<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 ImmutableEAExecutionContext<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 ImmutableEAExecutionContext<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 ImmutableEAExecutionContext<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 ImmutableEAExecutionContext<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 ImmutableEAExecutionContext<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
-
withNumberOfPartitions
Copy the current immutable object by setting a value for thenumberOfPartitionsattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for numberOfPartitions- Returns:
- A modified copy or the
thisobject
-
equals
This instance is equal to all instances ofImmutableEAExecutionContextthat 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,numberOfPartitions. -
toString
Prints the immutable valueEAExecutionContextwith attribute values. -
copyOf
public static <T extends Comparable<T>> EAExecutionContext<T> copyOf(EAExecutionContext<T> instance) Creates an immutable copy of aEAExecutionContextvalue. 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 EAExecutionContext instance
-
builder
Creates a builder forEAExecutionContext.ImmutableEAExecutionContext.<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 .numberOfPartitions(int) // optionalnumberOfPartitions.build();- Type Parameters:
T- generic parameter T- Returns:
- A new EAExecutionContext builder
-
createSafeList
-
createUnmodifiableList
-