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 --- doc/jcgp/backend/modules/problem/BestFitness.html | 341 ++++++++++++++ .../modules/problem/DigitalCircuitProblem.html | 455 ++++++++++++++++++ doc/jcgp/backend/modules/problem/Problem.html | 508 +++++++++++++++++++++ .../modules/problem/SymbolicRegressionProblem.html | 468 +++++++++++++++++++ .../modules/problem/TestCaseProblem.TestCase.html | 358 +++++++++++++++ .../backend/modules/problem/TestCaseProblem.html | 427 +++++++++++++++++ .../modules/problem/TravellingSalesmanProblem.html | 433 ++++++++++++++++++ .../modules/problem/class-use/BestFitness.html | 212 +++++++++ .../problem/class-use/DigitalCircuitProblem.html | 124 +++++ .../backend/modules/problem/class-use/Problem.html | 217 +++++++++ .../class-use/SymbolicRegressionProblem.html | 124 +++++ .../class-use/TestCaseProblem.TestCase.html | 249 ++++++++++ .../modules/problem/class-use/TestCaseProblem.html | 227 +++++++++ .../class-use/TravellingSalesmanProblem.html | 124 +++++ .../backend/modules/problem/package-frame.html | 28 ++ .../backend/modules/problem/package-summary.html | 188 ++++++++ doc/jcgp/backend/modules/problem/package-tree.html | 163 +++++++ doc/jcgp/backend/modules/problem/package-use.html | 305 +++++++++++++ 18 files changed, 4951 insertions(+) create mode 100644 doc/jcgp/backend/modules/problem/BestFitness.html create mode 100644 doc/jcgp/backend/modules/problem/DigitalCircuitProblem.html create mode 100644 doc/jcgp/backend/modules/problem/Problem.html create mode 100644 doc/jcgp/backend/modules/problem/SymbolicRegressionProblem.html create mode 100644 doc/jcgp/backend/modules/problem/TestCaseProblem.TestCase.html create mode 100644 doc/jcgp/backend/modules/problem/TestCaseProblem.html create mode 100644 doc/jcgp/backend/modules/problem/TravellingSalesmanProblem.html create mode 100644 doc/jcgp/backend/modules/problem/class-use/BestFitness.html create mode 100644 doc/jcgp/backend/modules/problem/class-use/DigitalCircuitProblem.html create mode 100644 doc/jcgp/backend/modules/problem/class-use/Problem.html create mode 100644 doc/jcgp/backend/modules/problem/class-use/SymbolicRegressionProblem.html create mode 100644 doc/jcgp/backend/modules/problem/class-use/TestCaseProblem.TestCase.html create mode 100644 doc/jcgp/backend/modules/problem/class-use/TestCaseProblem.html create mode 100644 doc/jcgp/backend/modules/problem/class-use/TravellingSalesmanProblem.html create mode 100644 doc/jcgp/backend/modules/problem/package-frame.html create mode 100644 doc/jcgp/backend/modules/problem/package-summary.html create mode 100644 doc/jcgp/backend/modules/problem/package-tree.html create mode 100644 doc/jcgp/backend/modules/problem/package-use.html (limited to 'doc/jcgp/backend/modules/problem') diff --git a/doc/jcgp/backend/modules/problem/BestFitness.html b/doc/jcgp/backend/modules/problem/BestFitness.html new file mode 100644 index 0000000..9578099 --- /dev/null +++ b/doc/jcgp/backend/modules/problem/BestFitness.html @@ -0,0 +1,341 @@ + + + + + +BestFitness + + + + + + + + +
+ + + + + + + +
+ + + +
+
jcgp.backend.modules.problem
+

