Individual (JEvolution)
Date: 2013-03-21

evSOLve.JEvolution

## Class Individual

- java.lang.Object
- - evSOLve.JEvolution.Individual

- All Implemented Interfaces:
    java.lang.Cloneable

      public class Individual
      extends java.lang.Object
      implements java.lang.Cloneable

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Individual(java.lang.String fileName)` Constructs an Individual purely from an Individual stored in an XML file.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected java.lang.Object` | `clone()` A proper clone also cloning Genotype (including all Chromosomes) and Phenotype.
    `double` | `getFitness()` Get the fitness of the phenotype.
    `java.util.List<Chromosome>` | `getGenotype()` Supplies the Individual's Genotype.
    `Phenotype` | `getPhenotype()` Supplies the Individual's Phenotype.
    `void` | `toFile(java.lang.String fileName)` Saves the Individual to an XML file.
    `java.lang.String` | `toString()` Convert Individual's Genotype to a string.

    - ### Methods inherited from class java.lang.Object

      `equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### Individual

          public Individual(java.lang.String fileName)

      Constructs an Individual purely from an Individual stored in an XML file.
      Parameters:
        `fileName` - name of the XML file

  - ### Method Detail

    - #### clone

          protected java.lang.Object clone()

      A proper clone also cloning Genotype (including all Chromosomes) and Phenotype.
      Overrides:
        `clone` in class `java.lang.Object`
      Returns:
        Object The clone.

    - #### getFitness

          public double getFitness()

      Get the fitness of the phenotype. If the fitness was found in the repository, it is already there. This implementation demands that getFitness() blocks, if the fitness calculation has not yet finished.
      Returns:
        fitness The Individual's fitness.

    - #### getGenotype

          public java.util.List<Chromosome> getGenotype()

      Supplies the Individual's Genotype.
      Returns:
        the complete genetic code

    - #### getPhenotype

          public Phenotype getPhenotype()

      Supplies the Individual's Phenotype.
      Returns:
        the problem specific code

    - #### toString

          public java.lang.String toString()

      Convert Individual's Genotype to a string.
      Overrides:
        `toString` in class `java.lang.Object`
      Returns:
        String of the chromosome.

    - #### toFile

          public void toFile(java.lang.String fileName)

      Saves the Individual to an XML file.
      Parameters:
        `fileName` - name of the XML file