diff options
author | Eduardo Pedroni <ep625@york.ac.uk> | 2014-04-26 19:56:24 +0100 |
---|---|---|
committer | Eduardo Pedroni <ep625@york.ac.uk> | 2014-04-26 19:56:24 +0100 |
commit | 4c8de2402f2878cde7587c7f3bbf4ffaea86efd4 (patch) | |
tree | 29156510f648a2d9f8de4df3b2617d4a056e1d90 /src/jcgp/backend/modules/problem | |
parent | b0c0698e5503c2506217117bf144fde31e6f6601 (diff) |
Moved files around to different folders, and commented some more packages. Aiming to have the entire backend fully commented by the end of today
Diffstat (limited to 'src/jcgp/backend/modules/problem')
-rw-r--r-- | src/jcgp/backend/modules/problem/Problem.java | 21 | ||||
-rw-r--r-- | src/jcgp/backend/modules/problem/TestCaseProblem.java | 3 | ||||
-rw-r--r-- | src/jcgp/backend/modules/problem/TravellingSalesmanProblem.java | 2 |
3 files changed, 22 insertions, 4 deletions
diff --git a/src/jcgp/backend/modules/problem/Problem.java b/src/jcgp/backend/modules/problem/Problem.java index 07183ea..368d512 100644 --- a/src/jcgp/backend/modules/problem/Problem.java +++ b/src/jcgp/backend/modules/problem/Problem.java @@ -9,6 +9,25 @@ import jcgp.backend.population.Population; import jcgp.backend.resources.ModifiableResources; import jcgp.backend.resources.Resources; +/** + * Defines the general behaviour of a CGP problem. The primary function of Problem + * is to evaluate a population and assign + * <br><br> + * Parameters may be specified to control the implemented problem. Any parameters + * returned by {@code getLocalParameters()} should be displayed by the user interface, + * if it is being used. See {@link Parameter} for more information. + * <br><br> + * It is advisable to use {@code Resources.reportln()} and {@code Resources.report()} + * to print any relevant information. Note that reportln() and report() are affected + * by the report interval base parameter. Use {@code Resources.println()} and + * {@code Resources.print()} to print information regardless of the current generation. + * See {@link Resources} for more information. + * + * @see Module + * + * @author Eduardo Pedroni + * + */ public abstract class Problem implements Module { protected FunctionSet functionSet; @@ -23,7 +42,7 @@ public abstract class Problem implements Module { public abstract boolean isPerfectSolution(Chromosome fittest); - public abstract void parse(File file, ModifiableResources resources); + public abstract void parseProblemData(File file, ModifiableResources resources); public void setFileExtension(String fileExtension) { this.fileExtension = fileExtension; diff --git a/src/jcgp/backend/modules/problem/TestCaseProblem.java b/src/jcgp/backend/modules/problem/TestCaseProblem.java index 6c4a7dc..7ce0327 100644 --- a/src/jcgp/backend/modules/problem/TestCaseProblem.java +++ b/src/jcgp/backend/modules/problem/TestCaseProblem.java @@ -119,8 +119,7 @@ public abstract class TestCaseProblem<U extends Object> extends Problem { testCases.clear(); } - public void parse(File file, ModifiableResources resources) { - TestCaseParser.parseParameters(file, resources); + public void parseProblemData(File file, ModifiableResources resources) { TestCaseParser.parse(file, this, resources); } } diff --git a/src/jcgp/backend/modules/problem/TravellingSalesmanProblem.java b/src/jcgp/backend/modules/problem/TravellingSalesmanProblem.java index 6491ec6..8363ef8 100644 --- a/src/jcgp/backend/modules/problem/TravellingSalesmanProblem.java +++ b/src/jcgp/backend/modules/problem/TravellingSalesmanProblem.java @@ -36,7 +36,7 @@ public class TravellingSalesmanProblem extends Problem { } @Override - public void parse(File file, ModifiableResources resources) { + public void parseProblemData(File file, ModifiableResources resources) { // TODO Auto-generated method stub } |