Enum BestFitness

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.io.Serializable, java.lang.Comparable<BestFitness>
    +
    +
    +
    +
    public enum BestFitness
    +extends java.lang.Enum<BestFitness>
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Enum Constant Summary

      + + + + + + + + + + + +
      Enum Constants 
      Enum Constant and Description
      HIGH 
      LOW 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + +
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethod and Description
      static BestFitnessvalueOf(java.lang.String name) +
      Returns the enum constant of this type with the specified name.
      +
      static BestFitness[]values() +
      Returns an array containing the constants of this enum type, in +the order they are declared.
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Enum

        +compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +getClass, notify, notifyAll, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + + + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        values

        +
        public static BestFitness[] values()
        +
        Returns an array containing the constants of this enum type, in +the order they are declared. This method may be used to iterate +over the constants as follows: +
        +for (BestFitness c : BestFitness.values())
        +    System.out.println(c);
        +
        +
        +
        Returns:
        +
        an array containing the constants of this enum type, in the order they are declared
        +
        +
      • +
      + + + +
        +
      • +

        valueOf

        +
        public static BestFitness valueOf(java.lang.String name)
        +
        Returns the enum constant of this type with the specified name. +The string must match exactly an identifier used to declare an +enum constant in this type. (Extraneous whitespace characters are +not permitted.)
        +
        +
        Parameters:
        +
        name - the name of the enum constant to be returned.
        +
        Returns:
        +
        the enum constant with the specified name
        +
        Throws:
        +
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        +
        java.lang.NullPointerException - if the argument is null
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/doc/jcgp/backend/modules/problem/DigitalCircuitProblem.html b/doc/jcgp/backend/modules/problem/DigitalCircuitProblem.html new file mode 100644 index 0000000..d9d3011 --- /dev/null +++ b/doc/jcgp/backend/modules/problem/DigitalCircuitProblem.html @@ -0,0 +1,455 @@ + + + + + +DigitalCircuitProblem + + + + + + + + +
+ + + + + + + +
+ + + +
+
jcgp.backend.modules.problem
+

Class DigitalCircuitProblem

+
+
+ +
+
    +
  • +
    +
    +
    public class DigitalCircuitProblem
    +extends TestCaseProblem<UnsignedInteger>
    +
    Digital circuit problem +

    + Using this problem type, digital logic circuits can be evolved. + parseData() must be used to load the desired circuit + truth table in the standard CGP .plu format.
    +
    +
    Author:
    +
    Eduardo Pedroni
    +
    See Also:
    +
    DigitalCircuitFunctions
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        DigitalCircuitProblem

        +
        public DigitalCircuitProblem(Resources resources)
        +
        Construct a new instance of DigitalCircuitProblem.
        +
        +
        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<UnsignedInteger> 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.
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/doc/jcgp/backend/modules/problem/Problem.html b/doc/jcgp/backend/modules/problem/Problem.html new file mode 100644 index 0000000..0d08b2a --- /dev/null +++ b/doc/jcgp/backend/modules/problem/Problem.html @@ -0,0 +1,508 @@ + + + + + +Problem + + + + + + + + +
+ + + + + + + +
+ + + +
+
jcgp.backend.modules.problem
+

Class Problem

