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/population/Population.html | 411 ++++++++++++++++++++++++++++ 1 file changed, 411 insertions(+) create mode 100644 doc/jcgp/backend/population/Population.html (limited to 'doc/jcgp/backend/population/Population.html') diff --git a/doc/jcgp/backend/population/Population.html b/doc/jcgp/backend/population/Population.html new file mode 100644 index 0000000..b28fd28 --- /dev/null +++ b/doc/jcgp/backend/population/Population.html @@ -0,0 +1,411 @@ + + + + + +Population + + + + + + + + +
+ + + + + + + +
+ + + +
+
jcgp.backend.population
+

Class Population

+
+
+ +
+
    +
  • +
    +
    +
    public class Population
    +extends java.lang.Object
    +
    This class primarily holds a collection of chromosomes. In addition, + it provides a few utility methods for manipulating and copying + chromosomes, useful for evolutionary strategies. +

    + copyChromosome() is used to create copies of chromosomes, + though it is also possible to create a new instance of population + directly from a seed chromosome using the right constructor. +

    + For convenience, a random chromosome can be retrieved using + getRandomChromosome(), which is guaranteed to use the + experiment's specified seed. If an entirely random population + is needed, reinitialise() should be used to randomise + all chromosomes without creating a new instance of Population.
    +
    +
    Author:
    +
    Eduardo Pedroni
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + + +
      Constructors 
      Constructor and Description
      Population(Chromosome parent, + Resources resources) +
      Initialise a population of copies of the given chromosome.
      +
      Population(Resources resources) +
      Initialise a random population according to the parameters specified + in the resources.
      +
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      voidcopyChromosome(int source, + int target) +
      Copy a chromosome into a different position.
      +
      Chromosomeget(int index) +
      Returns the indexed chromosome.
      +
      ChromosomegetRandomChromosome() 
      voidreinitialise() +
      Loop through all chromosomes and randomise all connections + and functions.
      +
      voidsort() +
      Sorts the population in ascending order of fitness quality.
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Population

        +
        public Population(Resources resources)
        +
        Initialise a random population according to the parameters specified + in the resources.
        +
        +
        Parameters:
        +
        resources - the experiment's resources.
        +
        +
      • +
      + + + +
        +
      • +

        Population

        +
        public Population(Chromosome parent,
        +                  Resources resources)
        +
        Initialise a population of copies of the given chromosome.
        +
        +
        Parameters:
        +
        parent - the chromosome to use as a model.
        +
        resources - a reference to the experiment's resources.
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        get

        +
        public Chromosome get(int index)
        +
        Returns the indexed chromosome.
        +
        +
        Parameters:
        +
        index - the chromosome to return.
        +
        Returns:
        +
        the indexed chromosome.
        +
        +
      • +
      + + + +
        +
      • +

        getRandomChromosome

        +
        public Chromosome getRandomChromosome()
        +
        +
        Returns:
        +
        a random chromosome from this population.
        +
        +
      • +
      + + + +
        +
      • +

        copyChromosome

        +
        public void copyChromosome(int source,
        +                           int target)
        +
        Copy a chromosome into a different position. + After this returns, the target chromosome has + identical connections and functions to the source + one, though they are separate instances. + + This method does nothing if source == target.
        +
        +
        Parameters:
        +
        source - the chromosome to copy from.
        +
        target - the chromosome to copy to.
        +
        +
      • +
      + + + +
        +
      • +

        reinitialise

        +
        public void reinitialise()
        +
        Loop through all chromosomes and randomise all connections + and functions.
        +
      • +
      + + + +
        +
      • +

        sort

        +
        public void sort()
        +
        Sorts the population in ascending order of fitness quality. + What this means is that the best fitness chromosome will be + in the last position, even though it might have the lowest + fitness value. Fitness orientation as specified in the resources + is respected.
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + + + +
+ + + + -- cgit v1.2.3