|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ArraySelectionAlgorithm
is a method by which
Population
members are created and chosen from a
Population
. This algorithm is used for the selection of
parents for recombination (reproduction).
Method Summary | |
PopulationArray |
selectFromPopulation(Population pop)
Creates a PopulationArray according to a given algorithm
or rule. |
Method Detail |
public PopulationArray selectFromPopulation(Population pop)
PopulationArray
according to a given algorithm
or rule. The initial Population
is passed and a selection
from it is chosen and returned.
This function is passed a shallow clone of the original population,
therefore allowing additions and deletions to the passed population
without worry about how it affects the original. Any changes meant for
the original Population
should be handled through the
recombination and survival implementations of this algorithm.
The returned PopulationArray
should not be considered
crucial to any internal functions of this implementation of the
ArraySelectionAlgorithm
, since the genetic algorithm may make
changes directly onto this structure and may make the structure
available for others to make changes to. If the structure is needed
internally and such behavior could be detrimental to this
implementation's function, then it is recommended that a shallow
clone be returned via a return new
PopulationArray(returnPopulationArray)
rather than a plain
return returnPopulationArray
. This allows for this
additional overhead to be avoided in cases where it not needed.
pop
- the Population
to choose from
PopulationArray
derived from the passed
Population
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |