Class ImmutableAddConnection
java.lang.Object
net.bmahe.genetics4j.neat.spec.mutation.AddConnection
net.bmahe.genetics4j.neat.spec.mutation.ImmutableAddConnection
- All Implemented Interfaces:
MutationPolicy
@Generated(from="AddConnection",
generator="Immutables")
@Generated("org.immutables.processor.ProxyProcessor")
public final class ImmutableAddConnection
extends AddConnection
Immutable implementation of
AddConnection.
Use the builder to create immutable instances:
new AddConnection.Builder().
Use the static factory method to create immutable instances:
ImmutableAddConnection.of().
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final booleanprivate final double -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateImmutableAddConnection(double populationMutationProbability) privateImmutableAddConnection(double populationMutationProbability, boolean allowOutputNodeAsSource) private -
Method Summary
Modifier and TypeMethodDescriptionbooleanIndicates whether output nodes may be selected as the source of new connections.static AddConnectioncopyOf(AddConnection instance) Creates an immutable copy of aAddConnectionvalue.booleanThis instance is equal to all instances ofImmutableAddConnectionthat have equal attribute values.private booleanequalsByValue(ImmutableAddConnection another) inthashCode()Computes a hash code from attributes:populationMutationProbability,allowOutputNodeAsSource.static AddConnectionof(double populationMutationProbability) Construct a new immutableAddConnectioninstance.doubletoString()Prints the immutable valueAddConnectionwith attribute values.private static ImmutableAddConnectionvalidate(ImmutableAddConnection instance) final ImmutableAddConnectionwithAllowOutputNodeAsSource(boolean value) Copy the current immutable object by setting a value for theallowOutputNodeAsSourceattribute.final ImmutableAddConnectionwithPopulationMutationProbability(double value) Copy the current immutable object by setting a value for thepopulationMutationProbabilityattribute.Methods inherited from class AddConnection
builder, check
-
Field Details
-
populationMutationProbability
private final double populationMutationProbability -
allowOutputNodeAsSource
private final boolean allowOutputNodeAsSource
-
-
Constructor Details
-
ImmutableAddConnection
private ImmutableAddConnection(double populationMutationProbability) -
ImmutableAddConnection
-
ImmutableAddConnection
private ImmutableAddConnection(double populationMutationProbability, boolean allowOutputNodeAsSource)
-
-
Method Details
-
populationMutationProbability
public double populationMutationProbability()- Specified by:
populationMutationProbabilityin classAddConnection- Returns:
- The value of the
populationMutationProbabilityattribute
-
allowOutputNodeAsSource
public boolean allowOutputNodeAsSource()Indicates whether output nodes may be selected as the source of new connections.Enabling this option allows recurrent topologies such as output-to-hidden and output-to-output connections. Such topologies are intended for evaluation with a recurrent network.
- Overrides:
allowOutputNodeAsSourcein classAddConnection- Returns:
truewhen output nodes may be connection sources
-
withPopulationMutationProbability
Copy the current immutable object by setting a value for thepopulationMutationProbabilityattribute. A value strict bits equality used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for populationMutationProbability- Returns:
- A modified copy or the
thisobject
-
withAllowOutputNodeAsSource
Copy the current immutable object by setting a value for theallowOutputNodeAsSourceattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for allowOutputNodeAsSource- Returns:
- A modified copy or the
thisobject
-
equals
-
equalsByValue
-
hashCode
-
toString
-
of
Construct a new immutableAddConnectioninstance.- Parameters:
populationMutationProbability- The value for thepopulationMutationProbabilityattribute- Returns:
- An immutable AddConnection instance
-
validate
-
copyOf
Creates an immutable copy of aAddConnectionvalue. 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 AddConnection instance
-