+
+
+ +
+
    +
  • +
    +
    Direct Known Subclasses:
    +
    TestCaseProblem
    +
    +
    +
    +
    public abstract class Problem
    +extends Module
    +
    Defines the general behaviour of a CGP problem. The primary function of Problem + is to evaluate a population and assign a fitness value to each chromosome. +
    + Problems are free to define whether better fitness means a higher or lower fitness value. + In some problem types, it is more convenient to treat fitness 0 as the best possible value. + This can be done by changing the fitness orientation to BestFitness.HIGH or BestFitness.LOW as appropriate. + Fitness orientation is set to high by default. +

    + When extending this class, the constructor should call a few methods in order to + properly construct the problem type: setFunctionSet(), setFileExtension() and setFitnessOrientation(), + with the respective arguments. As with all subclasses of Module, setName() and + registerParameters() should be used where appropriate as well. +

    + It is advisable to use Resources.reportln() and Resources.report() + to print any relevant information. Note that reportln() and report() are affected + by the report interval base parameter. Use Resources.println() and + Resources.print() to print information regardless of the current generation. + See Resources for more information.
    +
    +
    Author:
    +
    Eduardo Pedroni
    +
    See Also:
    +
    Module
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Problem

        +
        public Problem(Resources resources)
        +
        Initialises the two problem-wide parameters, maxFitness and bestFitness.
        +
        +
        Parameters:
        +
        resources - a reference to the experiment's resources.
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        evaluate

        +
        public abstract void evaluate(Population population,
        +                              Resources resources)
        +
        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.
        +
        +
        Parameters:
        +
        population - the population to be evaluated.
        +
        resources - parameters and utilities for optional reference.
        +
        +
      • +
      + + + +
        +
      • +

        perfectSolutionFound

        +
        public abstract int perfectSolutionFound(Population population)
        +
        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.
        +
        +
        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 abstract int hasImprovement(Population population)
        +
        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.
        +
        +
        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.
        +
        +
      • +
      + + + +
        +
      • +

        parseProblemData

        +
        public abstract void parseProblemData(java.io.File file,
        +                                      ModifiableResources resources)
        +
        Parses the specified file and uses the parsed data to + set up the problem type instance appropriately. Any necessary + resource changes can be performed using the provided ModifiableResources + instance. +

        + In addition, realisations of this method should update the value of + maxFitness where appropriate, as this may be displayed to the user + if a GUI is in use.
        +
        +
        Parameters:
        +
        file - the data file to parse.
        +
        resources - a modifiable reference to the experiment's resources.
        +
        +
      • +
      + + + +
        +
      • +

        getFunctionSet

        +
        public FunctionSet getFunctionSet()
        +
        +
        Returns:
        +
        the FunctionSet object used by this problem type.
        +
        +
      • +
      + + + +
        +
      • +

        getFileExtension

        +
        public java.lang.String getFileExtension()
        +
        +
        Returns:
        +
        the file extension accepted by this problem type for problem data files.
        +
        +
      • +
      + + + +
        +
      • +

        getFitnessOrientation

        +
        public BestFitness getFitnessOrientation()
        +
        +
        Returns:
        +
        the fitness orientation of this particular problem.
        +
        +
      • +
      + + + +
        +
      • +

        getBestFitness

        +
        public double getBestFitness()
        +
        +
        Returns:
        +
        the current best fitness, in other words, the fitness + value of the fittest chromosome in the current generation.
        +
        +
      • +
      + + + +
        +
      • +

        reset

        +
        public void reset()
        +
        Resets the bestFitness parameter.
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + 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.
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/doc/jcgp/backend/modules/problem/TestCaseProblem.TestCase.html b/doc/jcgp/backend/modules/problem/TestCaseProblem.TestCase.html new file mode 100644 index 0000000..5373cf2 --- /dev/null +++ b/doc/jcgp/backend/modules/problem/TestCaseProblem.TestCase.html @@ -0,0 +1,358 @@ + + + + + +TestCaseProblem.TestCase + + + + + + + + +
+ + + + + + + +
+ + + +
+
jcgp.backend.modules.problem
+

Class TestCaseProblem.TestCase<U>

+
+
+ +
+
    +
  • +
    +
    Type Parameters:
    +
    U - the data type of the test case.
    +
    +
    +
    Enclosing class:
    +
    TestCaseProblem<T>
    +
    +
    +
    +
    public static class TestCaseProblem.TestCase<U>
    +extends java.lang.Object
    +
    Basic data type for encapsulating test cases, it simply + contains arrays of inputs and outputs and associated getters.
    +
    +
    Author:
    +
    Eduardo Pedroni
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      TestCase(U[] inputs, + U[] outputs) +
      Creates a new test case, inputs and outputs + must be specified upon instantiation.
      +
      +
    • +
    + + +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + + + +
        +
      • +

        TestCase

        +
        public TestCase(U[] inputs,
        +                U[] outputs)
        +
        Creates a new test case, inputs and outputs + must be specified upon instantiation.
        +
        +
        Parameters:
        +
        inputs - the array of inputs.
        +
        outputs - the array of outputs.
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getInput

        +
        public U getInput(int index)
        +
        +
        Parameters:
        +
        index - the index to return.
        +
        Returns:
        +
        the indexed input.
        +
        +
      • +
      + + + +
        +
      • +

        getOutput

        +
        public U getOutput(int index)
        +
        +
        Parameters:
        +
        index - the index to return.
        +
        Returns:
        +
        the indexed output.
        +
        +
      • +
      + + + +
        +
      • +

        getInputs

        +
        public U[] getInputs()
        +
        +
        Returns:
        +
        the complete array of inputs.
        +
        +
      • +
      + + + +
        +
      • +

        getOutputs

        +
        public U[] getOutputs()
        +
        +
        Returns:
        +
        the complete array of outputs.
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/doc/jcgp/backend/modules/problem/TestCaseProblem.html b/doc/jcgp/backend/modules/problem/TestCaseProblem.html new file mode 100644 index 0000000..663bc0a --- /dev/null +++ b/doc/jcgp/backend/modules/problem/TestCaseProblem.html @@ -0,0 +1,427 @@ + + + + + +TestCaseProblem + + + + + + + + +
+ + + + + + + +
+ + + +
+
jcgp.backend.modules.problem
+

