aboutsummaryrefslogtreecommitdiffstats
path: root/src/jcgp/population/Output.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/jcgp/population/Output.java')
-rw-r--r--src/jcgp/population/Output.java32
1 files changed, 15 insertions, 17 deletions
diff --git a/src/jcgp/population/Output.java b/src/jcgp/population/Output.java
index b7c6128..5cc6dcf 100644
--- a/src/jcgp/population/Output.java
+++ b/src/jcgp/population/Output.java
@@ -2,18 +2,16 @@ package jcgp.population;
import java.util.ArrayList;
-import javafx.beans.property.SimpleObjectProperty;
-
public class Output extends Gene implements MutableElement {
- private SimpleObjectProperty<Connection> source;
+ private Connection source;
private Chromosome chromosome;
private int index;
public Output(Chromosome chromosome, int index) {
this.chromosome = chromosome;
this.index = index;
- this.source = new SimpleObjectProperty<Connection>();
+ //this.source = new SimpleObjectProperty<Connection>();
}
public Object calculate() {
@@ -23,7 +21,7 @@ public class Output extends Gene implements MutableElement {
@Override
public void setConnection(int index, Connection newConnection) {
- source.set(newConnection);
+ source = newConnection;
chromosome.recomputeActiveNodes();
}
@@ -32,16 +30,16 @@ public class Output extends Gene implements MutableElement {
}
public Connection getSource() {
- return source.get();
- }
-
- public SimpleObjectProperty<Connection> sourceProperty() {
return source;
}
+
+// public SimpleObjectProperty<Connection> sourceProperty() {
+// return source;
+// }
public void getActiveNodes(ArrayList<Node> activeNodes) {
- if (source.get() instanceof Node) {
- ((Node) source.get()).getActive(activeNodes);
+ if (source instanceof Node) {
+ ((Node) source).getActive(activeNodes);
}
}
@@ -51,14 +49,14 @@ public class Output extends Gene implements MutableElement {
if (m instanceof Output) {
Output o = (Output) m;
if (index == o.getIndex()) {
- if (source.get() != o.getSource()) {
- if (source.get() instanceof Input && o.getSource() instanceof Input) {
- if (((Input) source.get()).getIndex() == ((Input) o.getSource()).getIndex()) {
+ if (source != o.getSource()) {
+ if (source instanceof Input && o.getSource() instanceof Input) {
+ if (((Input) source).getIndex() == ((Input) o.getSource()).getIndex()) {
return true;
}
- } else if (source.get() instanceof Node && o.getSource() instanceof Node) {
- if (((Node) source.get()).getRow() == ((Node) o.getSource()).getRow() &&
- ((Node) source.get()).getColumn() == ((Node) o.getSource()).getColumn()) {
+ } else if (source instanceof Node && o.getSource() instanceof Node) {
+ if (((Node) source).getRow() == ((Node) o.getSource()).getRow() &&
+ ((Node) source).getColumn() == ((Node) o.getSource()).getColumn()) {
return true;
}
}