org.dishevelled.evolve.select
Class ElitistSelection<I>

java.lang.Object
  extended by org.dishevelled.evolve.select.ElitistSelection<I>
Type Parameters:
I - individual type
All Implemented Interfaces:
Selection<I>

public final class ElitistSelection<I>
extends Object
implements Selection<I>

Elitist selection function.

Version:
$Revision: 1059 $ $Date: 2012-01-03 14:03:02 -0600 (Tue, 03 Jan 2012) $
Author:
Michael Heuer

Constructor Summary
ElitistSelection(int individuals)
          Create a new elitist selection function with the specified number of individuals.
 
Method Summary
 int getIndividuals()
          Return the number of individuals for this elitist selection function.
 Collection<I> select(Collection<I> population, WeightedMap<I> scores)
          Select individuals from the specified population of individuals based on the specified fitness scores.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ElitistSelection

public ElitistSelection(int individuals)
Create a new elitist selection function with the specified number of individuals.

Parameters:
individuals - number of individuals for this elitist selection function, must be >= 0
Method Detail

getIndividuals

public int getIndividuals()
Return the number of individuals for this elitist selection function.

Returns:
the number of individuals for this elitist selection function

select

public Collection<I> select(Collection<I> population,
                            WeightedMap<I> scores)
Select individuals from the specified population of individuals based on the specified fitness scores.

Specified by:
select in interface Selection<I>
Parameters:
population - population of individuals
scores - fitness scores
Returns:
a collection of individuals selected from the specified population of individuals


Copyright (c) 2005-2012 held jointly by the individual authors. Licensed under the GNU Lesser General Public License (LGPL).