Class SpatialTournamentSelection
- All Implemented Interfaces:
Prototype,Setup,SteadyStateBSourceForm,RandomChoiceChooserD,Serializable,Cloneable
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
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringSome models assume an individual is always selected to compete for breeding a child that would take its location in space.static final StringThe size of the neighborhood from where parents are selected.static final StringSelection procedure.static final intstatic final intstatic final Stringstatic final StringFields inherited from class ec.select.TournamentSelection
P_PICKWORST, P_SIZE, P_TOURNAMENT, pickWorst, probabilityOfPickingSizePlusOne, sizeFields inherited from class ec.SelectionMethod
INDS_PRODUCED, KEY_PARENTSFields inherited from class ec.BreedingSource
NO_PROBABILITY, P_PROB, probability -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the default base for this prototype.intgetRandomIndividual(int number, int subpopulation, EvolutionState state, int thread) Produces the index of a (typically uniformly distributed) randomly chosen individual to fill the tournament.voidsetup(EvolutionState state, Parameter base) Sets up the BreedingPipeline.Methods inherited from class ec.select.TournamentSelection
betterThan, getTournamentSizeToUse, individualReplaced, produce, sourcesAreProperFormMethods inherited from class ec.SelectionMethod
finishProducing, prepareToProduce, produce, produces, produceWithoutCloning, typicalIndsProducedMethods inherited from class ec.BreedingSource
clone, fillStubs, getProbability, pickRandom, preparePipeline, setProbability, setupProbabilities
-
Field Details
-
P_N_SIZE
The size of the neighborhood from where parents are selected. Small neighborhood sizes enforce a local selection pressure, while larger values for this parameters allow further-away individuals to compete for breeding as well.- See Also:
-
P_IND_COMPETES
Some models assume an individual is always selected to compete for breeding a child that would take its location in space. Other models don't make this assumption. This parameter allows one to specify whether an individual will be selected to compete with others for breeding a child that will take its location in space. If the parameter value is not specified, it is assumed to be false by default.- See Also:
-
P_TYPE
Selection procedure.- See Also:
-
V_UNIFORM
- See Also:
-
V_RANDOM_WALK
- See Also:
-
TYPE_UNIFORM
public static final int TYPE_UNIFORM- See Also:
-
TYPE_RANDOM_WALK
public static final int TYPE_RANDOM_WALK- See Also:
-
-
Constructor Details
-
SpatialTournamentSelection
public SpatialTournamentSelection()
-
-
Method Details
-
setup
Description copied from class:BreedingSourceSets up the BreedingPipeline. You can use state.output.error here because the top-level caller promises to call exitIfErrors() after calling setup. Note that probability might get modified again by an external source if it doesn't normalize right.The 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}.
-
defaultBase
Description copied from interface:PrototypeReturns the default base for this prototype. This should generally be implemented by building off of the static base() method on the DefaultsForm object for the prototype's package. This should be callable during setup(...).- Specified by:
defaultBasein interfacePrototype- Overrides:
defaultBasein classTournamentSelection
-
getRandomIndividual
Description copied from class:TournamentSelectionProduces the index of a (typically uniformly distributed) randomly chosen individual to fill the tournament. numberinvalid input: '<'/> is the position of the individual in the tournament.- Overrides:
getRandomIndividualin classTournamentSelection
-