net.openai.ai.ga.selection.common
Class SelectSingleGreatestFitness

java.lang.Object
  |
  +--net.openai.ai.ga.selection.common.SelectSingleGreatestFitness
All Implemented Interfaces:
SelectionAlgorithm

public class SelectSingleGreatestFitness
extends java.lang.Object
implements SelectionAlgorithm

SelectGreatestFitness is a SelectionAlgorithm that will return a portion of the passed Population that have the greatest fitness. It will choose either a fixed number or a percentage.

Since:
JDK1.3
Version:
%I%, %G%
Author:
Jared Grubb

Constructor Summary
SelectSingleGreatestFitness()
          Creates a new SelectSingleGreatestFitness object for choosing a single Cell out of the specified Population who has the greatest fitness.
 
Method Summary
 Population selectFromPopulation(Population pop)
          Chooses the Cell in the specified Population with the greatest fitness.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SelectSingleGreatestFitness

public SelectSingleGreatestFitness()
Creates a new SelectSingleGreatestFitness object for choosing a single Cell out of the specified Population who has the greatest fitness.

Method Detail

selectFromPopulation

public Population selectFromPopulation(Population pop)
Chooses the Cell in the specified Population with the greatest fitness. The returned population is guaranteed to return the cell of the specified population such that there are no other members in that population who are greater than that returned. This means that cells who tie the highest are ignored. For example, if the fitness of a population was {1,1,2,3,3,3,4,5,5} then only one cell of fitness 5 will be returned.

Specified by:
selectFromPopulation in interface SelectionAlgorithm
Parameters:
pop - the Population to choose from
Returns:
a selected Population


Copyright - 2001 OpenAI Labs. All Rights Reserved.