diff options
Diffstat (limited to 'src/jcgp/fitness')
-rw-r--r-- | src/jcgp/fitness/FitnessFunction.java | 9 | ||||
-rw-r--r-- | src/jcgp/fitness/TestFitFunction.java | 15 |
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); + } + } +} |