|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectec.BreedingSource
ec.SelectionMethod
ec.select.TournamentSelection
ec.spatial.SpatialTournamentSelection
public class SpatialTournamentSelection
A slight modification of the tournament selection procedure for use with spatially-embedded EAs. When selecting an individual, the SpatialTournamentSelection is told a specific individual. It then picks N individuals at random which are within a certain distance (the neighborhood size) of that individual. These individuals then enter a tournament a-la standard Tournament Selection.
The method of picking individuals is either uniform (picking individuals using the Space interface's getRandomIndividual(...)) or random-walk (wandering distance steps at random). You can also stipulate whether the original individual must be in the tournament.
Parameters
| base.neighborhood-size int >= 1 |
(the neighborhood size) |
| base.ind-competes bool = true or false (default) |
(Do we include the base individual in the tournament?) |
| base.type String: uniform (default) or random-walk |
Method for selecting individuals in neighborhood |
Default Base
spatial.tournament
| Field Summary | |
|---|---|
static java.lang.String |
P_IND_COMPETES
Some models assume an individual is always selected to compete for breeding a child that would take its location in space. |
static java.lang.String |
P_N_SIZE
The size of the neighborhood from where parents are selected. |
static java.lang.String |
P_TYPE
Selection procedure. |
static int |
TYPE_RANDOM_WALK
|
static int |
TYPE_UNIFORM
|
static java.lang.String |
V_RANDOM_WALK
|
static java.lang.String |
V_UNIFORM
|
| Fields inherited from class ec.select.TournamentSelection |
|---|
DEFAULT_SIZE, P_PICKWORST, P_SIZE, P_TOURNAMENT, pickWorst, probabilityOfPickingSizePlusOne |
| Fields inherited from class ec.SelectionMethod |
|---|
INDS_PRODUCED |
| Fields inherited from class ec.BreedingSource |
|---|
NO_PROBABILITY, P_PROB, probability |
| Constructor Summary | |
|---|---|
SpatialTournamentSelection()
|
|
| Method Summary | |
|---|---|
Parameter |
defaultBase()
Returns the default base for this prototype. |
int |
getRandomIndividual(int number,
int subpopulation,
EvolutionState state,
int thread)
Produces the index of a (typically uniformly distributed) randomly chosen individual to fill the tournament. |
void |
setup(EvolutionState state,
Parameter base)
Sets up the BreedingPipeline. |
| Methods inherited from class ec.select.TournamentSelection |
|---|
betterThan, getTournamentSizeToUse, individualReplaced, produce, sourcesAreProperForm |
| Methods inherited from class ec.SelectionMethod |
|---|
finishProducing, prepareToProduce, produce, produces, typicalIndsProduced |
| Methods inherited from class ec.BreedingSource |
|---|
clone, getProbability, pickRandom, preparePipeline, setProbability, setupProbabilities |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String P_N_SIZE
public static final java.lang.String P_IND_COMPETES
public static final java.lang.String P_TYPE
public static final java.lang.String V_UNIFORM
public static final java.lang.String V_RANDOM_WALK
public static final int TYPE_UNIFORM
public static final int TYPE_RANDOM_WALK
| Constructor Detail |
|---|
public SpatialTournamentSelection()
| Method Detail |
|---|
public void setup(EvolutionState state,
Parameter base)
BreedingSourceThe most common modification is to normalize it with some other set of probabilities, then set all of them up in increasing summation; this allows the use of the fast static BreedingSource-picking utility method, BreedingSource.pickRandom(...). In order to use this method, for example, if four breeding source probabilities are {0.3, 0.2, 0.1, 0.4}, then they should get normalized and summed by the outside owners as: {0.3, 0.5, 0.6, 1.0}.
setup in interface Prototypesetup in interface Setupsetup in class TournamentSelectionPrototype.setup(EvolutionState,Parameter)public Parameter defaultBase()
Prototype
defaultBase in interface PrototypedefaultBase in class TournamentSelection
public int getRandomIndividual(int number,
int subpopulation,
EvolutionState state,
int thread)
TournamentSelection
getRandomIndividual in class TournamentSelection
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||