From 226365bd6a0f56143ffbce7379857ff3e126fbaf Mon Sep 17 00:00:00 2001 From: Eduardo Pedroni Date: Mon, 7 Apr 2014 15:58:30 +0100 Subject: Refactoring resources for (hopefully) the last time --- src/jcgp/backend/modules/Module.java | 2 +- .../backend/modules/ea/EvolutionaryAlgorithm.java | 14 --- src/jcgp/backend/modules/ea/MuPlusLambda.java | 98 -------------------- .../backend/modules/ea/TournamentSelection.java | 53 ----------- .../backend/modules/es/EvolutionaryStrategy.java | 14 +++ src/jcgp/backend/modules/es/MuPlusLambda.java | 103 +++++++++++++++++++++ .../backend/modules/es/TournamentSelection.java | 53 +++++++++++ .../backend/modules/fitness/DigitalCircuit.java | 5 +- .../modules/fitness/SymbolicRegression.java | 5 +- .../backend/modules/fitness/TestCaseProblem.java | 4 +- src/jcgp/backend/modules/mutator/Mutator.java | 2 +- src/jcgp/backend/modules/mutator/PointMutator.java | 32 ++++++- src/jcgp/backend/population/Chromosome.java | 4 +- src/jcgp/backend/population/Connection.java | 2 - src/jcgp/backend/population/Input.java | 4 +- src/jcgp/backend/population/Node.java | 4 +- src/jcgp/backend/population/Output.java | 10 +- .../backend/resources/ModifiableResources.java | 17 ++++ src/jcgp/backend/resources/Resources.java | 36 ++++--- src/jcgp/backend/tests/NodeTests.java | 34 ------- src/jcgp/backend/tests/OutputTests.java | 12 --- 21 files changed, 253 insertions(+), 255 deletions(-) delete mode 100644 src/jcgp/backend/modules/ea/EvolutionaryAlgorithm.java delete mode 100644 src/jcgp/backend/modules/ea/MuPlusLambda.java delete mode 100644 src/jcgp/backend/modules/ea/TournamentSelection.java create mode 100644 src/jcgp/backend/modules/es/EvolutionaryStrategy.java create mode 100644 src/jcgp/backend/modules/es/MuPlusLambda.java create mode 100644 src/jcgp/backend/modules/es/TournamentSelection.java (limited to 'src/jcgp/backend') diff --git a/src/jcgp/backend/modules/Module.java b/src/jcgp/backend/modules/Module.java index f2b91b0..8a95737 100644 --- a/src/jcgp/backend/modules/Module.java +++ b/src/jcgp/backend/modules/Module.java @@ -4,6 +4,6 @@ import jcgp.backend.resources.parameters.Parameter; public interface Module { - public Parameter[] getLocalParameters(); + public abstract Parameter[] getLocalParameters(); } diff --git a/src/jcgp/backend/modules/ea/EvolutionaryAlgorithm.java b/src/jcgp/backend/modules/ea/EvolutionaryAlgorithm.java deleted file mode 100644 index 3aca104..0000000 --- a/src/jcgp/backend/modules/ea/EvolutionaryAlgorithm.java +++ /dev/null @@ -1,14 +0,0 @@ -package jcgp.backend.modules.ea; - -import jcgp.backend.modules.Module; -import jcgp.backend.modules.mutator.Mutator; -import jcgp.backend.population.Population; -import jcgp.backend.resources.Resources; - -public interface EvolutionaryAlgorithm extends Module { - - public abstract void evolve(Population population, Mutator mutator, Resources parameters); - - public abstract int getFittestChromosome(); - -} diff --git a/src/jcgp/backend/modules/ea/MuPlusLambda.java b/src/jcgp/backend/modules/ea/MuPlusLambda.java deleted file mode 100644 index 0d16111..0000000 --- a/src/jcgp/backend/modules/ea/MuPlusLambda.java +++ /dev/null @@ -1,98 +0,0 @@ -package jcgp.backend.modules.ea; - -import jcgp.backend.modules.mutator.Mutator; -import jcgp.backend.population.Population; -import jcgp.backend.resources.Resources; -import jcgp.backend.resources.parameters.BooleanParameter; -import jcgp.backend.resources.parameters.IntegerParameter; -import jcgp.backend.resources.parameters.Parameter; -import jcgp.backend.resources.parameters.ParameterStatus; - -/** - * (μ + λ) EA. - * - * - * @author Eduardo Pedroni - * - */ -public class MuPlusLambda implements EvolutionaryAlgorithm { - - private int fittestChromosome; - - private IntegerParameter parents, offspring; - private BooleanParameter report; - - public MuPlusLambda(final Resources resources) { - parents = new IntegerParameter(1, "Parents") { - @Override - public void validate(int newValue) { - if (newValue + offspring.get() != resources.getInt("popSize")) { - status = ParameterStatus.INVALID; - status.setDetails("Parents + offspring must equal population size."); - } else if (newValue <= 0) { - status = ParameterStatus.INVALID; - status.setDetails("EA needs at least 1 parent."); - } else { - status = ParameterStatus.VALID; - } - } - }; - offspring = new IntegerParameter(4, "Offspring") { - @Override - public void validate(int newValue) { - if (newValue + parents.get() != resources.getInt("popSize")) { - status = ParameterStatus.INVALID; - status.setDetails("Parents + offspring must equal population size."); - } else if (newValue <= 0) { - status = ParameterStatus.INVALID; - status.setDetails("EA needs at least 1 offspring."); - } else { - status = ParameterStatus.VALID; - } - } - }; - report = new BooleanParameter(false, "Report") { - @Override - public void validate(boolean newValue) { - // nothing - } - }; - } - - @Override - public void evolve(Population population, Mutator mutator, Resources resources) { - // select fittest chromosomes - fittestChromosome = 0; - - for (int i = 1; i < resources.getInt("popSize"); i++) { - if (population.getChromosome(i).getFitness() >= population.getChromosome(fittestChromosome).getFitness()) { - fittestChromosome = i; - } - } - - // create copies of fittest chromosome, mutate them - for (int i = 0; i < resources.getInt("popSize"); i++) { - if (i != fittestChromosome) { - population.copyChromosome(fittestChromosome, i); - mutator.mutate(population.getChromosome(i), resources); - } - } - - } - - @Override - public int getFittestChromosome() { - return fittestChromosome; - } - - @Override - public Parameter[] getLocalParameters() { - return new Parameter[] {parents, offspring, report}; - } - - @Override - public String toString() { - return "(μ + λ)"; - } - -} diff --git a/src/jcgp/backend/modules/ea/TournamentSelection.java b/src/jcgp/backend/modules/ea/TournamentSelection.java deleted file mode 100644 index baf6704..0000000 --- a/src/jcgp/backend/modules/ea/TournamentSelection.java +++ /dev/null @@ -1,53 +0,0 @@ -package jcgp.backend.modules.ea; - -import java.util.HashMap; - -import jcgp.backend.modules.mutator.Mutator; -import jcgp.backend.population.Population; -import jcgp.backend.resources.Resources; -import jcgp.backend.resources.parameters.IntegerParameter; -import jcgp.backend.resources.parameters.Parameter; - -public class TournamentSelection implements EvolutionaryAlgorithm { - - private int fittestChromosome; - - private IntegerParameter tournament; - private HashMap localParameters; - - public TournamentSelection() { - tournament = new IntegerParameter(1, "Tournament size") { - @Override - public void validate(int newValue) { - // TODO this - } - }; - - localParameters = new HashMap(); - localParameters.put("tournament", tournament); - } - - @Override - public Parameter[] getLocalParameters() { - return new Parameter[] {tournament}; - } - - @Override - public void evolve(Population population, Mutator mutator, - Resources parameters) { - tournament.set(tournament.get() + 1); - fittestChromosome = 0; - // TODO implement this - - } - - @Override - public int getFittestChromosome() { - return fittestChromosome; - } - - @Override - public String toString() { - return "Tournament"; - } -} diff --git a/src/jcgp/backend/modules/es/EvolutionaryStrategy.java b/src/jcgp/backend/modules/es/EvolutionaryStrategy.java new file mode 100644 index 0000000..1117e99 --- /dev/null +++ b/src/jcgp/backend/modules/es/EvolutionaryStrategy.java @@ -0,0 +1,14 @@ +package jcgp.backend.modules.es; + +import jcgp.backend.modules.Module; +import jcgp.backend.modules.mutator.Mutator; +import jcgp.backend.population.Population; +import jcgp.backend.resources.Resources; + +public interface EvolutionaryStrategy extends Module { + + public abstract void evolve(Population population, Mutator mutator, Resources resources); + + public abstract int getFittestChromosome(); + +} diff --git a/src/jcgp/backend/modules/es/MuPlusLambda.java b/src/jcgp/backend/modules/es/MuPlusLambda.java new file mode 100644 index 0000000..53fb932 --- /dev/null +++ b/src/jcgp/backend/modules/es/MuPlusLambda.java @@ -0,0 +1,103 @@ +package jcgp.backend.modules.es; + +import jcgp.backend.modules.mutator.Mutator; +import jcgp.backend.population.Population; +import jcgp.backend.resources.Resources; +import jcgp.backend.resources.parameters.BooleanParameter; +import jcgp.backend.resources.parameters.IntegerParameter; +import jcgp.backend.resources.parameters.Parameter; +import jcgp.backend.resources.parameters.ParameterStatus; + +/** + * (μ + λ) EA. + * + * + * @author Eduardo Pedroni + * + */ +public class MuPlusLambda implements EvolutionaryStrategy { + + private int fittestChromosome; + + private IntegerParameter parents, offspring; + private BooleanParameter report; + + public MuPlusLambda(final Resources resources) { + parents = new IntegerParameter(1, "Parents") { + @Override + public void validate(int newValue) { + if (newValue + offspring.get() != resources.getInt("popSize")) { + status = ParameterStatus.INVALID; + status.setDetails("Parents + offspring must equal population size."); + } else if (newValue <= 0) { + status = ParameterStatus.INVALID; + status.setDetails("EA needs at least 1 parent."); + } else { + status = ParameterStatus.VALID; + } + } + }; + offspring = new IntegerParameter(4, "Offspring") { + @Override + public void validate(int newValue) { + if (newValue + parents.get() != resources.getInt("popSize")) { + status = ParameterStatus.INVALID; + status.setDetails("Parents + offspring must equal population size."); + } else if (newValue <= 0) { + status = ParameterStatus.INVALID; + status.setDetails("EA needs at least 1 offspring."); + } else { + status = ParameterStatus.VALID; + } + } + }; + report = new BooleanParameter(false, "Report") { + @Override + public void validate(boolean newValue) { + // nothing + } + }; + } + + @Override + public void evolve(Population population, Mutator mutator, Resources resources) { + // select fittest chromosomes + fittestChromosome = 0; + + if (report.get()) resources.reportln("[ES] Selecting fittest chromosome..."); + for (int i = 0; i < resources.getInt("popSize"); i++) { + if (report.get()) resources.reportln("[ES] Chromosome " + i + ", fitness: " + population.getChromosome(i).getFitness()); + if (population.getChromosome(i).getFitness() >= population.getChromosome(fittestChromosome).getFitness()) { + fittestChromosome = i; + } + } + if (report.get()) resources.reportln("[ES] Selected chromosome: " + fittestChromosome); + + // create copies of fittest chromosome, mutate them + for (int i = 0; i < resources.getInt("popSize"); i++) { + if (i != fittestChromosome) { + if (report.get()) resources.reportln("[ES] Copying fittest chromosome to population position " + i); + population.copyChromosome(fittestChromosome, i); + if (report.get()) resources.reportln("[ES] Mutating copied chromosome"); + mutator.mutate(population.getChromosome(i), resources); + } + } + + } + + @Override + public int getFittestChromosome() { + return fittestChromosome; + } + + @Override + public Parameter[] getLocalParameters() { + return new Parameter[] {parents, offspring, report}; + } + + @Override + public String toString() { + return "(μ + λ)"; + } + +} diff --git a/src/jcgp/backend/modules/es/TournamentSelection.java b/src/jcgp/backend/modules/es/TournamentSelection.java new file mode 100644 index 0000000..3954de8 --- /dev/null +++ b/src/jcgp/backend/modules/es/TournamentSelection.java @@ -0,0 +1,53 @@ +package jcgp.backend.modules.es; + +import java.util.HashMap; + +import jcgp.backend.modules.mutator.Mutator; +import jcgp.backend.population.Population; +import jcgp.backend.resources.Resources; +import jcgp.backend.resources.parameters.IntegerParameter; +import jcgp.backend.resources.parameters.Parameter; + +public class TournamentSelection implements EvolutionaryStrategy { + + private int fittestChromosome; + + private IntegerParameter tournament; + private HashMap localParameters; + + public TournamentSelection() { + tournament = new IntegerParameter(1, "Tournament size") { + @Override + public void validate(int newValue) { + // TODO this + } + }; + + localParameters = new HashMap(); + localParameters.put("tournament", tournament); + } + + @Override + public Parameter[] getLocalParameters() { + return new Parameter[] {tournament}; + } + + @Override + public void evolve(Population population, Mutator mutator, + Resources parameters) { + tournament.set(tournament.get() + 1); + fittestChromosome = 0; + // TODO implement this + + } + + @Override + public int getFittestChromosome() { + return fittestChromosome; + } + + @Override + public String toString() { + return "Tournament"; + } +} diff --git a/src/jcgp/backend/modules/fitness/DigitalCircuit.java b/src/jcgp/backend/modules/fitness/DigitalCircuit.java index b01bdc5..8677d5f 100644 --- a/src/jcgp/backend/modules/fitness/DigitalCircuit.java +++ b/src/jcgp/backend/modules/fitness/DigitalCircuit.java @@ -1,11 +1,12 @@ package jcgp.backend.modules.fitness; import jcgp.backend.function.BitwiseLogic; +import jcgp.backend.resources.Resources; public class DigitalCircuit extends TestCaseProblem { - public DigitalCircuit() { - super(); + public DigitalCircuit(Resources resources) { + super(resources); functionSet = new BitwiseLogic(); } diff --git a/src/jcgp/backend/modules/fitness/SymbolicRegression.java b/src/jcgp/backend/modules/fitness/SymbolicRegression.java index da2e69e..cb9d1a7 100644 --- a/src/jcgp/backend/modules/fitness/SymbolicRegression.java +++ b/src/jcgp/backend/modules/fitness/SymbolicRegression.java @@ -1,11 +1,12 @@ package jcgp.backend.modules.fitness; import jcgp.backend.function.IntegerArithmetic; +import jcgp.backend.resources.Resources; public class SymbolicRegression extends TestCaseProblem { - public SymbolicRegression() { - super(); + public SymbolicRegression(Resources resources) { + super(resources); functionSet = new IntegerArithmetic(); } diff --git a/src/jcgp/backend/modules/fitness/TestCaseProblem.java b/src/jcgp/backend/modules/fitness/TestCaseProblem.java index 7753e26..4259285 100644 --- a/src/jcgp/backend/modules/fitness/TestCaseProblem.java +++ b/src/jcgp/backend/modules/fitness/TestCaseProblem.java @@ -51,7 +51,9 @@ public abstract class TestCaseProblem extends Problem { private ArrayList> testCases; private IntegerParameter maxFitness; - public TestCaseProblem() { + public TestCaseProblem(Resources resources) { + super(); + maxFitness = new IntegerParameter(0, "Max fitness", true, false) { @Override public void validate(int newValue) { diff --git a/src/jcgp/backend/modules/mutator/Mutator.java b/src/jcgp/backend/modules/mutator/Mutator.java index ffdd35c..1d5b99a 100644 --- a/src/jcgp/backend/modules/mutator/Mutator.java +++ b/src/jcgp/backend/modules/mutator/Mutator.java @@ -6,6 +6,6 @@ import jcgp.backend.resources.Resources; public interface Mutator extends Module { - void mutate(Chromosome chromosome, Resources parameters); + void mutate(Chromosome chromosome, Resources resources); } diff --git a/src/jcgp/backend/modules/mutator/PointMutator.java b/src/jcgp/backend/modules/mutator/PointMutator.java index 54d5f3d..1f38cfe 100644 --- a/src/jcgp/backend/modules/mutator/PointMutator.java +++ b/src/jcgp/backend/modules/mutator/PointMutator.java @@ -1,11 +1,11 @@ package jcgp.backend.modules.mutator; -import jcgp.backend.function.Function; import jcgp.backend.population.Chromosome; import jcgp.backend.population.MutableElement; import jcgp.backend.population.Node; import jcgp.backend.population.Output; import jcgp.backend.resources.Resources; +import jcgp.backend.resources.parameters.BooleanParameter; import jcgp.backend.resources.parameters.DoubleParameter; import jcgp.backend.resources.parameters.Parameter; import jcgp.backend.resources.parameters.ParameterStatus; @@ -13,6 +13,7 @@ import jcgp.backend.resources.parameters.ParameterStatus; public class PointMutator implements Mutator { private DoubleParameter mutationRate; + private BooleanParameter report; public PointMutator(final Resources resources) { mutationRate = new DoubleParameter(50, "Percent mutation", false, false) { @@ -29,23 +30,44 @@ public class PointMutator implements Mutator { } } }; + + report = new BooleanParameter(false, "Report") { + @Override + public void validate(boolean newValue) { + // blank + } + }; } @Override public void mutate(Chromosome chromosome, Resources resources) { int mutations = (int) ((mutationRate.get()) * ((((resources.getDouble("nodes")) + (resources.getDouble("outputs")))) / 100)); + if (report.get()) resources.reportln("[Mutator] Number of mutations to be performed: " + mutations); for (int i = 0; i < mutations; i++) { MutableElement m = chromosome.getRandomMutableElement(); + if (report.get()) resources.report("[Mutator] Mutation " + i + " selected " + m.toString() + ", "); if (m instanceof Output) { + if (report.get()) resources.report("changed source from " + ((Output) m).getSource().toString() + " "); + m.setConnection(0, chromosome.getRandomConnection()); + + if (report.get()) resources.reportln("to " + ((Output) m).getSource().toString()); } else if (m instanceof Node) { int geneType = resources.getRandomInt(1 + resources.getInt("arity")); if (geneType < 1) { - Function f = resources.getRandomFunction(); - ((Node) m).setFunction(f); + if (report.get()) resources.report("changed function from " + ((Node) m).getFunction().getName() + " "); + + ((Node) m).setFunction(resources.getRandomFunction()); + + if (report.get()) resources.reportln("to " + ((Node) m).getFunction().getName()); } else { - m.setConnection(resources.getRandomInt(resources.getInt("arity")), chromosome.getRandomConnection(((Node) m).getColumn())); + int connection = resources.getRandomInt(resources.getInt("arity")); + if (report.get()) resources.report("changed connection " + connection + " from " + ((Node) m).getConnection(connection) + " "); + + m.setConnection(connection, chromosome.getRandomConnection(((Node) m).getColumn())); + + if (report.get()) resources.reportln("to " + ((Node) m).getConnection(connection)); } } } @@ -53,7 +75,7 @@ public class PointMutator implements Mutator { @Override public Parameter[] getLocalParameters() { - return new Parameter[] {mutationRate}; + return new Parameter[] {mutationRate, report}; } @Override diff --git a/src/jcgp/backend/population/Chromosome.java b/src/jcgp/backend/population/Chromosome.java index d438375..bbada14 100644 --- a/src/jcgp/backend/population/Chromosome.java +++ b/src/jcgp/backend/population/Chromosome.java @@ -318,7 +318,7 @@ public class Chromosome { for (int c = 0; c < (resources.getInt("columns")); c++) { System.out.print("N: (" + r + ", " + c + ") "); for (int i = 0; i < arity; i++) { - System.out.print("C" + i + ": (" + nodes[r][c].getConnection(i).getDescription() + ") "); + System.out.print("C" + i + ": (" + nodes[r][c].getConnection(i).toString() + ") "); } System.out.print("F: " + nodes[r][c].getFunction().getName() + "\t"); } @@ -326,7 +326,7 @@ public class Chromosome { } for (int o = 0; o < (resources.getInt("outputs")); o++) { - System.out.print("o: " + o + " (" + outputs[o].getSource().getDescription() + ")\t"); + System.out.print("o: " + o + " (" + outputs[o].getSource().toString() + ")\t"); } } diff --git a/src/jcgp/backend/population/Connection.java b/src/jcgp/backend/population/Connection.java index ea4f10f..cd0f5ce 100644 --- a/src/jcgp/backend/population/Connection.java +++ b/src/jcgp/backend/population/Connection.java @@ -3,7 +3,5 @@ package jcgp.backend.population; public interface Connection { public Object getValue(); - - public String getDescription(); } diff --git a/src/jcgp/backend/population/Input.java b/src/jcgp/backend/population/Input.java index 83fba07..2661f8c 100644 --- a/src/jcgp/backend/population/Input.java +++ b/src/jcgp/backend/population/Input.java @@ -23,7 +23,7 @@ public class Input extends Gene implements Connection { } @Override - public String getDescription() { - return "i: " + index; + public String toString() { + return "Input " + index; } } diff --git a/src/jcgp/backend/population/Node.java b/src/jcgp/backend/population/Node.java index 6960ded..87a2f99 100644 --- a/src/jcgp/backend/population/Node.java +++ b/src/jcgp/backend/population/Node.java @@ -106,7 +106,7 @@ public class Node extends Gene implements MutableElement, Connection { } @Override - public String getDescription() { - return "n: " + row + ", " + column; + public String toString() { + return "Node [" + row + ", " + column + "]"; } } diff --git a/src/jcgp/backend/population/Output.java b/src/jcgp/backend/population/Output.java index aa94ab6..d876951 100644 --- a/src/jcgp/backend/population/Output.java +++ b/src/jcgp/backend/population/Output.java @@ -11,7 +11,6 @@ public class Output extends Gene implements MutableElement { public Output(Chromosome chromosome, int index) { this.chromosome = chromosome; this.index = index; - //this.source = new SimpleObjectProperty(); } public Object calculate() { @@ -32,10 +31,6 @@ public class Output extends Gene implements MutableElement { public Connection getSource() { return source; } - -// public SimpleObjectProperty sourceProperty() { -// return source; -// } public void getActiveNodes(ArrayList activeNodes) { if (source instanceof Node) { @@ -66,4 +61,9 @@ public class Output extends Gene implements MutableElement { } return false; } + + @Override + public String toString() { + return "Output " + index; + } } diff --git a/src/jcgp/backend/resources/ModifiableResources.java b/src/jcgp/backend/resources/ModifiableResources.java index 90c2f03..a221f73 100644 --- a/src/jcgp/backend/resources/ModifiableResources.java +++ b/src/jcgp/backend/resources/ModifiableResources.java @@ -40,4 +40,21 @@ public class ModifiableResources extends Resources { this.console = console; } + /* + * Console functionality + */ + public void println(String s) { + System.out.println(s); + if (console != null) { + console.println(s); + } + } + + public void print(String s) { + System.out.print(s); + if (console != null) { + console.print(s); + } + } + } diff --git a/src/jcgp/backend/resources/Resources.java b/src/jcgp/backend/resources/Resources.java index d1f396a..13e0c51 100644 --- a/src/jcgp/backend/resources/Resources.java +++ b/src/jcgp/backend/resources/Resources.java @@ -266,31 +266,29 @@ public class Resources { return functionSet; } -// /* -// * Test cases -// */ -// public TestCase getTestCase(int index) { -// return testCases[index]; -// } -// -// public int getTestCaseCount() { -// return testCases.length; -// } - /* * Console functionality + * These are affected by parameter report */ - public void println(String s) { - System.out.println(s); - if (console != null) { - console.println(s); + public void reportln(String s) { + if (getInt("report") > 0) { + if (getInt("currentGen") % getInt("report") == 0) { + System.out.println(s); + if (console != null) { + console.println(s); + } + } } } - public void print(String s) { - System.out.print(s); - if (console != null) { - console.print(s); + public void report(String s) { + if (getInt("report") > 0) { + if (getInt("currentGen") % getInt("report") == 0) { + System.out.print(s); + if (console != null) { + console.print(s); + } + } } } } \ No newline at end of file diff --git a/src/jcgp/backend/tests/NodeTests.java b/src/jcgp/backend/tests/NodeTests.java index 2294816..e8fe02f 100644 --- a/src/jcgp/backend/tests/NodeTests.java +++ b/src/jcgp/backend/tests/NodeTests.java @@ -57,13 +57,6 @@ public class NodeTests { // hardcode a value return arg1; } - - @Override - public String getDescription() { - // blank - return null; - } - }, new Connection() { @@ -72,13 +65,6 @@ public class NodeTests { // hardcode a value return arg2; } - - @Override - public String getDescription() { - // blank - return null; - } - }}); } @@ -144,13 +130,6 @@ public class NodeTests { // blank return 0; } - - @Override - public String getDescription() { - // blank - return null; - } - }; conn1 = new Connection() { @@ -159,13 +138,6 @@ public class NodeTests { // blank return 0; } - - @Override - public String getDescription() { - // blank - return null; - } - }; Function function = new Function() { @@ -201,12 +173,6 @@ public class NodeTests { // blank return 0; } - - @Override - public String getDescription() { - // blank - return null; - } }; node.setConnection(resources.getRandomInt(resources.getInt("arity")), conn2); diff --git a/src/jcgp/backend/tests/OutputTests.java b/src/jcgp/backend/tests/OutputTests.java index b2bc7ec..afe44a7 100644 --- a/src/jcgp/backend/tests/OutputTests.java +++ b/src/jcgp/backend/tests/OutputTests.java @@ -52,12 +52,6 @@ public class OutputTests { // test value return outputValue; } - - @Override - public String getDescription() { - // blank - return null; - } }); assertTrue("Incorrect evaluation.", ((Integer) output.calculate()) == outputValue); @@ -73,12 +67,6 @@ public class OutputTests { // blank return 0; } - - @Override - public String getDescription() { - // blank - return null; - } }; output.setConnection(0, newConn); -- cgit v1.2.3