From 8189116ea4b5db4675e31dfd04a5687d55e29262 Mon Sep 17 00:00:00 2001 From: Eduardo Pedroni Date: Tue, 6 May 2014 14:29:37 +0100 Subject: Added javadocs, made minor changes to the comments --- doc/jcgp/backend/population/Node.html | 544 ++++++++++++++++++++++++++++++++++ 1 file changed, 544 insertions(+) create mode 100644 doc/jcgp/backend/population/Node.html (limited to 'doc/jcgp/backend/population/Node.html') diff --git a/doc/jcgp/backend/population/Node.html b/doc/jcgp/backend/population/Node.html new file mode 100644 index 0000000..9e7b9a5 --- /dev/null +++ b/doc/jcgp/backend/population/Node.html @@ -0,0 +1,544 @@ + + + + + +Node + + + + + + + + +
+ + + + + + + +
+ + + +
+
jcgp.backend.population
+

Class Node

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Connection, MutableElement
    +
    +
    +
    +
    public class Node
    +extends java.lang.Object
    +implements MutableElement, Connection
    +
    Nodes make up the main part of the chromosome, + where the actual functions are evolved. Each node + contains a function and a number of connections. + The node outputs the result of performing its function + on the values of its connections. Nodes therefore + implement both MutableElement and Connection + since they can be mutated but also connected to. + Nodes are constructed with a fixed number of connections + (determined by the maximum arity of the function set) + and must be reinstantiated if the experiment arity + changes.
    +
    +
    Author:
    +
    Eduardo Pedroni
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      Node(Chromosome chromosome, + int row, + int column, + int arity) +
      Constructs a new instance of Node with the + specified parameters.
      +
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      booleancopyOf(MutableElement element) +
      Asserts if the specified element is a copy of the elements + this is called on.
      + This method returns true if and only if: + + the elements being compared are not the same instance; + the connections of the compared elements are not the same instance; + the elements have the same function (in the case of Node); + the grid position of the elements themselves are the same; + the grid position of all equivalent connections are the same; + +

      + The relationship computed by this method is: + + symmetric: a.copyOf(b) == b.copyOf(a); + not reflexive: a.copyOf(a) returns false; + not transitive: if a.copyOf(b) is true and b.copyOf(c) is true, a.copyOf(c) is + not necessarily true since it is possible that a == c. +
      +
      intgetColumn() 
      ConnectiongetConnection(int index) 
      FunctiongetFunction() 
      intgetRow() 
      java.lang.ObjectgetValue() +
      Compute and return the value of this connection.
      +
      voidinitialise(Function newFunction, + Connection... newConnections) +
      Initialises the node with the specified values.
      +
      voidsetConnection(int index, + Connection newConnection) +
      This method sets the indexed connection to the specified new connection.
      +
      voidsetFunction(Function newFunction) +
      Sets the node function.
      +
      java.lang.StringtoString() 
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Node

        +
        public Node(Chromosome chromosome,
        +            int row,
        +            int column,
        +            int arity)
        +
        Constructs a new instance of Node with the + specified parameters. Nodes must contain their + own row and column for ease of copying.
        +
        +
        Parameters:
        +
        chromosome - the chromosome this node belongs to.
        +
        row - the node's row.
        +
        column - the node's column.
        +
        arity - the maximum arity of the experiment.
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        setFunction

        +
        public void setFunction(Function newFunction)
        +
        Sets the node function.
        +
        +
        Parameters:
        +
        newFunction - the new function to set.
        +
        +
      • +
      + + + +
        +
      • +

        initialise

        +
        public void initialise(Function newFunction,
        +                       Connection... newConnections)
        +
        Initialises the node with the specified values. + The number of connections passed as argument must + be exactly the same as the experiment arity, or + an IllegalArgumentException will be thrown.
        +
        +
        Parameters:
        +
        newFunction - the node function to set.
        +
        newConnections - the node connections to set.
        +
        +
      • +
      + + + +
        +
      • +

        getColumn

        +
        public int getColumn()
        +
        +
        Returns:
        +
        this node's column.
        +
        +
      • +
      + + + +
        +
      • +

        getRow

        +
        public int getRow()
        +
        +
        Returns:
        +
        this node's row.
        +
        +
      • +
      + + + +
        +
      • +

        getFunction

        +
        public Function getFunction()
        +
        +
        Returns:
        +
        this node's function.
        +
        +
      • +
      + + + +
        +
      • +

        getConnection

        +
        public Connection getConnection(int index)
        +
        +
        Parameters:
        +
        index - the connection to return.
        +
        Returns:
        +
        the indexed connection.
        +
        +
      • +
      + + + +
        +
      • +

        copyOf

        +
        public boolean copyOf(MutableElement element)
        +
        Description copied from interface: MutableElement
        +
        Asserts if the specified element is a copy of the elements + this is called on.
        + This method returns true if and only if: +
          +
        • the elements being compared are not the same instance;
        • +
        • the connections of the compared elements are not the same instance;
        • +
        • the elements have the same function (in the case of Node);
        • +
        • the grid position of the elements themselves are the same;
        • +
        • the grid position of all equivalent connections are the same;
        • +
        +

        + The relationship computed by this method is: +
          +
        • symmetric: a.copyOf(b) == b.copyOf(a);
        • +
        • not reflexive: a.copyOf(a) returns false;
        • +
        • not transitive: if a.copyOf(b) is true and b.copyOf(c) is true, a.copyOf(c) is + not necessarily true since it is possible that a == c.
        • +
        +
        +
        Specified by:
        +
        copyOf in interface MutableElement
        +
        Parameters:
        +
        element - the mutable element to compare to.
        +
        Returns:
        +
        true if element is a copy of this element.
        +
        +
      • +
      + + + +
        +
      • +

        getValue

        +
        public java.lang.Object getValue()
        +
        Description copied from interface: Connection
        +
        Compute and return the value of this connection. In + the case of inputs no computation is necessary, this + simply returns the value the input is set to. In the + case of nodes, the value is computed based on the + node's function and the value of its own connections.
        +
        +
        Specified by:
        +
        getValue in interface Connection
        +
        Returns:
        +
        the connection's value.
        +
        +
      • +
      + + + +
        +
      • +

        setConnection

        +
        public void setConnection(int index,
        +                          Connection newConnection)
        +
        Description copied from interface: MutableElement
        +
        This method sets the indexed connection to the specified new connection. + Implementing classes may choose to ignore the given index (such as in the + case of outputs, which only have one connection).
        +
        +
        Specified by:
        +
        setConnection in interface MutableElement
        +
        Parameters:
        +
        index - the connection index to set.
        +
        newConnection - the chromosome element to connect to.
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public java.lang.String toString()
        +
        +
        Overrides:
        +
        toString in class java.lang.Object
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + -- cgit v1.2.3