Documentation of 'org.encog.ml.ea.population.BasicPopulation' Java class
BasicPopulation
org.encog.ml.ea.population

Class BasicPopulation

  • All Implemented Interfaces:
    java.io.Serializable, Population, MLMethod, MLProperties
    Direct Known Subclasses:
    NEATPopulation, PrgPopulation


    public class BasicPopulation
    extends BasicML
    implements Population, java.io.Serializable
    Defines the basic functionality for a population of genomes. The population is made up of species. These species contain the individiual genomes that make up the population. If you do not want to use species, then create one species that holds every genome.
    See Also:
    Serialized Form
    • Constructor Detail

      • BasicPopulation

        public BasicPopulation()
        Construct an empty population.
      • BasicPopulation

        public BasicPopulation(int thePopulationSize,
                               GenomeFactory theGenomeFactory)
        Construct a population.
        Parameters:
        thePopulationSize - The population size.
        theGenomeFactory - factory that can be used to store create genomes.
    • Method Detail

      • clear

        public void clear()
        Clear all genomes from this population.
        Specified by:
        clear in interface Population
      • createSpecies

        public Species createSpecies()
        Create a species.
        Specified by:
        createSpecies in interface Population
        Returns:
        The newly created species.
      • determineBestSpecies

        public Species determineBestSpecies()
        Determine which species has the top genome.
        Specified by:
        determineBestSpecies in interface Population
        Returns:
        The species with the top genome.
      • flatten

        public java.util.List<Genome> flatten()
        Flatten the species into a single list of genomes.
        Specified by:
        flatten in interface Population
        Returns:
        The genomes that make up all species in the population.
      • getBestGenome

        public Genome getBestGenome()
        Specified by:
        getBestGenome in interface Population
        Returns:
        The best genome in the population.
      • getMaxIndividualSize

        public int getMaxIndividualSize()
        Specified by:
        getMaxIndividualSize in interface Population
        Returns:
        The max size that an individual can become.
      • getName

        public java.lang.String getName()
        Returns:
        The name.
      • getPopulationSize

        public int getPopulationSize()
        Specified by:
        getPopulationSize in interface Population
        Returns:
        The max population size.
      • getSpecies

        public java.util.List<Species> getSpecies()
        Specified by:
        getSpecies in interface Population
        Returns:
        The species that make up the population.
      • setBestGenome

        public void setBestGenome(Genome genome)
        Set the best genome.
        Specified by:
        setBestGenome in interface Population
        Parameters:
        genome - The best genome.
      • setGenomeFactory

        public void setGenomeFactory(GenomeFactory factory)
        Set the gnome factory.
        Specified by:
        setGenomeFactory in interface Population
        Parameters:
        factory - The genome factory.
      • setName

        public void setName(java.lang.String theName)
        Set the name.
        Parameters:
        theName - The new name.
      • setPopulationSize

        public void setPopulationSize(int thePopulationSize)
        Set the max population size.
        Specified by:
        setPopulationSize in interface Population
        Parameters:
        thePopulationSize - The max population size.
      • size

        public int size()
        Specified by:
        size in interface Population
        Returns:
        The size of the population.
      • setRules

        public void setRules(RuleHolder rules)
        Description copied from interface: Population
        Set the rules holder to use.
        Specified by:
        setRules in interface Population
        Parameters:
        rules - the rules to set

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.