From 8189116ea4b5db4675e31dfd04a5687d55e29262 Mon Sep 17 00:00:00 2001 From: Eduardo Pedroni Date: Tue, 6 May 2014 14:29:37 +0100 Subject: Added javadocs, made minor changes to the comments --- .../modules/problem/SymbolicRegressionProblem.html | 468 +++++++++++++++++++++ 1 file changed, 468 insertions(+) create mode 100644 doc/jcgp/backend/modules/problem/SymbolicRegressionProblem.html (limited to 'doc/jcgp/backend/modules/problem/SymbolicRegressionProblem.html') diff --git a/doc/jcgp/backend/modules/problem/SymbolicRegressionProblem.html b/doc/jcgp/backend/modules/problem/SymbolicRegressionProblem.html new file mode 100644 index 0000000..1ab3746 --- /dev/null +++ b/doc/jcgp/backend/modules/problem/SymbolicRegressionProblem.html @@ -0,0 +1,468 @@ + + + + + +SymbolicRegressionProblem + + + + + + + + +
+ + + + + + + +
+ + + +
+
jcgp.backend.modules.problem
+

Class SymbolicRegressionProblem

+
+
+ +
+
    +
  • +
    +
    +
    public class SymbolicRegressionProblem
    +extends TestCaseProblem<java.lang.Double>
    +
    Symbolic regression functions +

    + Using this problem type, regression problems can be solved. + parseData() must be used to load the desired function + data in the standard CGP .dat format. +

    + This problem uses quite a few parameters: +
      +
    • Error threshold: the maximum difference allowed between an + evolved output and the equivalent output from the problem data. + Outputs within the error threshold will be considered correct. + This is only used if hits is enabled.
    • +
    • Perfection threshold: if the fitness is calculated without + using the hits method, it is a decimal value. A solution is + considered perfect when the difference between its fitness and + the maximum possible fitness is within the perfection threshold.
    • +
    • Hits-based fitness: increment the fitness by 1 whenever the + chromosome output is within the error threshold.
    +
    +
    Author:
    +
    Eduardo Pedroni
    +
    See Also:
    +
    SymbolicRegressionFunctions
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        SymbolicRegressionProblem

        +
        public SymbolicRegressionProblem(Resources resources)
        +
        Creates a new instance of SymbolicRegressionProblem.
        +
        +
        Parameters:
        +
        resources - a reference to the experiment's resources.
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        evaluate

        +
        public void evaluate(Population population,
        +                     Resources resources)
        +
        Description copied from class: Problem
        +
        The most important method of the problem type. This is called once + per generation, when the new population has been generated. +

        + The basic functionality of this method is to loop through all chromosomes + in the population and decode them according to the problem type. The + fitness of each chromosome is then calculated using the problem data + or otherwise (subjective problem types such as art generation might + leave fitness evaluations up to the user) and assigned to the appropriate + chromosome. +

        + In addition, realisations of this method should update the value of + bestFitness as appropriate, since the value of this parameter is displayed + if a GUI is in use.
        +
        +
        Specified by:
        +
        evaluate in class Problem
        +
        Parameters:
        +
        population - the population to be evaluated.
        +
        resources - parameters and utilities for optional reference.
        +
        +
      • +
      + + + +
        +
      • +

        parseTestCase

        +
        public TestCaseProblem.TestCase<java.lang.Double> parseTestCase(java.lang.String[] inputs,
        +                                                                java.lang.String[] outputs)
        +
        Description copied from class: TestCaseProblem
        +
        This method is used internally by addTestCase() in order + to appropriately parse strings into the right data type for the + test cases. Since the data type is problem-dependent, subclasses must + implement this method. This method must return a built TestCase + object from the arguments given.
        +
        +
        Parameters:
        +
        inputs - the inputs represented as strings.
        +
        outputs - the outputs represented as strings.
        +
        Returns:
        +
        the parsed test case.
        +
        +
      • +
      + + + +
        +
      • +

        perfectSolutionFound

        +
        public int perfectSolutionFound(Population population)
        +
        Description copied from class: Problem
        +
        Used to assert whether a given population contains a perfect solution + to the problem. It is up to the problem to define what qualifies + a perfect solution, as some problems (subject ones such as music and + art evolution, for example) might not have perfect solutions at all.
        +
        +
        Specified by:
        +
        perfectSolutionFound in class Problem
        +
        Parameters:
        +
        population - the population to search through for a perfect chromosome.
        +
        Returns:
        +
        the perfect solution index, if one exits, -1 if no perfect solution was found.
        +
        +
      • +
      + + + +
        +
      • +

        hasImprovement

        +
        public int hasImprovement(Population population)
        +
        Description copied from class: Problem
        +
        Used to assert whether a given population has a chromosome that is an improvement over + the current best chromosome. A typical implementation of this method + will simply compare chromosome fitness values, though the problem type + is free to implement this in any way.
        +
        +
        Specified by:
        +
        hasImprovement in class Problem
        +
        Parameters:
        +
        population - the population potentially containing a fitter chromosome.
        +
        Returns:
        +
        the index of the first chromosome in the population that is an improvement, -1 if none is found.
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + -- cgit v1.2.3