aboutsummaryrefslogtreecommitdiffstats
path: root/src/jcgp/population/Node.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/jcgp/population/Node.java')
-rw-r--r--src/jcgp/population/Node.java14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/jcgp/population/Node.java b/src/jcgp/population/Node.java
index 8958475..fd0cd47 100644
--- a/src/jcgp/population/Node.java
+++ b/src/jcgp/population/Node.java
@@ -1,5 +1,6 @@
package jcgp.population;
+import jcgp.CGP.Parameters;
import jcgp.CGP.Utilities;
import jcgp.function.Function;
@@ -8,7 +9,12 @@ public class Node implements MutableElement, Connection {
private Function function;
private Connection[] connections;
+ private int column;
+ public Node(int col) {
+ column = col;
+ }
+
@Override
public int evaluate() {
return function.run(connections);
@@ -27,10 +33,16 @@ public class Node implements MutableElement, Connection {
function = newFunction;
- if (newConnections.length >= Utilities.getMaxArity()) {
+ if (newConnections.length >= Parameters.getMaxArity()) {
connections = newConnections;
} else {
throw new InsufficientConnectionsException();
}
}
+
+ @Override
+ public int getColumn() {
+
+ return column;
+ }
}