weka.filters.supervised.attribute.gpattributegeneration
Class Selection

java.lang.Object
  extended by weka.filters.supervised.attribute.gpattributegeneration.Selection

public class Selection
extends java.lang.Object

Class contains methods for helping with selection. Ported and modified from Luke Devonshire's C#.

Author:
Luke Devonshire

Constructor Summary
Selection()
           
 
Method Summary
static Genome<Gene> crowdedTournament(java.util.Random rand, Population population)
          Performs tournament selection on the given population list using domination rank and crowding distance values (NSGAII)
static Population elitist(Population population, int numToCopy, EnumSortingCriteria sortCriteria)
          Performs elitist selection on the given population.
static Genome<Gene> tournament(java.util.Random rand, Population population)
          Performs tournament selection on the given population list using fitness values
static Genome<Gene> vectorTournament(java.util.Random rand, Population population)
          Performs tournament selection on the given population list using vector fitness values
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Selection

public Selection()
Method Detail

tournament

public static Genome<Gene> tournament(java.util.Random rand,
                                      Population population)
Performs tournament selection on the given population list using fitness values

Parameters:
rand - Random object to use to select a random individual
population - Population to get random individuals from
Returns:
A selected Genome

vectorTournament

public static Genome<Gene> vectorTournament(java.util.Random rand,
                                            Population population)
Performs tournament selection on the given population list using vector fitness values

Parameters:
rand - Random object to use to select a random individual
population - Population to get random individuals from
Returns:
A selected Genome

crowdedTournament

public static Genome<Gene> crowdedTournament(java.util.Random rand,
                                             Population population)
Performs tournament selection on the given population list using domination rank and crowding distance values (NSGAII)

Parameters:
rand - Random object to use to select a random individual
population - Population to get random individuals from
Returns:
A selected Genome

elitist

public static Population elitist(Population population,
                                 int numToCopy,
                                 EnumSortingCriteria sortCriteria)
Performs elitist selection on the given population. Returns the top 'numToCopy' individuals in the population.

Parameters:
population - Population to perform elitist selection on
numToCopy - Number of individuals to select. If numToCopy > population size; all the population will be returned
sortCriteria - Sorting criteria to use
Returns:
Selected population of the best numToCopy individuals