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

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

public class SelectMaturityRange
extends java.lang.Object
implements SelectionAlgorithm

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

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

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

Constructor Detail

SelectMaturityRange

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

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

SelectMaturityRange

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

Parameters:
lowerBound - the lower bound of the maturity range to allow
lowerExclusive - false lowerBound is inclusive true lowerBound is exclusive
upperBound - the upper bound of the maturity 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 maturity 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.