aboutsummaryrefslogtreecommitdiffstats
path: root/src/jcgp/backend/modules/problem
diff options
context:
space:
mode:
Diffstat (limited to 'src/jcgp/backend/modules/problem')
-rw-r--r--src/jcgp/backend/modules/problem/Problem.java21
-rw-r--r--src/jcgp/backend/modules/problem/TestCaseProblem.java3
-rw-r--r--src/jcgp/backend/modules/problem/TravellingSalesmanProblem.java2
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
}