aboutsummaryrefslogtreecommitdiffstats
path: root/src/jcgp/fitness
diff options
context:
space:
mode:
Diffstat (limited to 'src/jcgp/fitness')
-rw-r--r--src/jcgp/fitness/TestCase.java14
-rw-r--r--src/jcgp/fitness/TruthTableEvaluator.java1
2 files changed, 8 insertions, 7 deletions
diff --git a/src/jcgp/fitness/TestCase.java b/src/jcgp/fitness/TestCase.java
index 95129c6..4c10de7 100644
--- a/src/jcgp/fitness/TestCase.java
+++ b/src/jcgp/fitness/TestCase.java
@@ -4,10 +4,10 @@ import jcgp.Parameters;
public class TestCase {
- private int[] inputs;
- private int[] outputs;
+ private Object[] inputs;
+ private Object[] outputs;
- public TestCase(int[] inputs, int[] outputs) throws ParameterMismatchException {
+ public TestCase(Object[] inputs, Object[] outputs) throws ParameterMismatchException {
if (inputs.length == Parameters.getInputs()) {
this.inputs = inputs;
} else {
@@ -22,19 +22,19 @@ public class TestCase {
}
- public int getInput(int index) {
+ public Object getInput(int index) {
return inputs[index];
}
- public int getOutput(int index) {
+ public Object getOutput(int index) {
return outputs[index];
}
- public int[] getInputs() {
+ public Object[] getInputs() {
return inputs;
}
- public int[] getOutputs() {
+ public Object[] getOutputs() {
return outputs;
}
diff --git a/src/jcgp/fitness/TruthTableEvaluator.java b/src/jcgp/fitness/TruthTableEvaluator.java
index 987ea4c..4c26d60 100644
--- a/src/jcgp/fitness/TruthTableEvaluator.java
+++ b/src/jcgp/fitness/TruthTableEvaluator.java
@@ -19,6 +19,7 @@ public class TruthTableEvaluator implements FitnessFunction {
}
}
chromosome.setFitness(fitness);
+ System.out.println("Fitness: " + fitness);
}
}
}