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

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

public class SelectFitnessRange
extends java.lang.Object
implements SelectionAlgorithm

SelectFitnessRange is a SelectionAlgorithm that will return a portion of the passed Population that have a fitness in the given range.

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

Constructor Summary
SelectFitnessRange(double lowerBound, boolean lowerExclusive, double upperBound, boolean upperExclusive)
          Creates a new SelectFitnessRange object for choosing the Cells out of the specified Population who have a fitness in the specified range, specified with whether each bound is treated inclusive or exclusive.
SelectFitnessRange(double lowerBound, double upperBound)
          Creates a new SelectFitnessRange object for choosing the Cells out of the specified Population who have a fitness in the specified range, inclusive.
 
Method Summary
 Population selectFromPopulation(Population pop)
          Chooses the Cells in the specified Population with fitness in a given range.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SelectFitnessRange

public SelectFitnessRange(double lowerBound,
                          double upperBound)
Creates a new SelectFitnessRange object for choosing the Cells out of the specified Population who have a fitness in the specified range, inclusive. (Equilivant to SelectFitnessRange(lowerBound, false, upperBound, false)).

Parameters:
lowerBound - the lower bound of the fitness range to allow, inclusive
upperBound - the upper bound of the fitness range to allow, inclusive
Throws:
ArithmeticException - on lowerBound>upperBound

SelectFitnessRange

public SelectFitnessRange(double lowerBound,
                          boolean lowerExclusive,
                          double upperBound,
                          boolean upperExclusive)
Creates a new SelectFitnessRange object for choosing the Cells out of the specified Population who have a fitness in the specified range, specified with whether each bound is treated inclusive or exclusive.

Parameters:
lowerBound - the lower bound of the fitness range to allow
lowerExclusive - false lowerBound is inclusive true lowerBound is exclusive
upperBound - the upper bound of the fitness range to allow
upperExclusive - false upperBound is inclusive true upperrBound is exclusive
Throws:
ArithmeticException - on lowerBound>upperBound
Method Detail

selectFromPopulation

public Population selectFromPopulation(Population pop)
Chooses the Cells in the specified Population with fitness in a given range. There is no limit to the number of members returned; it is possible that no cells are returned (when none meet the range requirements) or that all the cells are returned (when they all meet the requirements).

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


Copyright - 2001 OpenAI Labs. All Rights Reserved.