- All Implemented Interfaces:
- java.lang.Comparable<Chromosome>, Fitness
- Direct Known Subclasses:
public abstract class Chromosome
implements java.lang.Comparable<Chromosome>, Fitness
Individual in a population. Chromosomes are compared based on their fitness.
The chromosomes are IMMUTABLE, and so their fitness is also immutable and
therefore it can be cached.
|Constructor and Description
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.commons.math.genetics.Fitness
public double getFitness()
Access the fitness of this chromosome. The bigger the fitness, the better
Computation of fitness is usually very time-consuming task, therefore the
fitness is cached.
- the fitness.
public int compareTo(Chromosome another)
Compares two chromosomes based on their fitness. The bigger the fitness,
the better the chromosome.
- Specified by:
compareTo in interface
another - another chromosome to compare
- -1 if
another is better than
- 1 if
another is worse than
- 0 if the two chromosomes have the same fitness
public void searchForFitnessUpdate(Population population)
Searches the population for a chromosome representing the same solution,
and if it finds one, updates the fitness to its value.
population - Population to search
"Copyright © 2010 - 2018 Adobe Systems Incorporated. All Rights Reserved"