Class ImmutableNeatChromosomeSpec
java.lang.Object
net.bmahe.genetics4j.neat.spec.NeatChromosomeSpec
net.bmahe.genetics4j.neat.spec.ImmutableNeatChromosomeSpec
- All Implemented Interfaces:
ChromosomeSpec
@Generated(from="NeatChromosomeSpec",
generator="Immutables")
@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
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final floatprivate final floatprivate final NeatNodeLayout -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateImmutableNeatChromosomeSpec(ImmutableNeatChromosomeSpec original, NeatNodeLayout nodeLayout, float minWeightValue, float maxWeightValue) privateImmutableNeatChromosomeSpec(NeatNodeLayout nodeLayout, float minWeightValue, float maxWeightValue) -
Method Summary
Modifier and TypeMethodDescriptionstatic NeatChromosomeSpeccopyOf(NeatChromosomeSpec instance) Creates an immutable copy of aNeatChromosomeSpecvalue.booleanThis instance is equal to all instances ofImmutableNeatChromosomeSpecthat have equal attribute values.private booleanequalsByValue(ImmutableNeatChromosomeSpec another) inthashCode()Computes a hash code from attributes:nodeLayout,minWeightValue,maxWeightValue.floatReturns the maximum allowed connection weight.floatReturns the minimum allowed connection weight.Returns the stable external node identities and hidden-node namespace for chromosomes created from this specification.static NeatChromosomeSpecof(NeatNodeLayout nodeLayout, float minWeightValue, float maxWeightValue) Construct a new immutableNeatChromosomeSpecinstance.toString()Prints the immutable valueNeatChromosomeSpecwith attribute values.private static ImmutableNeatChromosomeSpecvalidate(ImmutableNeatChromosomeSpec instance) withMaxWeightValue(float value) Copy the current immutable object by setting a value for themaxWeightValueattribute.withMinWeightValue(float value) Copy the current immutable object by setting a value for theminWeightValueattribute.withNodeLayout(NeatNodeLayout value) Copy the current immutable object by setting a value for thenodeLayoutattribute.Methods inherited from class NeatChromosomeSpec
check, numInputs, numOutputs, of
-
Field Details
-
nodeLayout
-
minWeightValue
private final float minWeightValue -
maxWeightValue
private final float maxWeightValue
-
-
Constructor Details
-
ImmutableNeatChromosomeSpec
private ImmutableNeatChromosomeSpec(NeatNodeLayout nodeLayout, float minWeightValue, float maxWeightValue) -
ImmutableNeatChromosomeSpec
private ImmutableNeatChromosomeSpec(ImmutableNeatChromosomeSpec original, NeatNodeLayout nodeLayout, float minWeightValue, float maxWeightValue)
-
-
Method Details
-
nodeLayout
Returns the stable external node identities and hidden-node namespace for chromosomes created from this specification.- Specified by:
nodeLayoutin classNeatChromosomeSpec- Returns:
- the node layout
-
minWeightValue
public float minWeightValue()Returns the minimum allowed connection weight.- Specified by:
minWeightValuein classNeatChromosomeSpec- Returns:
- the inclusive lower bound for connection weights
-
maxWeightValue
public float maxWeightValue()Returns the maximum allowed connection weight.- Specified by:
maxWeightValuein classNeatChromosomeSpec- Returns:
- the inclusive upper bound for connection weights
-
withNodeLayout
Copy the current immutable object by setting a value for thenodeLayoutattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for nodeLayout- Returns:
- A modified copy or the
thisobject
-
withMinWeightValue
Copy the current immutable object by setting a value for theminWeightValueattribute. 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 or the
thisobject
-
withMaxWeightValue
Copy the current immutable object by setting a value for themaxWeightValueattribute. 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 or the
thisobject
-
equals
-
equalsByValue
-
hashCode
-
toString
-
of
public static NeatChromosomeSpec of(NeatNodeLayout nodeLayout, float minWeightValue, float maxWeightValue) Construct a new immutableNeatChromosomeSpecinstance.- Parameters:
nodeLayout- The value for thenodeLayoutattributeminWeightValue- The value for theminWeightValueattributemaxWeightValue- The value for themaxWeightValueattribute- Returns:
- An immutable NeatChromosomeSpec instance
-
validate
-
copyOf
Creates an immutable copy of aNeatChromosomeSpecvalue. 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
-