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/DigitalCircuitProblem.html | 455 +++++++++++++++++++++ 1 file changed, 455 insertions(+) create mode 100644 doc/jcgp/backend/modules/problem/DigitalCircuitProblem.html (limited to 'doc/jcgp/backend/modules/problem/DigitalCircuitProblem.html') 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.
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + -- cgit v1.2.3