Documentation of 'org.encog.ml.ea.species.BasicSpecies' Java class
BasicSpecies
org.encog.ml.ea.species

Class BasicSpecies

  • All Implemented Interfaces:
    java.io.Serializable, Species


    public class BasicSpecies
    extends java.lang.Object
    implements java.io.Serializable, Species
    Provides basic functionality for a species.
    See Also:
    Serialized Form
    • Constructor Detail

      • BasicSpecies

        public BasicSpecies()
        Default constructor, used mainly for persistence.
      • BasicSpecies

        public BasicSpecies(Population thePopulation,
                            Genome theFirst)
        Construct a species.
        Parameters:
        thePopulation - The population the species belongs to.
        theFirst - The first genome in the species.
    • Method Detail

      • add

        public void add(Genome genome)
        Add a genome to this species.
        Specified by:
        add in interface Species
        Parameters:
        genome - The genome to add.
      • calculateShare

        public double calculateShare(boolean shouldMinimize,
                                     double maxScore)
        Calculate this genome's share of the next population.
        Specified by:
        calculateShare in interface Species
        Parameters:
        shouldMinimize - True if we see to minimize the score.
        maxScore - The best score.
        Returns:
        The share of this species, as a percent ratio.
      • getAge

        public int getAge()
        Specified by:
        getAge in interface Species
        Returns:
        The age of this species.
      • getBestScore

        public double getBestScore()
        Specified by:
        getBestScore in interface Species
        Returns:
        The best score for this species.
      • getGensNoImprovement

        public int getGensNoImprovement()
        Specified by:
        getGensNoImprovement in interface Species
        Returns:
        The number of generations with no imrpvement.
      • getLeader

        public Genome getLeader()
        Specified by:
        getLeader in interface Species
        Returns:
        The leader of this species.
      • getMembers

        public java.util.List<Genome> getMembers()
        Specified by:
        getMembers in interface Species
        Returns:
        The members of this species.
      • getOffspringCount

        public int getOffspringCount()
        Specified by:
        getOffspringCount in interface Species
        Returns:
        Get the offspring count.
      • getOffspringShare

        public double getOffspringShare()
        Specified by:
        getOffspringShare in interface Species
        Returns:
        The offspring share for the next iteration's population.
      • purge

        public void purge()
        Purge all members, increase age by one and count the number of generations with no improvement.
      • setAge

        public void setAge(int theAge)
        Set the age of this species.
        Specified by:
        setAge in interface Species
        Parameters:
        theAge - The age.
      • setBestScore

        public void setBestScore(double theBestScore)
        Set the best score for this species.
        Specified by:
        setBestScore in interface Species
        Parameters:
        theBestScore - The best score.
      • setGensNoImprovement

        public void setGensNoImprovement(int theGensNoImprovement)
        Set the number of generations with no improvement.
        Specified by:
        setGensNoImprovement in interface Species
        Parameters:
        theGensNoImprovement - The generation count with no improvement.
      • setLeader

        public void setLeader(Genome theLeader)
        Set the leader of this species.
        Specified by:
        setLeader in interface Species
        Parameters:
        theLeader - The leader.
      • setOffspringCount

        public void setOffspringCount(int offspringCount)
        Set the offspring count.
        Specified by:
        setOffspringCount in interface Species
        Parameters:
        offspringCount - The offspring count.
      • setPopulation

        public void setPopulation(Population thePopulation)
        Set the population.
        Specified by:
        setPopulation in interface Species
        Parameters:
        thePopulation - The population.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.