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/chromosome/Chromosome.java | 79 ---------------------- src/jcgp/chromosome/Population.java | 16 ----- src/jcgp/chromosome/element/ChromosomeElement.java | 7 -- src/jcgp/chromosome/element/Input.java | 11 --- src/jcgp/chromosome/element/MutableElement.java | 5 -- src/jcgp/chromosome/element/Node.java | 20 ------ src/jcgp/chromosome/element/Output.java | 12 ---- src/jcgp/chromosome/functions/Function.java | 7 -- src/jcgp/chromosome/functions/FunctionSet.java | 14 ---- 9 files changed, 171 deletions(-) delete mode 100644 src/jcgp/chromosome/Chromosome.java delete mode 100644 src/jcgp/chromosome/Population.java delete mode 100644 src/jcgp/chromosome/element/ChromosomeElement.java delete mode 100644 src/jcgp/chromosome/element/Input.java delete mode 100644 src/jcgp/chromosome/element/MutableElement.java delete mode 100644 src/jcgp/chromosome/element/Node.java delete mode 100644 src/jcgp/chromosome/element/Output.java delete mode 100644 src/jcgp/chromosome/functions/Function.java delete mode 100644 src/jcgp/chromosome/functions/FunctionSet.java (limited to 'src/jcgp/chromosome') diff --git a/src/jcgp/chromosome/Chromosome.java b/src/jcgp/chromosome/Chromosome.java deleted file mode 100644 index cdf2e4b..0000000 --- a/src/jcgp/chromosome/Chromosome.java +++ /dev/null @@ -1,79 +0,0 @@ -package jcgp.chromosome; - -import java.util.ArrayList; - -import jcgp.CGP; -import jcgp.chromosome.element.Input; -import jcgp.chromosome.element.Node; -import jcgp.chromosome.element.Output; - -public class Chromosome { - - private ArrayList inputs; - private ArrayList> nodes; - private ArrayList outputs; - - /** - * Good citizen. - * - */ - public Chromosome() { - - inputs = new ArrayList(CGP.INPUTS); - for (int i = 0; i < CGP.INPUTS; i++) { - inputs.add(new Input()); - } - - // rows first - nodes = new ArrayList>(CGP.ROWS); - for (int r = 0; r < CGP.ROWS; r++) { - nodes.add(new ArrayList(CGP.COLUMNS)); - for (int c = 0; c < CGP.COLUMNS; c++) { - nodes.get(r).add(new Node()); - } - } - - outputs = new ArrayList(CGP.OUTPUTS); - for (int o = 0; o < CGP.OUTPUTS; o++) { - outputs.add(new Output()); - } - } - - public int getActiveNodeCount() { - return 0; - } - - /** - * @return the inputs - */ - public final ArrayList getInputs() { - return inputs; - } - - /** - * @return the nodes - */ - public final ArrayList> getNodes() { - return nodes; - } - - /** - * @return the outputs - */ - public final ArrayList getOutputs() { - return outputs; - } - - public final Node getNode(int row, int column) { - return nodes.get(row).get(column); - } - - public final Output getOutput(int index) { - return outputs.get(index); - } - - public final Input getInputs(int index) { - return inputs.get(index); - } - -} diff --git a/src/jcgp/chromosome/Population.java b/src/jcgp/chromosome/Population.java deleted file mode 100644 index e720a24..0000000 --- a/src/jcgp/chromosome/Population.java +++ /dev/null @@ -1,16 +0,0 @@ -package jcgp.chromosome; - -import java.util.ArrayList; - -public class Population { - - private ArrayList population; - - public Population(int size) { - population = new ArrayList(size); - for (int c = 0; c < size; c++) { - population.add(new Chromosome()); - } - } - -} diff --git a/src/jcgp/chromosome/element/ChromosomeElement.java b/src/jcgp/chromosome/element/ChromosomeElement.java deleted file mode 100644 index 2dc9107..0000000 --- a/src/jcgp/chromosome/element/ChromosomeElement.java +++ /dev/null @@ -1,7 +0,0 @@ -package jcgp.chromosome.element; - -public abstract class ChromosomeElement { - - public abstract int evaluate(); - -} diff --git a/src/jcgp/chromosome/element/Input.java b/src/jcgp/chromosome/element/Input.java deleted file mode 100644 index de051dc..0000000 --- a/src/jcgp/chromosome/element/Input.java +++ /dev/null @@ -1,11 +0,0 @@ -package jcgp.chromosome.element; - -public class Input extends ChromosomeElement { - - @Override - public int evaluate() { - // TODO Auto-generated method stub - return 0; - } - -} diff --git a/src/jcgp/chromosome/element/MutableElement.java b/src/jcgp/chromosome/element/MutableElement.java deleted file mode 100644 index 0122c69..0000000 --- a/src/jcgp/chromosome/element/MutableElement.java +++ /dev/null @@ -1,5 +0,0 @@ -package jcgp.chromosome.element; - -public interface MutableElement { - -} diff --git a/src/jcgp/chromosome/element/Node.java b/src/jcgp/chromosome/element/Node.java deleted file mode 100644 index 761c3c9..0000000 --- a/src/jcgp/chromosome/element/Node.java +++ /dev/null @@ -1,20 +0,0 @@ -package jcgp.chromosome.element; - -import jcgp.chromosome.functions.Function; - - -public class Node extends ChromosomeElement implements MutableElement { - - private Function function; - - public Node() { - - } - - @Override - public int evaluate() { - // TODO Auto-generated method stub - return 0; - } - -} diff --git a/src/jcgp/chromosome/element/Output.java b/src/jcgp/chromosome/element/Output.java deleted file mode 100644 index ee4d204..0000000 --- a/src/jcgp/chromosome/element/Output.java +++ /dev/null @@ -1,12 +0,0 @@ -package jcgp.chromosome.element; - - -public class Output extends ChromosomeElement implements MutableElement { - - @Override - public int evaluate() { - // TODO Auto-generated method stub - return 0; - } - -} diff --git a/src/jcgp/chromosome/functions/Function.java b/src/jcgp/chromosome/functions/Function.java deleted file mode 100644 index 27697be..0000000 --- a/src/jcgp/chromosome/functions/Function.java +++ /dev/null @@ -1,7 +0,0 @@ -package jcgp.chromosome.functions; - -public abstract class Function { - - public abstract int run(); - -} diff --git a/src/jcgp/chromosome/functions/FunctionSet.java b/src/jcgp/chromosome/functions/FunctionSet.java deleted file mode 100644 index e9d197a..0000000 --- a/src/jcgp/chromosome/functions/FunctionSet.java +++ /dev/null @@ -1,14 +0,0 @@ -package jcgp.chromosome.functions; - -import java.util.ArrayList; - -public class FunctionSet { - - private ArrayList functions; - - public FunctionSet() { - functions = new ArrayList(); - } - - -} -- cgit v1.2.3