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("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
Modifier and TypeClassDescriptionstatic final class
ImmutableEAExecutionContext.Builder<T extends Comparable<T>>
Builds instances of typeImmutableEAExecutionContext
.private final class
-
Field Summary
Modifier and TypeFieldDescriptionprivate final List
<ChromosomeCombinatorHandlerFactory<T>> private final List
<ChromosomeCombinatorHandler<T>> private final ChromosomeFactoryProvider
private 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>.InitShim
private final List
<MutationPolicyHandlerFactory<T>> private final List
<MutationPolicyHandler<T>> private final int
private final int
private final RandomGenerator
private final List
<ReplacementStrategyHandlerFactory<T>> private final List
<ReplacementStrategyHandler<T>> private final List
<SelectionPolicyHandlerFactory<T>> private final List
<SelectionPolicyHandler<T>> private static final byte
private static final byte
private static final byte
Fields inherited from class net.bmahe.genetics4j.core.spec.AbstractEAExecutionContext
DEFAULT_POPULATION_SIZE
-
Constructor Summary
ModifierConstructorDescriptionprivate
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) private
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends Comparable<T>>
ImmutableEAExecutionContext.Builder<T> builder()
Creates a builder forImmutableEAExecutionContext
.List
<ChromosomeMutationHandler<? extends Chromosome>> static <T extends Comparable<T>>
ImmutableEAExecutionContext<T> copyOf
(EAExecutionContext<T> instance) Creates an immutable copy of aEAExecutionContext
value.private static <T> List
<T> createSafeList
(Iterable<? extends T> iterable, boolean checkNulls, boolean skipNulls) private static <T> List
<T> createUnmodifiableList
(boolean clone, List<T> list) List
<ChromosomeMutationHandler<? extends Chromosome>> boolean
This instance is equal to all instances ofImmutableEAExecutionContext
that have equal attribute values.private boolean
equalTo
(int synthetic, ImmutableEAExecutionContext<?> another) 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
.int
int
toString()
Prints the immutable valueEAExecutionContext
with 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 thechromosomeFactoryProvider
attribute.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 thenumberOfPartitions
attribute.final ImmutableEAExecutionContext
<T> withPopulationSize
(int value) Copy the current immutable object by setting a value for thepopulationSize
attribute.final ImmutableEAExecutionContext
<T> Copy the current immutable object by setting a value for therandomGenerator
attribute.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:
defaultChromosomeCombinatorHandlers
in classAbstractEAExecutionContext<T extends Comparable<T>>
- Returns:
- The value of the
defaultChromosomeCombinatorHandlers
attribute
-
chromosomeCombinatorHandlerFactories
- Specified by:
chromosomeCombinatorHandlerFactories
in classAbstractEAExecutionContext<T extends Comparable<T>>
- Returns:
- The value of the
chromosomeCombinatorHandlerFactories
attribute
-
chromosomeCombinatorHandlers
- Overrides:
chromosomeCombinatorHandlers
in classAbstractEAExecutionContext<T extends Comparable<T>>
- Returns:
- The computed-at-construction value of the
chromosomeCombinatorHandlers
attribute
-
defaultSelectionPolicyHandlers
- Overrides:
defaultSelectionPolicyHandlers
in classAbstractEAExecutionContext<T extends Comparable<T>>
- Returns:
- The value of the
defaultSelectionPolicyHandlers
attribute
-
selectionPolicyHandlerFactories
- Specified by:
selectionPolicyHandlerFactories
in classAbstractEAExecutionContext<T extends Comparable<T>>
- Returns:
- The value of the
selectionPolicyHandlerFactories
attribute
-
selectionPolicyHandlers
- Overrides:
selectionPolicyHandlers
in classAbstractEAExecutionContext<T extends Comparable<T>>
- Returns:
- The computed-at-construction value of the
selectionPolicyHandlers
attribute
-
defaultMutationPolicyHandlers
- Overrides:
defaultMutationPolicyHandlers
in classAbstractEAExecutionContext<T extends Comparable<T>>
- Returns:
- The value of the
defaultMutationPolicyHandlers
attribute
-
mutationPolicyHandlerFactories
- Specified by:
mutationPolicyHandlerFactories
in classAbstractEAExecutionContext<T extends Comparable<T>>
- Returns:
- The value of the
mutationPolicyHandlerFactories
attribute
-
mutationPolicyHandlers
- Overrides:
mutationPolicyHandlers
in classAbstractEAExecutionContext<T extends Comparable<T>>
- Returns:
- The computed-at-construction value of the
mutationPolicyHandlers
attribute
-
defaultChromosomeMutationPolicyHandlers
public List<ChromosomeMutationHandler<? extends Chromosome>> defaultChromosomeMutationPolicyHandlers()- Overrides:
defaultChromosomeMutationPolicyHandlers
in classAbstractEAExecutionContext<T extends Comparable<T>>
- Returns:
- The value of the
defaultChromosomeMutationPolicyHandlers
attribute
-
chromosomeMutationPolicyHandlerFactories
- Specified by:
chromosomeMutationPolicyHandlerFactories
in classAbstractEAExecutionContext<T extends Comparable<T>>
- Returns:
- The value of the
chromosomeMutationPolicyHandlerFactories
attribute
-
chromosomeMutationPolicyHandlers
- Overrides:
chromosomeMutationPolicyHandlers
in classAbstractEAExecutionContext<T extends Comparable<T>>
- Returns:
- The computed-at-construction value of the
chromosomeMutationPolicyHandlers
attribute
-
defaultReplacementStrategyHandlers
- Overrides:
defaultReplacementStrategyHandlers
in classAbstractEAExecutionContext<T extends Comparable<T>>
- Returns:
- The value of the
defaultReplacementStrategyHandlers
attribute
-
replacementStrategyHandlerFactories
- Specified by:
replacementStrategyHandlerFactories
in classAbstractEAExecutionContext<T extends Comparable<T>>
- Returns:
- The value of the
replacementStrategyHandlerFactories
attribute
-
replacementStrategyHandlers
- Overrides:
replacementStrategyHandlers
in classAbstractEAExecutionContext<T extends Comparable<T>>
- Returns:
- The computed-at-construction value of the
replacementStrategyHandlers
attribute
-
randomGenerator
- Overrides:
randomGenerator
in classAbstractEAExecutionContext<T extends Comparable<T>>
- Returns:
- The value of the
randomGenerator
attribute
-
populationSize
public int populationSize()- Overrides:
populationSize
in classAbstractEAExecutionContext<T extends Comparable<T>>
- Returns:
- The value of the
populationSize
attribute
-
chromosomeFactoryProvider
- Overrides:
chromosomeFactoryProvider
in classAbstractEAExecutionContext<T extends Comparable<T>>
- Returns:
- The value of the
chromosomeFactoryProvider
attribute
-
evolutionListeners
- Overrides:
evolutionListeners
in classAbstractEAExecutionContext<T extends Comparable<T>>
- Returns:
- The value of the
evolutionListeners
attribute
-
numberOfPartitions
public int numberOfPartitions()- Overrides:
numberOfPartitions
in classEAExecutionContext<T extends Comparable<T>>
- Returns:
- The value of the
numberOfPartitions
attribute
-
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
this
object
-
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 of
this
object
-
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
this
object
-
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 of
this
object
-
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
this
object
-
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 of
this
object
-
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
this
object
-
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 of
this
object
-
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
this
object
-
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 of
this
object
-
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
this
object
-
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 of
this
object
-
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
this
object
-
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 of
this
object
-
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
this
object
-
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 of
this
object
-
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
this
object
-
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 of
this
object
-
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
this
object
-
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 of
this
object
-
withRandomGenerator
Copy the current immutable object by setting a value for therandomGenerator
attribute. 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 of the
this
object
-
withPopulationSize
Copy the current immutable object by setting a value for thepopulationSize
attribute. 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 of the
this
object
-
withChromosomeFactoryProvider
public final ImmutableEAExecutionContext<T> withChromosomeFactoryProvider(ChromosomeFactoryProvider value) Copy the current immutable object by setting a value for thechromosomeFactoryProvider
attribute. 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 of the
this
object
-
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
this
object
-
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 of
this
object
-
withNumberOfPartitions
Copy the current immutable object by setting a value for thenumberOfPartitions
attribute. 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 of the
this
object
-
equals
This instance is equal to all instances ofImmutableEAExecutionContext
that have equal attribute values. -
equalTo
-
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 valueEAExecutionContext
with attribute values. -
copyOf
public static <T extends Comparable<T>> ImmutableEAExecutionContext<T> copyOf(EAExecutionContext<T> instance) Creates an immutable copy of aEAExecutionContext
value. 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 forImmutableEAExecutionContext
.ImmutableEAExecutionContext.<T>builder() .addDefaultChromosomeCombinatorHandlers|addAllDefaultChromosomeCombinatorHandlers(net.bmahe.genetics4j.core.combination.ChromosomeCombinatorHandler<T>) //
defaultChromosomeCombinatorHandlers
elements .addChromosomeCombinatorHandlerFactories|addAllChromosomeCombinatorHandlerFactories(net.bmahe.genetics4j.core.spec.ChromosomeCombinatorHandlerFactory<T>) //chromosomeCombinatorHandlerFactories
elements .addDefaultSelectionPolicyHandlers|addAllDefaultSelectionPolicyHandlers(net.bmahe.genetics4j.core.selection.SelectionPolicyHandler<T>) //defaultSelectionPolicyHandlers
elements .addSelectionPolicyHandlerFactories|addAllSelectionPolicyHandlerFactories(net.bmahe.genetics4j.core.spec.SelectionPolicyHandlerFactory<T>) //selectionPolicyHandlerFactories
elements .addDefaultMutationPolicyHandlers|addAllDefaultMutationPolicyHandlers(net.bmahe.genetics4j.core.mutation.MutationPolicyHandler<T>) //defaultMutationPolicyHandlers
elements .addMutationPolicyHandlerFactories|addAllMutationPolicyHandlerFactories(net.bmahe.genetics4j.core.spec.MutationPolicyHandlerFactory<T>) //mutationPolicyHandlerFactories
elements .addDefaultChromosomeMutationPolicyHandlers|addAllDefaultChromosomeMutationPolicyHandlers(net.bmahe.genetics4j.core.mutation.chromosome.ChromosomeMutationHandler<? extends net.bmahe.genetics4j.core.chromosomes.Chromosome>) //defaultChromosomeMutationPolicyHandlers
elements .addChromosomeMutationPolicyHandlerFactories|addAllChromosomeMutationPolicyHandlerFactories(net.bmahe.genetics4j.core.mutation.chromosome.ChromosomeMutationHandlerFactory<T>) //chromosomeMutationPolicyHandlerFactories
elements .addDefaultReplacementStrategyHandlers|addAllDefaultReplacementStrategyHandlers(net.bmahe.genetics4j.core.replacement.ReplacementStrategyHandler<T>) //defaultReplacementStrategyHandlers
elements .addReplacementStrategyHandlerFactories|addAllReplacementStrategyHandlerFactories(net.bmahe.genetics4j.core.spec.ReplacementStrategyHandlerFactory<T>) //replacementStrategyHandlerFactories
elements .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>) //evolutionListeners
elements .numberOfPartitions(int) // optionalnumberOfPartitions
.build();- Type Parameters:
T
- generic parameter T- Returns:
- A new ImmutableEAExecutionContext builder
-
createSafeList
-
createUnmodifiableList
-