Class SpatialTournamentSelection
- java.lang.Object
-
- ec.BreedingSource
-
- ec.SelectionMethod
-
- ec.select.TournamentSelection
-
- ec.spatial.SpatialTournamentSelection
-
- All Implemented Interfaces:
- Prototype, Setup, SteadyStateBSourceForm, RandomChoiceChooserD, java.io.Serializable, java.lang.Cloneable
public class SpatialTournamentSelection extends TournamentSelection
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
Further parameters may be found in ec.select.TournamentSelection.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-walkMethod for selecting individuals in neighborhood Default Base
spatial.tournament- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field and Description static java.lang.StringP_IND_COMPETESSome models assume an individual is always selected to compete for breeding a child that would take its location in space.static java.lang.StringP_N_SIZEThe size of the neighborhood from where parents are selected.static java.lang.StringP_TYPESelection procedure.static intTYPE_RANDOM_WALKstatic intTYPE_UNIFORMstatic java.lang.StringV_RANDOM_WALKstatic java.lang.StringV_UNIFORM-
Fields inherited from class ec.select.TournamentSelection
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
Constructors Constructor and Description SpatialTournamentSelection()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description ParameterdefaultBase()Returns 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, sourcesAreProperForm
-
Methods inherited from class ec.SelectionMethod
finishProducing, prepareToProduce, produce, produces, typicalIndsProduced
-
Methods inherited from class ec.BreedingSource
clone, getProbability, pickRandom, preparePipeline, setProbability, setupProbabilities
-
-
-
-
Field Detail
-
P_N_SIZE
public static final java.lang.String 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:
- Constant Field Values
-
P_IND_COMPETES
public static final 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. 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:
- Constant Field Values
-
P_TYPE
public static final java.lang.String P_TYPE
Selection procedure.- See Also:
- Constant Field Values
-
V_UNIFORM
public static final java.lang.String V_UNIFORM
- See Also:
- Constant Field Values
-
V_RANDOM_WALK
public static final java.lang.String V_RANDOM_WALK
- See Also:
- Constant Field Values
-
TYPE_UNIFORM
public static final int TYPE_UNIFORM
- See Also:
- Constant Field Values
-
TYPE_RANDOM_WALK
public static final int TYPE_RANDOM_WALK
- See Also:
- Constant Field Values
-
-
Method Detail
-
setup
public void setup(EvolutionState state, Parameter base)
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}.
- Specified by:
setupin interfacePrototype- Specified by:
setupin interfaceSetup- Overrides:
setupin classTournamentSelection- See Also:
Prototype.setup(EvolutionState,Parameter)
-
defaultBase
public Parameter 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
public int getRandomIndividual(int number, int subpopulation, EvolutionState state, int thread)Description copied from class:TournamentSelectionProduces the index of a (typically uniformly distributed) randomly chosen individual to fill the tournament. number> is the position of the individual in the tournament.- Overrides:
getRandomIndividualin classTournamentSelection
-
-
DMelt 3.0 © DataMelt by jWork.ORG