|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IPopulation
Defines methods required by a collection which holds IChromosome
s.
Method Summary | |
---|---|
void |
add(IChromosome chromosome)
Add the given chromosome. |
void |
addAll(IPopulation population)
Add all chromosomes from the given population to this. |
int |
capacity()
Return the capacity of the population. |
void |
clearFitnesses()
Clear the fitnesses of all members of the population. |
boolean |
contains(IChromosome chromosome)
Return true if the given chromosome is a duplicate of one already in the population. |
boolean |
contains(IChromosome chromosome,
int start,
int end)
Return true if the given chromosome is a duplicate of one already in the given range of the population. |
IChromosome |
first()
Return the first chromosome. |
IChromosome |
get(int i)
Return the chromosome at the given index. |
double |
getAverageFitness()
Return the average fitness of all the chromosomes. |
int |
getMaxFitness()
|
int |
getMinFitness()
|
int |
getSumFitness()
Return the sum of the chromosome's fitnesses. |
int |
indexOf(IChromosome chromosome)
Return the index of the given chromosome. |
boolean |
isEmpty()
Return true if this is empty. |
void |
resetAverageFitness()
Reset the average fitness. |
void |
setFitnesses(int fitness)
Set the fitnesses of all members of the population to the given value. |
void |
shuffle()
Shuffle the chromosomes. |
int |
size()
Return the current size of the population. |
void |
sort()
Sort the chromosomes. |
String |
toString()
Return a string representation of this object. |
Method Detail |
---|
void add(IChromosome chromosome)
chromosome
- Chromosome.void addAll(IPopulation population)
int capacity()
void clearFitnesses()
boolean contains(IChromosome chromosome)
chromosome
- Chromosome for which to search.boolean contains(IChromosome chromosome, int start, int end)
chromosome
- Chromosome for which to search.start
- Start index.end
- End index plus one.IChromosome first()
IChromosome get(int i)
i
- Chromosome index.double getAverageFitness()
int getMaxFitness()
int getMinFitness()
int getSumFitness()
int indexOf(IChromosome chromosome)
boolean isEmpty()
void resetAverageFitness()
void setFitnesses(int fitness)
void shuffle()
int size()
void sort()
String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 2007 Vizzini.org. All Rights Reserved. | 2007.12.25.03.00.02 |