aboutsummaryrefslogtreecommitdiffstats
path: root/src/jcgp/ea
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/ea
parent8f7874fa75c532bab994af8e6553d37afe42ec4c (diff)
Created most of the classes that will be necessary, content is blank for now.
Diffstat (limited to 'src/jcgp/ea')
-rw-r--r--src/jcgp/ea/EvolutionaryAlgorithm.java15
-rw-r--r--src/jcgp/ea/Mutator.java9
-rw-r--r--src/jcgp/ea/StandardEA.java20
-rw-r--r--src/jcgp/ea/StandardMutator.java13
4 files changed, 57 insertions, 0 deletions
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) {
+
+
+ }
+
+}