public class Output extends java.lang.Object implements MutableElement
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(MutableElement 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) |
int |
getIndex() |
Connection |
getSource() |
void |
setConnection(int index,
Connection newConnection)
When mutating an output, the index parameter
is simply ignored and the output source is
set.
|
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 Connection getSource()
public void getActiveNodes(java.util.ArrayList<Node> activeNodes)
public void setConnection(int index, Connection newConnection)
setConnection
in interface MutableElement
index
- the connection index to set.newConnection
- the chromosome element to connect to.MutableElement.setConnection(int, jcgp.backend.population.Connection)
public boolean copyOf(MutableElement m)
MutableElement
copyOf
in interface MutableElement
m
- the mutable element to compare to.element
is a copy of this element.public java.lang.String toString()
toString
in class java.lang.Object