|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.openai.ai.ga.selection.common.ArraySelectTournament
ArraySelectTournament
is a method by which
Population
members are created and chosen using a tournament on a
Population
. This algorithm is used for the selection of
parents for recombination (reproduction).
Constructor Summary | |
ArraySelectTournament(SelectionAlgorithm[] groupPerParent,
int goal)
Creates a new ArraySelectTournament that creates the
specified number of parent sets by choosing a random parent for each
parent slot according to each specified selection algorithm. |
|
ArraySelectTournament(SelectionAlgorithm[] groupPerParent,
int goal,
Population basePopulation)
Creates a new ArraySelectTournament that creates the
specified number of parent sets by choosing a random parent for each
parent slot according to each specified selection algorithm and adds
these into the specified base population. |
|
ArraySelectTournament(SelectionAlgorithm[] groupPerParent,
int goal,
Population basePopulation,
PopulationArray basePopulationArray)
Creates a new ArraySelectTournament that creates the
specified number of parent sets by choosing a random parent for each
parent slot according to each specified selection algorithm and adds
these into the specified base population, which are in turn added into
a clone of the base population array. |
Method Summary | |
PopulationArray |
selectFromPopulation(Population pop)
Creates a PopulationArray according to a tournament. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ArraySelectTournament(SelectionAlgorithm[] groupPerParent, int goal)
ArraySelectTournament
that creates the
specified number of parent sets by choosing a random parent for each
parent slot according to each specified selection algorithm. Equilivant to
ArraySelectTournament(groupPerParent,goal,new Population())
.
This creates populations based on the default Population
type and collection.
groupPerParent
- the SelectionAlgorithm[]
that
represents a selection algorithm for each parental slotgoal
- the number of parent sets to createpublic ArraySelectTournament(SelectionAlgorithm[] groupPerParent, int goal, Population basePopulation)
ArraySelectTournament
that creates the
specified number of parent sets by choosing a random parent for each
parent slot according to each specified selection algorithm and adds
these into the specified base population. Normally, the base population
will be an empty population using a certain collection type.
Equilivant to ArraySelectTournament(groupPerParent, goal,
basePopulation, new PopulationArray())
.
groupPerParent
- the SelectionAlgorithm[]
that
represents a selection algorithm for each parental slotgoal
- the number of parent sets to createbasePopulation
- the Population
that each parent set
will be added intopublic ArraySelectTournament(SelectionAlgorithm[] groupPerParent, int goal, Population basePopulation, PopulationArray basePopulationArray)
ArraySelectTournament
that creates the
specified number of parent sets by choosing a random parent for each
parent slot according to each specified selection algorithm and adds
these into the specified base population, which are in turn added into
a clone of the base population array. Normally, the base population
and base population array will be empty and implement certain collection
types.
groupPerParent
- the SelectionAlgorithm[]
that
represents a selection algorithm for each parental slotgoal
- the number of parent sets to createbasePopulation
- the Population
that each parent set
will be added intobasePopulationArray
- the PopulationArray
that will
will be used to hold the parent setsMethod Detail |
public PopulationArray selectFromPopulation(Population pop)
PopulationArray
according to a tournament. The
base population array is cloned. A parent set (a Population
)
is created first by cloning the base population specified in the
constructor. Then, a member is chosen at random from each of the
selection algorithms specified in the constructor. Each selection
algorithm is queried only once and the results are used for every parent
set.
For example, suppose the selection algorithms returned the following
populations: {1,2,3},{3,5,7}, and {5,6,7,8,9,10}. The base population
is the default, an empty new Population()
. Then the
following is a possible output for a goal of 5 parent sets:
selectFromPopulation
in interface ArraySelectionAlgorithm
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 |