From a02f1fff03ab58416da812597e67a0c7e21fdbd5 Mon Sep 17 00:00:00 2001 From: Eduardo Pedroni Date: Fri, 31 Jan 2014 13:06:54 +0000 Subject: Created most of the classes that will be necessary, content is blank for now. --- src/jcgp/ea/EvolutionaryAlgorithm.java | 15 +++++++++++++++ src/jcgp/ea/Mutator.java | 9 +++++++++ src/jcgp/ea/StandardEA.java | 20 ++++++++++++++++++++ src/jcgp/ea/StandardMutator.java | 13 +++++++++++++ 4 files changed, 57 insertions(+) create mode 100644 src/jcgp/ea/EvolutionaryAlgorithm.java create mode 100644 src/jcgp/ea/Mutator.java create mode 100644 src/jcgp/ea/StandardEA.java create mode 100644 src/jcgp/ea/StandardMutator.java (limited to 'src/jcgp/ea') diff --git a/src/jcgp/ea/EvolutionaryAlgorithm.java b/src/jcgp/ea/EvolutionaryAlgorithm.java new file mode 100644 index 0000000..6e264aa --- /dev/null +++ b/src/jcgp/ea/EvolutionaryAlgorithm.java @@ -0,0 +1,15 @@ +package jcgp.ea; + +import jcgp.population.Population; + +public abstract class EvolutionaryAlgorithm { + + protected Mutator mutator; + + public EvolutionaryAlgorithm(Mutator mutator) { + this.mutator = mutator; + } + + public abstract void evolve(Population population); + +} diff --git a/src/jcgp/ea/Mutator.java b/src/jcgp/ea/Mutator.java new file mode 100644 index 0000000..df3fe1c --- /dev/null +++ b/src/jcgp/ea/Mutator.java @@ -0,0 +1,9 @@ +package jcgp.ea; + +import jcgp.population.Chromosome; + +public interface Mutator { + + void mutate(Chromosome chromosome); + +} diff --git a/src/jcgp/ea/StandardEA.java b/src/jcgp/ea/StandardEA.java new file mode 100644 index 0000000..fe0b3f9 --- /dev/null +++ b/src/jcgp/ea/StandardEA.java @@ -0,0 +1,20 @@ +package jcgp.ea; + +import jcgp.population.Chromosome; +import jcgp.population.Population; + +public class StandardEA extends EvolutionaryAlgorithm { + + public StandardEA(Mutator mutator) { + super(mutator); + + } + + @Override + public void evolve(Population population) { + for (Chromosome chromosome : population) { + mutator.mutate(chromosome); + } + } + +} diff --git a/src/jcgp/ea/StandardMutator.java b/src/jcgp/ea/StandardMutator.java new file mode 100644 index 0000000..731215d --- /dev/null +++ b/src/jcgp/ea/StandardMutator.java @@ -0,0 +1,13 @@ +package jcgp.ea; + +import jcgp.population.Chromosome; + +public class StandardMutator implements Mutator { + + @Override + public void mutate(Chromosome chromosome) { + + + } + +} -- cgit v1.2.3