Class ImmutableTarpeianMethod
java.lang.Object
net.bmahe.genetics4j.gp.postevaluationprocess.TarpeianMethod
net.bmahe.genetics4j.gp.postevaluationprocess.ImmutableTarpeianMethod
- All Implemented Interfaces:
Function<Population<Double>,
Population<Double>>
@Generated("org.immutables.processor.ProxyProcessor")
public final class ImmutableTarpeianMethod
extends TarpeianMethod
Immutable implementation of
TarpeianMethod
.
Use the builder to create immutable instances:
ImmutableTarpeianMethod.builder()
.
Use the static factory method to create immutable instances:
ImmutableTarpeianMethod.of()
.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
Builds instances of typeImmutableTarpeianMethod
. -
Field Summary
Modifier and TypeFieldDescriptionprivate final double
private final double
private final RandomGenerator
-
Constructor Summary
ModifierConstructorDescriptionprivate
ImmutableTarpeianMethod
(RandomGenerator randomGenerator, Function<Genotype, Integer> sizeFunction, double probability, double newValue) private
ImmutableTarpeianMethod
(ImmutableTarpeianMethod original, RandomGenerator randomGenerator, Function<Genotype, Integer> sizeFunction, double probability, double newValue) -
Method Summary
Modifier and TypeMethodDescriptionbuilder()
Creates a builder forImmutableTarpeianMethod
.static ImmutableTarpeianMethod
copyOf
(TarpeianMethod instance) Creates an immutable copy of aTarpeianMethod
value.boolean
This instance is equal to all instances ofImmutableTarpeianMethod
that have equal attribute values.private boolean
equalTo
(int synthetic, ImmutableTarpeianMethod another) int
hashCode()
Computes a hash code from attributes:randomGenerator
,sizeFunction
,probability
,newValue
.double
newValue()
static ImmutableTarpeianMethod
of
(RandomGenerator randomGenerator, Function<Genotype, Integer> sizeFunction, double probability, double newValue) Construct a new immutableTarpeianMethod
instance.double
toString()
Prints the immutable valueTarpeianMethod
with attribute values.private static ImmutableTarpeianMethod
validate
(ImmutableTarpeianMethod instance) final ImmutableTarpeianMethod
withNewValue
(double value) Copy the current immutable object by setting a value for thenewValue
attribute.final ImmutableTarpeianMethod
withProbability
(double value) Copy the current immutable object by setting a value for theprobability
attribute.final ImmutableTarpeianMethod
Copy the current immutable object by setting a value for therandomGenerator
attribute.final ImmutableTarpeianMethod
withSizeFunction
(Function<Genotype, Integer> value) Copy the current immutable object by setting a value for thesizeFunction
attribute.Methods inherited from class net.bmahe.genetics4j.gp.postevaluationprocess.TarpeianMethod
apply, check, ofTreeChromosome
-
Field Details
-
randomGenerator
-
sizeFunction
-
probability
private final double probability -
newValue
private final double newValue
-
-
Constructor Details
-
ImmutableTarpeianMethod
private ImmutableTarpeianMethod(RandomGenerator randomGenerator, Function<Genotype, Integer> sizeFunction, double probability, double newValue) -
ImmutableTarpeianMethod
private ImmutableTarpeianMethod(ImmutableTarpeianMethod original, RandomGenerator randomGenerator, Function<Genotype, Integer> sizeFunction, double probability, double newValue)
-
-
Method Details
-
randomGenerator
- Specified by:
randomGenerator
in classTarpeianMethod
- Returns:
- The value of the
randomGenerator
attribute
-
sizeFunction
- Specified by:
sizeFunction
in classTarpeianMethod
- Returns:
- The value of the
sizeFunction
attribute
-
probability
public double probability()- Specified by:
probability
in classTarpeianMethod
- Returns:
- The value of the
probability
attribute
-
newValue
public double newValue()- Specified by:
newValue
in classTarpeianMethod
- Returns:
- The value of the
newValue
attribute
-
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
-
withSizeFunction
Copy the current immutable object by setting a value for thesizeFunction
attribute. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for sizeFunction- Returns:
- A modified copy of the
this
object
-
withProbability
Copy the current immutable object by setting a value for theprobability
attribute. A value strict bits equality used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for probability- Returns:
- A modified copy of the
this
object
-
withNewValue
Copy the current immutable object by setting a value for thenewValue
attribute. A value strict bits equality used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for newValue- Returns:
- A modified copy of the
this
object
-
equals
This instance is equal to all instances ofImmutableTarpeianMethod
that have equal attribute values. -
equalTo
-
hashCode
public int hashCode()Computes a hash code from attributes:randomGenerator
,sizeFunction
,probability
,newValue
. -
toString
Prints the immutable valueTarpeianMethod
with attribute values. -
of
public static ImmutableTarpeianMethod of(RandomGenerator randomGenerator, Function<Genotype, Integer> sizeFunction, double probability, double newValue) Construct a new immutableTarpeianMethod
instance.- Parameters:
randomGenerator
- The value for therandomGenerator
attributesizeFunction
- The value for thesizeFunction
attributeprobability
- The value for theprobability
attributenewValue
- The value for thenewValue
attribute- Returns:
- An immutable TarpeianMethod instance
-
validate
-
copyOf
Creates an immutable copy of aTarpeianMethod
value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance
- The instance to copy- Returns:
- A copied immutable TarpeianMethod instance
-
builder
Creates a builder forImmutableTarpeianMethod
.ImmutableTarpeianMethod.builder() .randomGenerator(random.RandomGenerator) // required
randomGenerator
.sizeFunction(function.Function<net.bmahe.genetics4j.core.Genotype, Integer>) // requiredsizeFunction
.probability(double) // requiredprobability
.newValue(double) // requirednewValue
.build();- Returns:
- A new ImmutableTarpeianMethod builder
-