org.encog.ml.ea.population
public class BasicPopulation extends BasicML implements Population, Serializable
| Constructor and Description |
|---|
BasicPopulation()
Construct an empty population.
|
BasicPopulation(int thePopulationSize,
GenomeFactory theGenomeFactory)
Construct a population.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clear all genomes from this population.
|
Species |
createSpecies()
Create a species.
|
Species |
determineBestSpecies()
Determine which species has the top genome.
|
List<Genome> |
flatten()
Flatten the species into a single list of genomes.
|
Genome |
getBestGenome() |
GenomeFactory |
getGenomeFactory() |
int |
getMaxIndividualSize() |
String |
getName() |
int |
getPopulationSize() |
List<Species> |
getSpecies() |
void |
purgeInvalidGenomes()
Purge any invalid genomes.
|
void |
setBestGenome(Genome genome)
Set the best genome.
|
void |
setGenomeFactory(GenomeFactory factory)
Set the gnome factory.
|
void |
setName(String theName)
Set the name.
|
void |
setPopulationSize(int thePopulationSize)
Set the max population size.
|
int |
size() |
void |
updateProperties()
Update any objeccts when a property changes.
|
getProperties, getPropertyDouble, getPropertyLong, getPropertyString, setProperty, setProperty, setPropertypublic BasicPopulation()
public BasicPopulation(int thePopulationSize,
GenomeFactory theGenomeFactory)
thePopulationSize - The population size.public void clear()
clear in interface Populationpublic Species createSpecies()
createSpecies in interface Populationpublic Species determineBestSpecies()
determineBestSpecies in interface Populationpublic List<Genome> flatten()
flatten in interface Populationpublic Genome getBestGenome()
getBestGenome in interface Populationpublic GenomeFactory getGenomeFactory()
getGenomeFactory in interface Populationpublic int getMaxIndividualSize()
getMaxIndividualSize in interface Populationpublic String getName()
public int getPopulationSize()
getPopulationSize in interface Populationpublic List<Species> getSpecies()
getSpecies in interface Populationpublic void setBestGenome(Genome genome)
setBestGenome in interface Populationgenome - The best genome.public void setGenomeFactory(GenomeFactory factory)
setGenomeFactory in interface Populationfactory - The genome factory.public void setName(String theName)
theName - The new name.public void setPopulationSize(int thePopulationSize)
setPopulationSize in interface PopulationthePopulationSize - The max population size.public int size()
size in interface Populationpublic void updateProperties()
updateProperties in interface MLPropertiesupdateProperties in class BasicMLpublic void purgeInvalidGenomes()
purgeInvalidGenomes in interface PopulationCopyright © 2014. All Rights Reserved.