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