aboutsummaryrefslogtreecommitdiffstats
path: root/src/jcgp/fitness
diff options
context:
space:
mode:
authorEduardo Pedroni <ep625@york.ac.uk>2014-01-31 13:06:54 +0000
committerEduardo Pedroni <ep625@york.ac.uk>2014-01-31 13:06:54 +0000
commita02f1fff03ab58416da812597e67a0c7e21fdbd5 (patch)
tree0192f0db1d1bc8d6d29433f4e84d4c94a89ed2ac /src/jcgp/fitness
parent8f7874fa75c532bab994af8e6553d37afe42ec4c (diff)
Created most of the classes that will be necessary, content is blank for now.
Diffstat (limited to 'src/jcgp/fitness')
-rw-r--r--src/jcgp/fitness/FitnessFunction.java9
-rw-r--r--src/jcgp/fitness/TestFitFunction.java15
2 files changed, 24 insertions, 0 deletions
diff --git a/src/jcgp/fitness/FitnessFunction.java b/src/jcgp/fitness/FitnessFunction.java
new file mode 100644
index 0000000..2155542
--- /dev/null
+++ b/src/jcgp/fitness/FitnessFunction.java
@@ -0,0 +1,9 @@
+package jcgp.fitness;
+
+import jcgp.population.Population;
+
+public interface FitnessFunction {
+
+ public void evaluatePopulation(Population population);
+
+}
diff --git a/src/jcgp/fitness/TestFitFunction.java b/src/jcgp/fitness/TestFitFunction.java
new file mode 100644
index 0000000..fea9f2d
--- /dev/null
+++ b/src/jcgp/fitness/TestFitFunction.java
@@ -0,0 +1,15 @@
+package jcgp.fitness;
+
+import jcgp.population.Chromosome;
+import jcgp.population.Population;
+
+public class TestFitFunction implements FitnessFunction {
+
+ @Override
+ public void evaluatePopulation(Population population) {
+
+ for (Chromosome c : population) {
+ c.setFitness(1);
+ }
+ }
+}