public class Output extends java.lang.Object implements Mutable
mutate()
.
Alternatively, you may also perform a specific mutation using
setSource(...)
.Constructor and Description |
---|
Output(Chromosome chromosome,
int index)
Makes a new instance of
Output with the
specified arguments. |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
calculate() |
boolean |
copyOf(Mutable m)
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. |
void |
getActiveNodes(java.util.ArrayList<Node> activeNodes)
Calls
getActive(...) on this output's
source. |
int |
getIndex() |
Connection |
getSource() |
void |
mutate()
This method performs an arbitrary mutation on the
Mutable . |
void |
setSource(Connection newConnection)
This method sets the output source to the specified connection.
|
java.lang.String |
toString() |
public Output(Chromosome chromosome, int index)
Output
with the
specified arguments.chromosome
- the chromosome this output belongs to.index
- the output index.public java.lang.Object calculate()
public int getIndex()
public void setSource(Connection newConnection)
newConnection
- the Connection
to connect to.public Connection getSource()
public void getActiveNodes(java.util.ArrayList<Node> activeNodes)
getActive(...)
on this output's
source. This kicks off a recursive process whereby
all nodes connected to this output are added to the
specified list of nodes. This is used to create a
list of all active nodes.activeNodes
- the list to add all active nodes to.public boolean copyOf(Mutable m)
Mutable
public void mutate()
Mutable
Mutable
.
public java.lang.String toString()
toString
in class java.lang.Object