Documentation of 'org.encog.ml.ea.opp.selection.TournamentSelection' Java class
TournamentSelection
org.encog.ml.ea.opp.selection

Class TournamentSelection

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


    public class TournamentSelection
    extends java.lang.Object
    implements SelectionOperator, java.io.Serializable
    Tournament select can be used to select a fit (or unfit) genome from a species. The selection is run a set number of rounds. Each round two random participants are chosen. The more fit participant continues to the next round. http://en.wikipedia.org/wiki/Tournament_selection
    See Also:
    Serialized Form
    • Constructor Detail

      • TournamentSelection

        public TournamentSelection(EvolutionaryAlgorithm theTrainer,
                                   int theRounds)
        Construct a tournament selection.
        Parameters:
        theTrainer - The trainer.
        theRounds - The number of rounds to use.
    • Method Detail

      • getRounds

        public int getRounds()
        Returns:
        The number of rounds.
      • performAntiSelection

        public int performAntiSelection(java.util.Random rnd,
                                        Species species)
        Selects an unfit genome.
        Specified by:
        performAntiSelection in interface SelectionOperator
        Parameters:
        rnd - A random number generator.
        species - The species to select the genome from.
        Returns:
        The selected genome.
      • performSelection

        public int performSelection(java.util.Random rnd,
                                    Species species)
        Selects an fit genome.
        Specified by:
        performSelection in interface SelectionOperator
        Parameters:
        rnd - A random number generator.
        species - The species to select the genome from.
        Returns:
        The selected genome.
      • setRounds

        public void setRounds(int rounds)
        Set the number of rounds.
        Parameters:
        rounds - The number of rounds.
      • setTrainer

        public void setTrainer(EvolutionaryAlgorithm trainer)
        Set the trainer.
        Parameters:
        trainer - The trainer.

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.