Package net.bmahe.genetics4j.neat.spec
Class ImmutableNeatChromosomeSpec
java.lang.Object
net.bmahe.genetics4j.neat.spec.NeatChromosomeSpec
net.bmahe.genetics4j.neat.spec.ImmutableNeatChromosomeSpec
- All Implemented Interfaces:
ChromosomeSpec
@Generated("org.immutables.processor.ProxyProcessor")
public final class ImmutableNeatChromosomeSpec
extends NeatChromosomeSpec
Immutable implementation of
NeatChromosomeSpec
.
Use the builder to create immutable instances:
new NeatChromosomeSpec.Builder()
.
Use the static factory method to create immutable instances:
ImmutableNeatChromosomeSpec.of()
.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Builds instances of typeImmutableNeatChromosomeSpec
. -
Field Summary
Modifier and TypeFieldDescriptionprivate final float
private final float
private final int
private final int
-
Constructor Summary
ModifierConstructorDescriptionprivate
ImmutableNeatChromosomeSpec
(int numInputs, int numOutputs, float minWeightValue, float maxWeightValue) -
Method Summary
Modifier and TypeMethodDescriptionstatic ImmutableNeatChromosomeSpec
copyOf
(NeatChromosomeSpec instance) Creates an immutable copy of aNeatChromosomeSpec
value.boolean
This instance is equal to all instances ofImmutableNeatChromosomeSpec
that have equal attribute values.private boolean
equalTo
(int synthetic, ImmutableNeatChromosomeSpec another) int
hashCode()
Computes a hash code from attributes:numInputs
,numOutputs
,minWeightValue
,maxWeightValue
.float
float
int
int
static ImmutableNeatChromosomeSpec
of
(int numInputs, int numOutputs, float minWeightValue, float maxWeightValue) Construct a new immutableNeatChromosomeSpec
instance.toString()
Prints the immutable valueNeatChromosomeSpec
with attribute values.private static ImmutableNeatChromosomeSpec
validate
(ImmutableNeatChromosomeSpec instance) withMaxWeightValue
(float value) Copy the current immutable object by setting a value for themaxWeightValue
attribute.withMinWeightValue
(float value) Copy the current immutable object by setting a value for theminWeightValue
attribute.withNumInputs
(int value) Copy the current immutable object by setting a value for thenumInputs
attribute.withNumOutputs
(int value) Copy the current immutable object by setting a value for thenumOutputs
attribute.Methods inherited from class net.bmahe.genetics4j.neat.spec.NeatChromosomeSpec
check
-
Field Details
-
numInputs
private final int numInputs -
numOutputs
private final int numOutputs -
minWeightValue
private final float minWeightValue -
maxWeightValue
private final float maxWeightValue
-
-
Constructor Details
-
ImmutableNeatChromosomeSpec
private ImmutableNeatChromosomeSpec(int numInputs, int numOutputs, float minWeightValue, float maxWeightValue)
-
-
Method Details
-
numInputs
public int numInputs()- Specified by:
numInputs
in classNeatChromosomeSpec
- Returns:
- The value of the
numInputs
attribute
-
numOutputs
public int numOutputs()- Specified by:
numOutputs
in classNeatChromosomeSpec
- Returns:
- The value of the
numOutputs
attribute
-
minWeightValue
public float minWeightValue()- Specified by:
minWeightValue
in classNeatChromosomeSpec
- Returns:
- The value of the
minWeightValue
attribute
-
maxWeightValue
public float maxWeightValue()- Specified by:
maxWeightValue
in classNeatChromosomeSpec
- Returns:
- The value of the
maxWeightValue
attribute
-
withNumInputs
Copy the current immutable object by setting a value for thenumInputs
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for numInputs- Returns:
- A modified copy of the
this
object
-
withNumOutputs
Copy the current immutable object by setting a value for thenumOutputs
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for numOutputs- Returns:
- A modified copy of the
this
object
-
withMinWeightValue
Copy the current immutable object by setting a value for theminWeightValue
attribute. A value strict bits equality used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for minWeightValue- Returns:
- A modified copy of the
this
object
-
withMaxWeightValue
Copy the current immutable object by setting a value for themaxWeightValue
attribute. A value strict bits equality used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for maxWeightValue- Returns:
- A modified copy of the
this
object
-
equals
This instance is equal to all instances ofImmutableNeatChromosomeSpec
that have equal attribute values. -
equalTo
-
hashCode
public int hashCode()Computes a hash code from attributes:numInputs
,numOutputs
,minWeightValue
,maxWeightValue
. -
toString
Prints the immutable valueNeatChromosomeSpec
with attribute values. -
of
public static ImmutableNeatChromosomeSpec of(int numInputs, int numOutputs, float minWeightValue, float maxWeightValue) Construct a new immutableNeatChromosomeSpec
instance.- Parameters:
numInputs
- The value for thenumInputs
attributenumOutputs
- The value for thenumOutputs
attributeminWeightValue
- The value for theminWeightValue
attributemaxWeightValue
- The value for themaxWeightValue
attribute- Returns:
- An immutable NeatChromosomeSpec instance
-
validate
-
copyOf
Creates an immutable copy of aNeatChromosomeSpec
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 NeatChromosomeSpec instance
-