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

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

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

Random selection function.

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

Constructor Summary
RandomSelection()
          Create a new random selection function with the default source of randomness.
RandomSelection(Random random)
          Create a new random selection function with the specified source of randomness.
 
Method Summary
 Random getRandom()
          Return the source of randomness for this random 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

RandomSelection

public RandomSelection()
Create a new random selection function with the default source of randomness.


RandomSelection

public RandomSelection(Random random)
Create a new random selection function with the specified source of randomness.

Parameters:
random - source of randomness, must not be null
Method Detail

getRandom

public Random getRandom()
Return the source of randomness for this random selection function. The source of randomness will not be null.

Returns:
the source of randomness for this random 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).