Class TestCaseProblem<T>

+
+
+ +
+
    +
  • +
    +
    Type Parameters:
    +
    T - the data type to be used by the TestCaseProblem.
    +
    +
    +
    Direct Known Subclasses:
    +
    DigitalCircuitProblem, SymbolicRegressionProblem
    +
    +
    +
    +
    public abstract class TestCaseProblem<T>
    +extends Problem
    +
    Abstract model for a problem that uses test cases. A test case + problem is any problem that compares the chromosome output to + an expected output taken from a table of input-output mappings. +

    + This class defines a basic data type for storing test cases, + TestCase, and provides core functionality to add and manipulate + test cases in the problem. A subclass of TestCaseProblem + must simply override parseTestCase() to convert parsed + problem data strings into the required data type (T).
    +
    +
    Author:
    +
    Eduardo Pedroni
    +
    See Also:
    +
    Problem
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        TestCaseProblem

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

      Method Detail

      + + + +
        +
      • +

        getTestCases

        +
        public javafx.collections.ObservableList<TestCaseProblem.TestCase<T>> getTestCases()
        +
        +
        Returns:
        +
        a list containing the test cases.
        +
        +
      • +
      + + + +
        +
      • +

        addTestCase

        +
        public final void addTestCase(java.lang.String[] inputs,
        +                              java.lang.String[] outputs)
        +
        Adds test cases to the problem instance as they get parsed from a + problem data file. This template method uses parseTestCase, which + must be implemented by subclasses.
        +
        +
        Parameters:
        +
        inputs - the inputs represented as strings.
        +
        outputs - the outputs represented as strings.
        +
        +
      • +
      + + + +
        +
      • +

        clearTestCases

        +
        public void clearTestCases()
        +
        Remove all test cases.
        +
      • +
      + + + +
        +
      • +

        parseProblemData

        +
        public void parseProblemData(java.io.File file,
        +                             ModifiableResources resources)
        +
        Description copied from class: Problem
        +
        Parses the specified file and uses the parsed data to + set up the problem type instance appropriately. Any necessary + resource changes can be performed using the provided ModifiableResources + instance. +

        + In addition, realisations of this method should update the value of + maxFitness where appropriate, as this may be displayed to the user + if a GUI is in use.
        +
        +
        Specified by:
        +
        parseProblemData in class Problem
        +
        Parameters:
        +
        file - the data file to parse.
        +
        resources - a modifiable reference to the experiment's resources.
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/doc/jcgp/backend/modules/problem/TravellingSalesmanProblem.html b/doc/jcgp/backend/modules/problem/TravellingSalesmanProblem.html new file mode 100644 index 0000000..4a2d0c9 --- /dev/null +++ b/doc/jcgp/backend/modules/problem/TravellingSalesmanProblem.html @@ -0,0 +1,433 @@ + + + + + +TravellingSalesmanProblem + + + + + + + + +
+ + + + + + + +
+ + + +
+
jcgp.backend.modules.problem
+

Class TravellingSalesmanProblem

