public abstract class Chromosome extends java.lang.Object implements java.lang.Comparable<Chromosome>, Fitness
Constructor and Description |
---|
Chromosome() |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Chromosome another)
Compares two chromosomes based on their fitness.
|
double |
getFitness()
Access the fitness of this chromosome.
|
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.
|
public double getFitness()
public int compareTo(Chromosome another)
compareTo
in interface java.lang.Comparable<Chromosome>
another
- another chromosome to compareanother
is better than this
another
is worse than this
public void searchForFitnessUpdate(Population population)
population
- Population to searchCopyright © 2010 - 2020 Adobe. All Rights Reserved