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

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

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

Rank-based selection function.

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

Constructor Summary
RankBasedSelection(int rank)
          Create a new rank based selection function with the specified rank.
 
Method Summary
 int getRank()
          Return the rank for this rank based 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

RankBasedSelection

public RankBasedSelection(int rank)
Create a new rank based selection function with the specified rank.

Parameters:
rank - rank for this rank based selection function, must be >= 1
Method Detail

getRank

public int getRank()
Return the rank for this rank based selection function.

Returns:
the rank for this rank based 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).