+
+
+ +
+
    +
  • +
    +
    +
    public class TravellingSalesmanProblem
    +extends Problem
    +
    Travelling salesman problem +

    + Using this problem type, travelling salesman tours can be evolved. + parseData() must be used to load the desired city + coordinates in the standard .tsp format.
    +
    +
    Author:
    +
    Eduardo Pedroni
    +
    See Also:
    +
    TravellingSalesmanFunctions
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        TravellingSalesmanProblem

        +
        public TravellingSalesmanProblem(Resources resources)
        +
        Construct a new instance of TravellingSalesmanProblem.
        +
        +
        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.
        +
        +
      • +
      + + + +
        +
      • +

        isPerfectSolution

        +
        public boolean isPerfectSolution(Chromosome fittest)
        +
        Description copied from class: Problem
        +
        Used to assert whether a given chromosome is 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. +

        + Note that if this method returns true, the experiment will move on + to the next run, or finish if no more runs are left.
        +
        +
        Specified by:
        +
        isPerfectSolution in class Problem
        +
        Parameters:
        +
        fittest - the potentially perfect chromosome.
        +
        Returns:
        +
        true if the argument is a perfect solution.
        +
        +
      • +
      + + + +
        +
      • +

        parseProblemData

        +
        public void parseProblemData(java.io.File file,
        +                             ModifiableResources resources)
        +
        Description copied from class: Problem
        +
        Parses the specified file and uses the parsed data to + set up the problem type instance appropriately. Any necessary + resource changes can be performed using the provided ModifiableResources + instance. +

        + In addition, realisations of this method should update the value of + maxFitness where appropriate, as this may be displayed to the user + if a GUI is in use.
        +
        +
        Specified by:
        +
        parseProblemData in class Problem
        +
        Parameters:
        +
        file - the data file to parse.
        +
        resources - a modifiable reference to the experiment's resources.
        +
        +
      • +
      + + + +
        +
      • +

        isImprovement

        +
        public boolean isImprovement(Chromosome fittest)
        +
        Description copied from class: Problem
        +
        Used to assert whether a given chromosome 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:
        +
        isImprovement in class Problem
        +
        Parameters:
        +
        fittest - the potentially fitter chromosome.
        +
        Returns:
        +
        true if the argument is fitter than the currently fittest chromosome.
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + diff --git a/doc/jcgp/backend/modules/problem/class-use/BestFitness.html b/doc/jcgp/backend/modules/problem/class-use/BestFitness.html new file mode 100644 index 0000000..3e1aec5 --- /dev/null +++ b/doc/jcgp/backend/modules/problem/class-use/BestFitness.html @@ -0,0 +1,212 @@ + + + + + +Uses of Class jcgp.backend.modules.problem.BestFitness + + + + + + + + +
+ + + + + + + +
+ + +
+

Uses of Class
jcgp.backend.modules.problem.BestFitness

+
+
+ +
+ +
+ + + + + + + +
+ + + + diff --git a/doc/jcgp/backend/modules/problem/class-use/DigitalCircuitProblem.html b/doc/jcgp/backend/modules/problem/class-use/DigitalCircuitProblem.html new file mode 100644 index 0000000..0a41224 --- /dev/null +++ b/doc/jcgp/backend/modules/problem/class-use/DigitalCircuitProblem.html @@ -0,0 +1,124 @@ + + + + + +Uses of Class jcgp.backend.modules.problem.DigitalCircuitProblem + + + + + + + + +
+ + + + + + + +
+ + +
+

Uses of Class
jcgp.backend.modules.problem.DigitalCircuitProblem

+
+
No usage of jcgp.backend.modules.problem.DigitalCircuitProblem
+ +
+ + + + + + + +
+ + + + diff --git a/doc/jcgp/backend/modules/problem/class-use/Problem.html b/doc/jcgp/backend/modules/problem/class-use/Problem.html new file mode 100644 index 0000000..df1956b --- /dev/null +++ b/doc/jcgp/backend/modules/problem/class-use/Problem.html @@ -0,0 +1,217 @@ + + + + + +Uses of Class jcgp.backend.modules.problem.Problem + + + + + + + + +
+ + + + + + + +
+ + +
+

Uses of Class
jcgp.backend.modules.problem.Problem

+
+
+ +
+ +
+ + + + + + + +
+ + + + diff --git a/doc/jcgp/backend/modules/problem/class-use/SymbolicRegressionProblem.html b/doc/jcgp/backend/modules/problem/class-use/SymbolicRegressionProblem.html new file mode 100644 index 0000000..6347b53 --- /dev/null +++ b/doc/jcgp/backend/modules/problem/class-use/SymbolicRegressionProblem.html @@ -0,0 +1,124 @@ + + + + + +Uses of Class jcgp.backend.modules.problem.SymbolicRegressionProblem + + + + + + + + +
+ + + + + + + +
+ + +
+

Uses of Class
jcgp.backend.modules.problem.SymbolicRegressionProblem

