aboutsummaryrefslogtreecommitdiffstats
path: root/src/jcgp/function
diff options
context:
space:
mode:
authorEduardo Pedroni <ep625@york.ac.uk>2014-02-10 09:33:54 +0000
committerEduardo Pedroni <ep625@york.ac.uk>2014-02-10 09:33:54 +0000
commit6e7747e5b85f4ca93683ed5166f6e480cc58e6fa (patch)
treee1243f2eb6f743a547b89362e37e516e22f647e8 /src/jcgp/function
parent0e34bfdb60c28a6118ec93893ddc7ceb6fa50cb5 (diff)
Refactored the resources mechanics, implemented a few of the chromosome tests
Diffstat (limited to 'src/jcgp/function')
-rw-r--r--src/jcgp/function/Addition.java2
-rw-r--r--src/jcgp/function/Subtraction.java2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/jcgp/function/Addition.java b/src/jcgp/function/Addition.java
index 8c1e0b5..faf11d5 100644
--- a/src/jcgp/function/Addition.java
+++ b/src/jcgp/function/Addition.java
@@ -7,7 +7,7 @@ public class Addition extends Function {
@Override
public int run(Connection... connections) {
if (connections.length > 0) {
- return connections[0].evaluate() + connections[1].evaluate();
+ return connections[0].getValue() + connections[1].getValue();
} else {
return 0;
}
diff --git a/src/jcgp/function/Subtraction.java b/src/jcgp/function/Subtraction.java
index 169f88c..f8b9c7d 100644
--- a/src/jcgp/function/Subtraction.java
+++ b/src/jcgp/function/Subtraction.java
@@ -7,7 +7,7 @@ public class Subtraction extends Function {
@Override
public int run(Connection... connections) {
if (connections.length > 1) {
- return connections[0].evaluate() - connections[1].evaluate();
+ return connections[0].getValue() - connections[1].getValue();
} else {
return 0;
}