aboutsummaryrefslogtreecommitdiffstats
path: root/src/jcgp/chromosome/element
diff options
context:
space:
mode:
authorEduardo Pedroni <ep625@york.ac.uk>2014-01-30 21:41:33 +0000
committerEduardo Pedroni <ep625@york.ac.uk>2014-01-30 21:41:33 +0000
commit8f7874fa75c532bab994af8e6553d37afe42ec4c (patch)
treed2cf0e234fbf5b329abde422c1123675baa71125 /src/jcgp/chromosome/element
parent761021e0551beaaaac1120ef6da37a70281974b2 (diff)
Chromosome data structure partially refactored, also added higher level classes.
Diffstat (limited to 'src/jcgp/chromosome/element')
-rw-r--r--src/jcgp/chromosome/element/MutableElement.java7
-rw-r--r--src/jcgp/chromosome/element/Node.java18
-rw-r--r--src/jcgp/chromosome/element/Output.java14
3 files changed, 6 insertions, 33 deletions
diff --git a/src/jcgp/chromosome/element/MutableElement.java b/src/jcgp/chromosome/element/MutableElement.java
index ed7e23c..0122c69 100644
--- a/src/jcgp/chromosome/element/MutableElement.java
+++ b/src/jcgp/chromosome/element/MutableElement.java
@@ -1,12 +1,5 @@
package jcgp.chromosome.element;
-import jcgp.chromosome.Chromosome;
-import jcgp.chromosome.functions.FunctionSet;
-
public interface MutableElement {
- public void initialise(Chromosome chromosome, FunctionSet functions);
-
- public void mutate(Chromosome chromosome, FunctionSet functions);
-
}
diff --git a/src/jcgp/chromosome/element/Node.java b/src/jcgp/chromosome/element/Node.java
index f97c680..761c3c9 100644
--- a/src/jcgp/chromosome/element/Node.java
+++ b/src/jcgp/chromosome/element/Node.java
@@ -1,22 +1,16 @@
package jcgp.chromosome.element;
-import jcgp.chromosome.Chromosome;
-import jcgp.chromosome.functions.FunctionSet;
+import jcgp.chromosome.functions.Function;
-public class Node extends ChromosomeElement implements MutableElement {
- @Override
- public void initialise(Chromosome chromosome, FunctionSet functions) {
- // TODO Auto-generated method stub
-
- }
+public class Node extends ChromosomeElement implements MutableElement {
+
+ private Function function;
- @Override
- public void mutate(Chromosome chromosome, FunctionSet functions) {
- // TODO Auto-generated method stub
+ public Node() {
}
-
+
@Override
public int evaluate() {
// TODO Auto-generated method stub
diff --git a/src/jcgp/chromosome/element/Output.java b/src/jcgp/chromosome/element/Output.java
index 261e77d..ee4d204 100644
--- a/src/jcgp/chromosome/element/Output.java
+++ b/src/jcgp/chromosome/element/Output.java
@@ -1,23 +1,9 @@
package jcgp.chromosome.element;
-import jcgp.chromosome.Chromosome;
-import jcgp.chromosome.functions.FunctionSet;
public class Output extends ChromosomeElement implements MutableElement {
@Override
- public void initialise(Chromosome chromosome, FunctionSet functions) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public void mutate(Chromosome chromosome, FunctionSet functions) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
public int evaluate() {
// TODO Auto-generated method stub
return 0;