+
+
No usage of jcgp.backend.modules.problem.SymbolicRegressionProblem
+ +
+ + + + + + + +
+ + + + diff --git a/doc/jcgp/backend/modules/problem/class-use/TestCaseProblem.TestCase.html b/doc/jcgp/backend/modules/problem/class-use/TestCaseProblem.TestCase.html new file mode 100644 index 0000000..51bc5c0 --- /dev/null +++ b/doc/jcgp/backend/modules/problem/class-use/TestCaseProblem.TestCase.html @@ -0,0 +1,249 @@ + + + + + +Uses of Class jcgp.backend.modules.problem.TestCaseProblem.TestCase + + + + + + + + +
+ + + + + + + +
+ + +
+

Uses of Class
jcgp.backend.modules.problem.TestCaseProblem.TestCase

+
+
+ +
+ +
+ + + + + + + +
+ + + + diff --git a/doc/jcgp/backend/modules/problem/class-use/TestCaseProblem.html b/doc/jcgp/backend/modules/problem/class-use/TestCaseProblem.html new file mode 100644 index 0000000..2924adc --- /dev/null +++ b/doc/jcgp/backend/modules/problem/class-use/TestCaseProblem.html @@ -0,0 +1,227 @@ + + + + + +Uses of Class jcgp.backend.modules.problem.TestCaseProblem + + + + + + + + +
+ + + + + + + +
+ + +
+

Uses of Class
jcgp.backend.modules.problem.TestCaseProblem

+
+
+ +
+ +
+ + + + + + + +
+ + + + diff --git a/doc/jcgp/backend/modules/problem/class-use/TravellingSalesmanProblem.html b/doc/jcgp/backend/modules/problem/class-use/TravellingSalesmanProblem.html new file mode 100644 index 0000000..e8d6a27 --- /dev/null +++ b/doc/jcgp/backend/modules/problem/class-use/TravellingSalesmanProblem.html @@ -0,0 +1,124 @@ + + + + + +Uses of Class jcgp.backend.modules.problem.TravellingSalesmanProblem + + + + + + + + +
+ + + + + + + +
+ + +
+

Uses of Class
jcgp.backend.modules.problem.TravellingSalesmanProblem

+
+
No usage of jcgp.backend.modules.problem.TravellingSalesmanProblem
+ +
+ + + + + + + +
+ + + + diff --git a/doc/jcgp/backend/modules/problem/package-frame.html b/doc/jcgp/backend/modules/problem/package-frame.html new file mode 100644 index 0000000..7089f7c --- /dev/null +++ b/doc/jcgp/backend/modules/problem/package-frame.html @@ -0,0 +1,28 @@ + + + + + +jcgp.backend.modules.problem + + + + + +

jcgp.backend.modules.problem

+
+

Classes

+ +

Enums

+ +
+ + diff --git a/doc/jcgp/backend/modules/problem/package-summary.html b/doc/jcgp/backend/modules/problem/package-summary.html new file mode 100644 index 0000000..381db7a --- /dev/null +++ b/doc/jcgp/backend/modules/problem/package-summary.html @@ -0,0 +1,188 @@ + + + + + +jcgp.backend.modules.problem + + + + + + + + +
+ + + + + + + +
+ + +
+

Package jcgp.backend.modules.problem

+
+
+ +
+ +
+ + + + + + + +
+ + + + diff --git a/doc/jcgp/backend/modules/problem/package-tree.html b/doc/jcgp/backend/modules/problem/package-tree.html new file mode 100644 index 0000000..1ff07b5 --- /dev/null +++ b/doc/jcgp/backend/modules/problem/package-tree.html @@ -0,0 +1,163 @@ + + + + + +jcgp.backend.modules.problem Class Hierarchy + + + + + + + + +
+ + + + + + + +
+ + +
+

Hierarchy For Package jcgp.backend.modules.problem

+Package Hierarchies: + +
+
+

Class Hierarchy

+ +

Enum Hierarchy

+ +
+ +
+ + + + + + + +
+ + + + diff --git a/doc/jcgp/backend/modules/problem/package-use.html b/doc/jcgp/backend/modules/problem/package-use.html new file mode 100644 index 0000000..32be276 --- /dev/null +++ b/doc/jcgp/backend/modules/problem/package-use.html @@ -0,0 +1,305 @@ + + + + + +Uses of Package jcgp.backend.modules.problem + + + + + + + + +
+ + + + + + + +
+ + +
+

Uses of Package
jcgp.backend.modules.problem

+
+
+ +
+ +
+ + + + + + + +
+ + + + -- cgit v1.2.3