Class ExplicitNeatNodeLayout

java.lang.Object
net.bmahe.genetics4j.neat.spec.ExplicitNeatNodeLayout
All Implemented Interfaces:
NeatNodeLayout

public class ExplicitNeatNodeLayout extends Object implements NeatNodeLayout
Node layout with explicitly declared, ordered input and output IDs.

The constructor defensively copies both lists. IDs must be unique, non-negative, disjoint between inputs and outputs, and outside the configured hidden-node range.

  • Field Details

    • inputNodeIds

      private final List<Integer> inputNodeIds
    • outputNodeIds

      private final List<Integer> outputNodeIds
    • hiddenNodeIdStartInclusive

      private final long hiddenNodeIdStartInclusive
    • hiddenNodeIdEndExclusive

      private final long hiddenNodeIdEndExclusive
  • Constructor Details

    • ExplicitNeatNodeLayout

      public ExplicitNeatNodeLayout(List<Integer> _inputNodeIds, List<Integer> _outputNodeIds, long _hiddenNodeIdStartInclusive, long _hiddenNodeIdEndExclusive)
      Creates an explicit node layout.
      Parameters:
      _inputNodeIds - input IDs in vector order
      _outputNodeIds - output IDs in vector order
      _hiddenNodeIdStartInclusive - inclusive hidden-node range start
      _hiddenNodeIdEndExclusive - exclusive hidden-node range end
      Throws:
      NullPointerException - if either external-ID list or one of its elements is null
      IllegalArgumentException - if the external IDs or hidden-node range are invalid
  • Method Details

    • inputNodeIds

      public List<Integer> inputNodeIds()
      Description copied from interface: NeatNodeLayout
      Returns input node IDs in external vector order.
      Specified by:
      inputNodeIds in interface NeatNodeLayout
      Returns:
      an ordered, non-empty list of input node IDs
    • outputNodeIds

      public List<Integer> outputNodeIds()
      Description copied from interface: NeatNodeLayout
      Returns output node IDs in external vector order.
      Specified by:
      outputNodeIds in interface NeatNodeLayout
      Returns:
      an ordered, non-empty list of output node IDs
    • hiddenNodeIdStartInclusive

      public long hiddenNodeIdStartInclusive()
      Description copied from interface: NeatNodeLayout
      Returns the first ID reserved for hidden nodes.
      Specified by:
      hiddenNodeIdStartInclusive in interface NeatNodeLayout
      Returns:
      the inclusive hidden-node range start
    • hiddenNodeIdEndExclusive

      public long hiddenNodeIdEndExclusive()
      Description copied from interface: NeatNodeLayout
      Returns the exclusive end of the hidden-node namespace.
      Specified by:
      hiddenNodeIdEndExclusive in interface NeatNodeLayout
      Returns:
      the exclusive hidden-node range end
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object