From 6e7747e5b85f4ca93683ed5166f6e480cc58e6fa Mon Sep 17 00:00:00 2001 From: Eduardo Pedroni Date: Mon, 10 Feb 2014 09:33:54 +0000 Subject: Refactored the resources mechanics, implemented a few of the chromosome tests --- src/jcgp/function/Addition.java | 2 +- src/jcgp/function/Subtraction.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/jcgp/function') 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; } -- cgit v1.2.3