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().

  • Field Details

    • populationMutationProbability

      private final double populationMutationProbability
    • allowOutputNodeAsSource

      private final boolean allowOutputNodeAsSource
  • Constructor Details

    • ImmutableAddConnection

      private ImmutableAddConnection(double populationMutationProbability)
    • ImmutableAddConnection

      private ImmutableAddConnection(ImmutableAddConnection.Builder builder)
    • ImmutableAddConnection

      private ImmutableAddConnection(double populationMutationProbability, boolean allowOutputNodeAsSource)
  • Method Details

    • populationMutationProbability

      public double populationMutationProbability()
      Specified by:
      populationMutationProbability in class AddConnection
      Returns:
      The value of the populationMutationProbability attribute
    • 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:
      allowOutputNodeAsSource in class AddConnection
      Returns:
      true when output nodes may be connection sources
    • withPopulationMutationProbability

      public final ImmutableAddConnection withPopulationMutationProbability(double value)
      Copy the current immutable object by setting a value for the populationMutationProbability attribute. A value strict bits equality used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for populationMutationProbability
      Returns:
      A modified copy or the this object
    • withAllowOutputNodeAsSource

      public final ImmutableAddConnection withAllowOutputNodeAsSource(boolean value)
      Copy the current immutable object by setting a value for the allowOutputNodeAsSource attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for allowOutputNodeAsSource
      Returns:
      A modified copy or the this object
    • equals

      public boolean equals(Object another)
      This instance is equal to all instances of ImmutableAddConnection that have equal attribute values.
      Overrides:
      equals in class Object
      Returns:
      true if this is equal to another instance
    • equalsByValue

      private boolean equalsByValue(ImmutableAddConnection another)
    • hashCode

      public int hashCode()
      Computes a hash code from attributes: populationMutationProbability, allowOutputNodeAsSource.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

      public String toString()
      Prints the immutable value AddConnection with attribute values.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the value
    • of

      public static AddConnection of(double populationMutationProbability)
      Construct a new immutable AddConnection instance.
      Parameters:
      populationMutationProbability - The value for the populationMutationProbability attribute
      Returns:
      An immutable AddConnection instance
    • validate

      private static ImmutableAddConnection validate(ImmutableAddConnection instance)
    • copyOf

      public static AddConnection copyOf(AddConnection instance)
      Creates an immutable copy of a AddConnection 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 AddConnection instance