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

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

public class ArraySelectUnion
extends java.lang.Object
implements ArraySelectionAlgorithm

ArraySelectUnion is a ArraySelectionAlgorithm that will return the union of the results of two specified ArraySelectionAlgorithms.

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

Constructor Summary
ArraySelectUnion(ArraySelectionAlgorithm first, ArraySelectionAlgorithm second)
          Creates a new ArraySelectUnion object for taking the union of the Populations returned by the two passed ArraySelectionAlgorithms.
 
Method Summary
 PopulationArray selectFromPopulation(Population pop)
          Returns a Population that represents the union (junction) of the two ArraySelectionAlgorithms specified in the constructor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArraySelectUnion

public ArraySelectUnion(ArraySelectionAlgorithm first,
                        ArraySelectionAlgorithm second)
Creates a new ArraySelectUnion object for taking the union of the Populations returned by the two passed ArraySelectionAlgorithms.

Parameters:
first - the first ArraySelectionAlgorithm
second - the second ArraySelectionAlgorithm
Method Detail

selectFromPopulation

public PopulationArray selectFromPopulation(Population pop)
Returns a Population that represents the union (junction) of the two ArraySelectionAlgorithms specified in the constructor. The return is the result of the first selection algorithm, with the results of the second added to it via the Population.addCells() method. If the first selection algorithm returns a null then a NullPointerException will be thrown. If the second one returns a null, the the results of the first will be returned unchanged.

Specified by:
selectFromPopulation in interface ArraySelectionAlgorithm
Parameters:
pop - the Population to choose from
Returns:
the union Population of the two selection algorithms


Copyright - 2001 OpenAI Labs. All Rights Reserved.