aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEduardo Pedroni <ep625@york.ac.uk>2014-03-08 14:48:25 +0000
committerEduardo Pedroni <ep625@york.ac.uk>2014-03-08 14:48:25 +0000
commitd63d3145f0f2abcee1bb88457324f4aaf9b9320e (patch)
treedfb19082adfba8989c4fd95ef286b8c1e7a1f2b1
parentef7a850a8f2f81ccaa07f25d9b7ad602e84d88c9 (diff)
Slowly refactoring Parameters to fit the GUI a little better...
-rw-r--r--README6
-rw-r--r--src/jcgp/CGP.java60
-rw-r--r--src/jcgp/Main.java1
-rw-r--r--src/jcgp/Parameters.java150
-rw-r--r--src/jcgp/TruthTable.java2
-rw-r--r--src/jcgp/Utilities.java5
-rw-r--r--src/jcgp/gui/GUI.java14
-rw-r--r--src/jcgp/modules/Module.java15
-rw-r--r--src/jcgp/modules/ea/EvolutionaryAlgorithm.java (renamed from src/jcgp/ea/EvolutionaryAlgorithm.java)3
-rw-r--r--src/jcgp/modules/ea/StandardEA.java (renamed from src/jcgp/ea/StandardEA.java)13
-rw-r--r--src/jcgp/modules/fitness/FitnessFunction.java (renamed from src/jcgp/fitness/FitnessFunction.java)2
-rw-r--r--src/jcgp/modules/fitness/TestCase.java (renamed from src/jcgp/fitness/TestCase.java)4
-rw-r--r--src/jcgp/modules/fitness/TruthTableEvaluator.java (renamed from src/jcgp/fitness/TruthTableEvaluator.java)4
-rw-r--r--src/jcgp/modules/function/Arithmetic.java (renamed from src/jcgp/function/Arithmetic.java)4
-rw-r--r--src/jcgp/modules/function/BitwiseLogic.java (renamed from src/jcgp/function/BitwiseLogic.java)4
-rw-r--r--src/jcgp/modules/function/BooleanLogic.java (renamed from src/jcgp/function/BooleanLogic.java)4
-rw-r--r--src/jcgp/modules/function/Function.java (renamed from src/jcgp/function/Function.java)2
-rw-r--r--src/jcgp/modules/function/FunctionSet.java (renamed from src/jcgp/function/FunctionSet.java)2
-rw-r--r--src/jcgp/modules/mutator/Mutator.java (renamed from src/jcgp/ea/Mutator.java)2
-rw-r--r--src/jcgp/modules/mutator/StandardMutator.java (renamed from src/jcgp/ea/StandardMutator.java)4
-rw-r--r--src/jcgp/parameters/BooleanParameter.java32
-rw-r--r--src/jcgp/parameters/DoubleParameter.java32
-rw-r--r--src/jcgp/parameters/IntegerParameter.java32
-rw-r--r--src/jcgp/parameters/Parameter.java22
-rw-r--r--src/jcgp/parameters/Parameters.java31
-rw-r--r--src/jcgp/population/Chromosome.java2
-rw-r--r--src/jcgp/population/Node.java4
-rw-r--r--src/jcgp/population/Output.java2
-rw-r--r--src/jcgp/population/Population.java2
-rw-r--r--src/jcgp/tests/ChromosomeTests.java6
-rw-r--r--src/jcgp/tests/NodeTests.java6
-rw-r--r--src/jcgp/tests/OutputTests.java2
-rw-r--r--src/jcgp/tests/PopulationTests.java6
33 files changed, 260 insertions, 220 deletions
diff --git a/README b/README
index b6ee389..529a270 100644
--- a/README
+++ b/README
@@ -162,4 +162,8 @@ This can be caught by the GUI to display an error message, if necessary.
Added a new parameter, debug. When set to true, the system prints a lot of information to the console for debugging purposes.
-Added some more functions. \ No newline at end of file
+Added some more functions.
+
+8/3
+
+Adding GUI package, refactoring CGP class to interact appropriately with GUI. \ No newline at end of file
diff --git a/src/jcgp/CGP.java b/src/jcgp/CGP.java
index 48273e9..6ac8ff8 100644
--- a/src/jcgp/CGP.java
+++ b/src/jcgp/CGP.java
@@ -2,35 +2,40 @@ package jcgp;
import java.util.Random;
-import jcgp.ea.EvolutionaryAlgorithm;
-import jcgp.ea.Mutator;
-import jcgp.ea.StandardEA;
-import jcgp.ea.StandardMutator;
-import jcgp.fitness.FitnessFunction;
-import jcgp.fitness.TestCase;
-import jcgp.fitness.TruthTableEvaluator;
-import jcgp.function.Arithmetic;
-import jcgp.function.FunctionSet;
+import jcgp.modules.ea.EvolutionaryAlgorithm;
+import jcgp.modules.ea.StandardEA;
+import jcgp.modules.fitness.FitnessFunction;
+import jcgp.modules.fitness.TestCase;
+import jcgp.modules.fitness.TruthTableEvaluator;
+import jcgp.modules.function.Arithmetic;
+import jcgp.modules.function.FunctionSet;
+import jcgp.modules.mutator.Mutator;
+import jcgp.modules.mutator.StandardMutator;
+import jcgp.parameters.BooleanParameter;
+import jcgp.parameters.IntegerParameter;
+import jcgp.parameters.Parameters;
import jcgp.population.Population;
-public final class CGP {
+public class CGP {
// CGP components
- private EvolutionaryAlgorithm ea;
+ private EvolutionaryAlgorithm evolutionaryAlgorithm;
private Mutator mutator;
private Population population;
private FitnessFunction fitnessFunction;
+
+
public CGP() {
initialise();
for (int i = 0; i < Parameters.getTotalGenerations(); i++) {
Parameters.setCurrentGeneration(i);
fitnessFunction.evaluate(population);
- ea.evolve(population, mutator);
- if (ea.getFittestChromosome().getFitness() >= 3) {
+ evolutionaryAlgorithm.evolve(population, mutator);
+ if (evolutionaryAlgorithm.getFittestChromosome().getFitness() >= 3) {
if (Parameters.getDebug()) {
- ea.getFittestChromosome().printNodes();
+ evolutionaryAlgorithm.getFittestChromosome().printNodes();
}
break;
}
@@ -41,31 +46,30 @@ public final class CGP {
*
*/
private void initialise() {
+ // make fundamental parameters
+ Parameters.add("Rows", new IntegerParameter(3));
+ Parameters.add("Columns", new IntegerParameter(3));
+ Parameters.add("Inputs", new IntegerParameter(3));
+ Parameters.add("Outputs", new IntegerParameter(3));
+ Parameters.add("population", new IntegerParameter(5));
+
+ Parameters.add("generations", new IntegerParameter(100));
+ Parameters.add("runs", new IntegerParameter(5));
+
+ Parameters.add("debug", new BooleanParameter(false));
+
// initialise function set
FunctionSet functionSet = new FunctionSet(new Arithmetic.Addition(), new Arithmetic.Subtraction(), new Arithmetic.Multiplication());
// initialise utilities
Utilities.setResources(new Random(1234), functionSet);
- // initialise parameters
- Parameters.setColumns(3);
- Parameters.setRows(6);
- Parameters.setInputs(3);
- Parameters.setOutputs(3);
- Parameters.setLevelsBack(3);
- Parameters.setPopulationSize(1, 4);
- Parameters.setMutationRate(10);
- Parameters.setTotalGenerations(5000);
- Parameters.setTotalRuns(5);
- Parameters.setMaxArity(functionSet.getMaxArity());
- Parameters.setDebug(false);
-
// initialise fitness function and truth table
TruthTable.setTestCases(new TestCase(new Object[] {2, 5, 4}, new Object[] {1, 10, 15}));
fitnessFunction = new TruthTableEvaluator();
// initialise EA
- ea = new StandardEA();
+ evolutionaryAlgorithm = new StandardEA();
mutator = new StandardMutator();
// initialise population
diff --git a/src/jcgp/Main.java b/src/jcgp/Main.java
index 97b5c4a..d2b438d 100644
--- a/src/jcgp/Main.java
+++ b/src/jcgp/Main.java
@@ -4,7 +4,6 @@ public class Main {
public static void main(String[] args) {
CGP cgp = new CGP();
- cgp.getClass();
}
}
diff --git a/src/jcgp/Parameters.java b/src/jcgp/Parameters.java
deleted file mode 100644
index cef1ea4..0000000
--- a/src/jcgp/Parameters.java
+++ /dev/null
@@ -1,150 +0,0 @@
-package jcgp;
-
-public class Parameters {
-
-
- private static int rows = 0, columns = 0, inputs = 0, outputs = 0, levelsBack = 0,
- mutationRate = 0, totalGenerations = 0, parents = 0, offspring = 0,
- currentGeneration = 0, totalRuns = 0, currentRun = 0,
- maxArity = 0, maxFitness = 0;
-
- private static boolean debug = false;
-
- public static int getRows() {
- return rows;
- }
-
- public static int getColumns() {
- return columns;
- }
-
- public static int getNodeCount() {
- return rows * columns;
- }
-
- public static int getInputs() {
- return inputs;
- }
-
- public static int getOutputs() {
- return outputs;
- }
-
- public static int getLevelsBack() {
- return levelsBack;
- }
-
- public static int getMutationRate() {
- return mutationRate;
- }
-
- public static int getPopulationSize() {
- return offspring + parents;
- }
-
- public static int getOffspringCount() {
- return offspring;
- }
-
- public static int getParentCount() {
- return parents;
- }
-
- public static int getTotalGenerations() {
- return totalGenerations;
- }
-
- public static int getCurrentGeneration() {
- return currentGeneration;
- }
-
- public static int getTotalRuns() {
- return totalRuns;
- }
-
- public static int getCurrentRun() {
- return currentRun;
- }
-
- public static int getMaxArity() {
- return maxArity;
- }
-
- public static int getMaxFitness() {
- return maxFitness;
- }
-
- public static boolean getDebug() {
- return debug;
- }
-
- public static void setRows(int rows) {
- Parameters.rows = rows;
- }
-
- public static void setColumns(int columns) {
- Parameters.columns = columns;
- }
-
- public static void setInputs(int inputs) {
- Parameters.inputs = inputs;
- }
-
- public static void setOutputs(int outputs) {
- Parameters.outputs = outputs;
- }
-
- public static void setLevelsBack(int levelsBack) {
- Parameters.levelsBack = levelsBack;
- }
-
- public static void setMutationRate(int mutationRate) {
- Parameters.mutationRate = mutationRate;
- }
-
- public static void setPopulationSize(int parents, int offspring) {
- Parameters.parents = parents;
- Parameters.offspring = offspring;
- }
-
- public static void setOffspringCount(int offspring) {
- Parameters.offspring = offspring;
- }
-
- public static void setParentCount(int parents) {
- Parameters.parents = parents;
- }
-
- public static void setTotalGenerations(int totalGenerations) {
- Parameters.totalGenerations = totalGenerations;
- }
-
- public static void setCurrentGeneration(int currentGeneration) {
- Parameters.currentGeneration = currentGeneration;
- }
-
- public static void incrementCurrentGeneration() {
- Parameters.currentGeneration++;
- }
-
- public static void setTotalRuns(int totalRuns) {
- Parameters.totalRuns = totalRuns;
- }
-
- public static void setCurrentRun(int currentRun) {
- Parameters.currentRun = currentRun;
- }
-
- public static void setMaxArity(int maxArity) {
- Parameters.maxArity = maxArity;
- }
-
- public static void setMaxFitness(int maxFitness) {
- Parameters.maxFitness = maxFitness;
- }
-
- public static void setDebug(boolean debug) {
- Parameters.debug = debug;
- }
-
-}
diff --git a/src/jcgp/TruthTable.java b/src/jcgp/TruthTable.java
index 72712fc..e62f56b 100644
--- a/src/jcgp/TruthTable.java
+++ b/src/jcgp/TruthTable.java
@@ -1,6 +1,6 @@
package jcgp;
-import jcgp.fitness.TestCase;
+import jcgp.modules.fitness.TestCase;
public class TruthTable {
diff --git a/src/jcgp/Utilities.java b/src/jcgp/Utilities.java
index 394a481..ff5387f 100644
--- a/src/jcgp/Utilities.java
+++ b/src/jcgp/Utilities.java
@@ -2,8 +2,9 @@ package jcgp;
import java.util.Random;
-import jcgp.function.Function;
-import jcgp.function.FunctionSet;
+import jcgp.modules.function.Function;
+import jcgp.modules.function.FunctionSet;
+import jcgp.parameters.Parameters;
import jcgp.population.*;
public class Utilities {
diff --git a/src/jcgp/gui/GUI.java b/src/jcgp/gui/GUI.java
new file mode 100644
index 0000000..0e4b91a
--- /dev/null
+++ b/src/jcgp/gui/GUI.java
@@ -0,0 +1,14 @@
+package jcgp.gui;
+
+import javafx.application.Application;
+import javafx.stage.Stage;
+
+public class GUI extends Application {
+
+ @Override
+ public void start(Stage primaryStage) throws Exception {
+
+
+ }
+
+}
diff --git a/src/jcgp/modules/Module.java b/src/jcgp/modules/Module.java
new file mode 100644
index 0000000..a0da50a
--- /dev/null
+++ b/src/jcgp/modules/Module.java
@@ -0,0 +1,15 @@
+package jcgp.modules;
+
+import jcgp.parameters.Parameter;
+import jcgp.parameters.Parameters;
+
+public abstract class Module {
+
+ /**
+ * Register a new parameter
+ */
+ protected final void registerParameter(String key, Parameter value) {
+ Parameters.add(key, value);
+ };
+
+}
diff --git a/src/jcgp/ea/EvolutionaryAlgorithm.java b/src/jcgp/modules/ea/EvolutionaryAlgorithm.java
index ba70671..8de8c87 100644
--- a/src/jcgp/ea/EvolutionaryAlgorithm.java
+++ b/src/jcgp/modules/ea/EvolutionaryAlgorithm.java
@@ -1,5 +1,6 @@
-package jcgp.ea;
+package jcgp.modules.ea;
+import jcgp.modules.mutator.Mutator;
import jcgp.population.Chromosome;
import jcgp.population.Population;
diff --git a/src/jcgp/ea/StandardEA.java b/src/jcgp/modules/ea/StandardEA.java
index 5f38513..2db8776 100644
--- a/src/jcgp/ea/StandardEA.java
+++ b/src/jcgp/modules/ea/StandardEA.java
@@ -1,6 +1,9 @@
-package jcgp.ea;
+package jcgp.modules.ea;
-import jcgp.Parameters;
+import jcgp.modules.mutator.Mutator;
+import jcgp.parameters.Parameters;
+import jcgp.parameters.IntegerParameter;
+import jcgp.parameters.BooleanParameter;
import jcgp.population.Chromosome;
import jcgp.population.Population;
@@ -20,19 +23,19 @@ public class StandardEA implements EvolutionaryAlgorithm {
// select fittest chromosome
int fittest = 0;
- for (int i = 1; i < Parameters.getPopulationSize(); i++) {
+ for (int i = 1; i < ((IntegerParameter) Parameters.get("population")).getValue(); i++) {
if (population.getChromosome(i).getFitness() >= population.getChromosome(fittest).getFitness()) {
fittest = i;
}
}
fittestChromosome = population.getChromosome(fittest);
population.setBestIndividual(fittest);
- if (Parameters.getDebug()) {
+ if (((BooleanParameter) Parameters.get("debug")).getValue()) {
System.out.println("Best fitness: " + fittestChromosome.getFitness());
}
// create copies of fittest chromosome, mutate them
Chromosome fc = population.getChromosome(fittest);
- for (int i = 0; i < Parameters.getPopulationSize(); i++) {
+ for (int i = 0; i < ((IntegerParameter) Parameters.get("population")).getValue(); i++) {
if (i != fittest) {
population.getChromosome(i).copyConnections(fc);
mutator.mutate(population.getChromosome(i));
diff --git a/src/jcgp/fitness/FitnessFunction.java b/src/jcgp/modules/fitness/FitnessFunction.java
index 6fa63ef..8ed1b56 100644
--- a/src/jcgp/fitness/FitnessFunction.java
+++ b/src/jcgp/modules/fitness/FitnessFunction.java
@@ -1,4 +1,4 @@
-package jcgp.fitness;
+package jcgp.modules.fitness;
import jcgp.population.Population;
diff --git a/src/jcgp/fitness/TestCase.java b/src/jcgp/modules/fitness/TestCase.java
index e506d38..0cb09f1 100644
--- a/src/jcgp/fitness/TestCase.java
+++ b/src/jcgp/modules/fitness/TestCase.java
@@ -1,7 +1,7 @@
-package jcgp.fitness;
+package jcgp.modules.fitness;
-import jcgp.Parameters;
import jcgp.exceptions.ParameterMismatchException;
+import jcgp.parameters.Parameters;
public class TestCase {
diff --git a/src/jcgp/fitness/TruthTableEvaluator.java b/src/jcgp/modules/fitness/TruthTableEvaluator.java
index 4adf435..a69de96 100644
--- a/src/jcgp/fitness/TruthTableEvaluator.java
+++ b/src/jcgp/modules/fitness/TruthTableEvaluator.java
@@ -1,7 +1,7 @@
-package jcgp.fitness;
+package jcgp.modules.fitness;
-import jcgp.Parameters;
import jcgp.TruthTable;
+import jcgp.parameters.Parameters;
import jcgp.population.Population;
public class TruthTableEvaluator implements FitnessFunction {
diff --git a/src/jcgp/function/Arithmetic.java b/src/jcgp/modules/function/Arithmetic.java
index b0bd5ca..73debd2 100644
--- a/src/jcgp/function/Arithmetic.java
+++ b/src/jcgp/modules/function/Arithmetic.java
@@ -1,7 +1,7 @@
-package jcgp.function;
+package jcgp.modules.function;
-import jcgp.Parameters;
import jcgp.exceptions.InvalidArgumentsException;
+import jcgp.parameters.Parameters;
import jcgp.population.Connection;
public class Arithmetic {
diff --git a/src/jcgp/function/BitwiseLogic.java b/src/jcgp/modules/function/BitwiseLogic.java
index 55f5df0..a260715 100644
--- a/src/jcgp/function/BitwiseLogic.java
+++ b/src/jcgp/modules/function/BitwiseLogic.java
@@ -1,7 +1,7 @@
-package jcgp.function;
+package jcgp.modules.function;
-import jcgp.Parameters;
import jcgp.exceptions.InvalidArgumentsException;
+import jcgp.parameters.Parameters;
import jcgp.population.Connection;
public class BitwiseLogic {
diff --git a/src/jcgp/function/BooleanLogic.java b/src/jcgp/modules/function/BooleanLogic.java
index 713dcf8..887e0e6 100644
--- a/src/jcgp/function/BooleanLogic.java
+++ b/src/jcgp/modules/function/BooleanLogic.java
@@ -1,7 +1,7 @@
-package jcgp.function;
+package jcgp.modules.function;
-import jcgp.Parameters;
import jcgp.exceptions.InvalidArgumentsException;
+import jcgp.parameters.Parameters;
import jcgp.population.Connection;
public class BooleanLogic {
diff --git a/src/jcgp/function/Function.java b/src/jcgp/modules/function/Function.java
index 584421a..3314c2f 100644
--- a/src/jcgp/function/Function.java
+++ b/src/jcgp/modules/function/Function.java
@@ -1,4 +1,4 @@
-package jcgp.function;
+package jcgp.modules.function;
import jcgp.exceptions.InvalidArgumentsException;
import jcgp.population.Connection;
diff --git a/src/jcgp/function/FunctionSet.java b/src/jcgp/modules/function/FunctionSet.java
index cbe2f05..8a2190a 100644
--- a/src/jcgp/function/FunctionSet.java
+++ b/src/jcgp/modules/function/FunctionSet.java
@@ -1,4 +1,4 @@
-package jcgp.function;
+package jcgp.modules.function;
/**
*
diff --git a/src/jcgp/ea/Mutator.java b/src/jcgp/modules/mutator/Mutator.java
index df3fe1c..10df8cd 100644
--- a/src/jcgp/ea/Mutator.java
+++ b/src/jcgp/modules/mutator/Mutator.java
@@ -1,4 +1,4 @@
-package jcgp.ea;
+package jcgp.modules.mutator;
import jcgp.population.Chromosome;
diff --git a/src/jcgp/ea/StandardMutator.java b/src/jcgp/modules/mutator/StandardMutator.java
index b9c0a4e..17bd0be 100644
--- a/src/jcgp/ea/StandardMutator.java
+++ b/src/jcgp/modules/mutator/StandardMutator.java
@@ -1,7 +1,7 @@
-package jcgp.ea;
+package jcgp.modules.mutator;
-import jcgp.Parameters;
import jcgp.Utilities;
+import jcgp.parameters.Parameters;
import jcgp.population.Chromosome;
import jcgp.population.MutableElement;
import jcgp.population.Node;
diff --git a/src/jcgp/parameters/BooleanParameter.java b/src/jcgp/parameters/BooleanParameter.java
new file mode 100644
index 0000000..738b733
--- /dev/null
+++ b/src/jcgp/parameters/BooleanParameter.java
@@ -0,0 +1,32 @@
+package jcgp.parameters;
+
+import javafx.beans.property.SimpleBooleanProperty;
+
+public class BooleanParameter extends Parameter {
+
+ private SimpleBooleanProperty value;
+
+ public BooleanParameter(boolean value) {
+
+ this.value.set(value);
+
+ }
+
+ public BooleanParameter(boolean value, boolean managed) {
+ this.value.set(value);
+ this.managed = managed;
+ }
+
+ public void setValue(boolean value) {
+ this.value.set(value);
+ }
+
+ public boolean getValue() {
+ return this.value.get();
+ }
+
+ public SimpleBooleanProperty valueProperty() {
+ return value;
+ }
+
+}
diff --git a/src/jcgp/parameters/DoubleParameter.java b/src/jcgp/parameters/DoubleParameter.java
new file mode 100644
index 0000000..9349502
--- /dev/null
+++ b/src/jcgp/parameters/DoubleParameter.java
@@ -0,0 +1,32 @@
+package jcgp.parameters;
+
+import javafx.beans.property.SimpleDoubleProperty;
+
+public class DoubleParameter extends Parameter {
+
+ private SimpleDoubleProperty value;
+
+ public DoubleParameter(double value) {
+
+ this.value.set(value);
+
+ }
+
+ public DoubleParameter(double value, boolean managed) {
+ this.value.set(value);
+ this.managed = managed;
+ }
+
+ public void setValue(double value) {
+ this.value.set(value);
+ }
+
+ public double getValue() {
+ return this.value.get();
+ }
+
+ public SimpleDoubleProperty valueProperty() {
+ return value;
+ }
+
+}
diff --git a/src/jcgp/parameters/IntegerParameter.java b/src/jcgp/parameters/IntegerParameter.java
new file mode 100644
index 0000000..2aac3e1
--- /dev/null
+++ b/src/jcgp/parameters/IntegerParameter.java
@@ -0,0 +1,32 @@
+package jcgp.parameters;
+
+import javafx.beans.property.SimpleIntegerProperty;
+
+public class IntegerParameter extends Parameter {
+
+ private SimpleIntegerProperty value;
+
+ public IntegerParameter(int value) {
+
+ this.value.set(value);
+
+ }
+
+ public IntegerParameter(int value, boolean managed) {
+ this.value.set(value);
+ this.managed = managed;
+ }
+
+ public void setValue(int value) {
+ this.value.set(value);
+ }
+
+ public int getValue() {
+ return this.value.get();
+ }
+
+ public SimpleIntegerProperty valueProperty() {
+ return value;
+ }
+
+}
diff --git a/src/jcgp/parameters/Parameter.java b/src/jcgp/parameters/Parameter.java
new file mode 100644
index 0000000..8b63868
--- /dev/null
+++ b/src/jcgp/parameters/Parameter.java
@@ -0,0 +1,22 @@
+package jcgp.parameters;
+
+public abstract class Parameter {
+ protected boolean managed = false;
+ protected boolean hidden = false;
+
+ public void setManaged(boolean value) {
+ managed = value;
+ }
+
+ public boolean isManaged() {
+ return managed;
+ }
+
+ public void setHidden(boolean value) {
+ hidden = value;
+ }
+
+ public boolean isHidden() {
+ return hidden;
+ }
+}
diff --git a/src/jcgp/parameters/Parameters.java b/src/jcgp/parameters/Parameters.java
new file mode 100644
index 0000000..54b54e3
--- /dev/null
+++ b/src/jcgp/parameters/Parameters.java
@@ -0,0 +1,31 @@
+package jcgp.parameters;
+
+import java.util.HashMap;
+
+public class Parameters {
+
+ private static HashMap<String, Parameter> parameters;
+
+ public static void add(String key, Parameter value) {
+ parameters.put(key, value);
+ }
+
+ public static Parameter get(String key) {
+ return parameters.get(key);
+ }
+
+ public static boolean contains(String key) {
+ return parameters.containsKey(key);
+ }
+
+// private static int rows = 0, columns = 0, inputs = 0, outputs = 0, levelsBack = 0,
+// mutationRate = 0, totalGenerations = 0, parents = 0, offspring = 0,
+// currentGeneration = 0, totalRuns = 0, currentRun = 0,
+// maxArity = 0, maxFitness = 0;
+
+// private static boolean debug = false;
+
+
+
+
+}
diff --git a/src/jcgp/population/Chromosome.java b/src/jcgp/population/Chromosome.java
index 996e765..df2a9d4 100644
--- a/src/jcgp/population/Chromosome.java
+++ b/src/jcgp/population/Chromosome.java
@@ -2,9 +2,9 @@ package jcgp.population;
import java.util.ArrayList;
-import jcgp.Parameters;
import jcgp.Utilities;
import jcgp.exceptions.ParameterMismatchException;
+import jcgp.parameters.Parameters;
public class Chromosome {
diff --git a/src/jcgp/population/Node.java b/src/jcgp/population/Node.java
index 1741235..4203f25 100644
--- a/src/jcgp/population/Node.java
+++ b/src/jcgp/population/Node.java
@@ -3,10 +3,10 @@ package jcgp.population;
import java.util.ArrayList;
import java.util.Arrays;
-import jcgp.Parameters;
import jcgp.Utilities;
import jcgp.exceptions.InsufficientConnectionsException;
-import jcgp.function.Function;
+import jcgp.modules.function.Function;
+import jcgp.parameters.Parameters;
public class Node implements MutableElement, Connection {
diff --git a/src/jcgp/population/Output.java b/src/jcgp/population/Output.java
index 0df51e9..89ca13c 100644
--- a/src/jcgp/population/Output.java
+++ b/src/jcgp/population/Output.java
@@ -2,7 +2,7 @@ package jcgp.population;
import java.util.ArrayList;
-import jcgp.Parameters;
+import jcgp.parameters.Parameters;
public class Output implements MutableElement {
diff --git a/src/jcgp/population/Population.java b/src/jcgp/population/Population.java
index 9cd7430..3e7b590 100644
--- a/src/jcgp/population/Population.java
+++ b/src/jcgp/population/Population.java
@@ -1,6 +1,6 @@
package jcgp.population;
-import jcgp.Parameters;
+import jcgp.parameters.Parameters;
public class Population {
diff --git a/src/jcgp/tests/ChromosomeTests.java b/src/jcgp/tests/ChromosomeTests.java
index 46463c5..c61785e 100644
--- a/src/jcgp/tests/ChromosomeTests.java
+++ b/src/jcgp/tests/ChromosomeTests.java
@@ -4,10 +4,10 @@ import static org.junit.Assert.*;
import java.util.Random;
-import jcgp.Parameters;
import jcgp.Utilities;
-import jcgp.function.Arithmetic;
-import jcgp.function.FunctionSet;
+import jcgp.modules.function.Arithmetic;
+import jcgp.modules.function.FunctionSet;
+import jcgp.parameters.Parameters;
import jcgp.population.Chromosome;
import jcgp.population.Connection;
import jcgp.population.Input;
diff --git a/src/jcgp/tests/NodeTests.java b/src/jcgp/tests/NodeTests.java
index ee26d38..74b8140 100644
--- a/src/jcgp/tests/NodeTests.java
+++ b/src/jcgp/tests/NodeTests.java
@@ -4,10 +4,10 @@ import static org.junit.Assert.assertTrue;
import java.util.Random;
-import jcgp.Parameters;
import jcgp.Utilities;
-import jcgp.function.Arithmetic;
-import jcgp.function.Function;
+import jcgp.modules.function.Arithmetic;
+import jcgp.modules.function.Function;
+import jcgp.parameters.Parameters;
import jcgp.population.Chromosome;
import jcgp.population.Connection;
import jcgp.population.Node;
diff --git a/src/jcgp/tests/OutputTests.java b/src/jcgp/tests/OutputTests.java
index 20e1c7f..b8f7d96 100644
--- a/src/jcgp/tests/OutputTests.java
+++ b/src/jcgp/tests/OutputTests.java
@@ -4,8 +4,8 @@ import static org.junit.Assert.assertTrue;
import java.util.Random;
-import jcgp.Parameters;
import jcgp.Utilities;
+import jcgp.parameters.Parameters;
import jcgp.population.Chromosome;
import jcgp.population.Connection;
import jcgp.population.Output;
diff --git a/src/jcgp/tests/PopulationTests.java b/src/jcgp/tests/PopulationTests.java
index a6ab141..d646b90 100644
--- a/src/jcgp/tests/PopulationTests.java
+++ b/src/jcgp/tests/PopulationTests.java
@@ -4,10 +4,10 @@ import static org.junit.Assert.*;
import java.util.Random;
-import jcgp.Parameters;
import jcgp.Utilities;
-import jcgp.function.Arithmetic;
-import jcgp.function.FunctionSet;
+import jcgp.modules.function.Arithmetic;
+import jcgp.modules.function.FunctionSet;
+import jcgp.parameters.Parameters;
import jcgp.population.Chromosome;
import jcgp.population.Population;