GEATbx: Main page  Tutorial  Algorithms  M-functions  Parameter/Options  Example functions  www.geatbx.com

# 3 Selection options

### Selection.Name

This option contains the name of the selection function (name of m-file).

• Default value: selsus
• Type: string or cell array of strings; multi strategy support
• Available selection functions:
• selsus stochastic universal sampling
• seltrunc truncation selection
• seltour tournament selection
• selrws roulette wheel selection
• sellocal local selection (local population model)
• Any other selection function may be used directly; set Selection.Name to the name of the m-file.
• Example - use tournament selection seltour:
`GeaOpt = geaoptset(GeaOpt, 'Selection.Name', 'seltour');`
• Example - use tournament selection seltour for first subpopulation and truncation selection seltrunc for second subpopulation:
```GeaOpt = geaoptset(GeaOpt, 'Selection.Name', ...
{'seltour', 'seltrunc'});```
• Option number in previous versions: 5 (2.x and 1.x), the global variable GLOBAL_SELECTIONFUN is no longer necessary to define special selection functions.

### Selection.Pressure

The value of selection pressure determines the fitness assignment and is used by the ranking algorithm. Fitness assignment is always done by ranking (there is no function for proportional fitness assignment).

• Default value: 1.7
• Type: positive scalar in [1, 2] or [1, Inf]; multi strategy support
• Example - set selection pressure for all subpopulations to 1.9:
`GeaOpt = geaoptset(GeaOpt, 'Selection.Pressure', 1.9);`
• Inside every selection function (Selection.Name) the selection pressure is converted into the algorithm specific parameter (for instance tournament size in tournament selection seltour or truncation threshold in truncation selection seltrunc). See the function/operator descriptions for the used conversions.
• The setting of this option determines/corresponds with the employed ranking method. This behavior may be changed with the option Selection.RankingMethod:
• Option number in previous versions: 26 (2.x) or 23 (1.x)

### Selection.GenerationGap

This option defines the generation gap, the fraction of the population to be reproduced every generation.

• Default value: 0.9
• Type: scalar in [0, Inf]; multi strategy support
• Example - set generation gap to 70%:
`GeaOpt = geaoptset(GeaOpt, 'Selection.GenerationGap', 0.7);`
• Three different ranges of values for the generation gap exist:
• Selection.GenerationGap < 1.0: less offspring than individuals in population are produced. Thus, some individuals of the population survive. This is identical to elitest selection.
• Selection.GenerationGap > 1.0: more offspring than individuals in population are produced. Not all offspring will be inserted into the population.
• Selection.GenerationGap very small (<0.2): only a few offspring are produced. This is identical to steady state algorithms.
• The setting of this option corresponds with Selection.ReinsertionRate.
• Option number in previous versions: 22 (2.x and 1.x)

### Selection.ReinsertionRate

This option defines how much parents are replaced by the produced offspring. The reinsertion rate is only active when the Selection.GenerationGap is larger than the reinsertion rate.

• Default value: 1
• Type: scalar in [0, 1]; multi strategy support
• A reinsertion rate of 1 means that all parents may be replaced by offsprings (provided the generation gap is 1 or larger). A value smaller than 1 assures a few parents are not replaced by offspring. If less offspring are produced (determined by Selection.GenerationGap) than could be reinserted, only the produced offspring are inserted into the population. The reinsertion rate is used inside the reinsertion function reins.
• Example - set reinsertion rate to 0.8:
`GeaOpt = geaoptset(GeaOpt, 'Selection.ReinsertionRate', 0.8);`
• The setting of this option corresponds with Selection.GenerationGap.
• The reinsertion rate is useful when Selection.GenerationGap is larger than 1 (more offspring than parents are produced) and not all parents should be replaced. With a reinsertion rate of smaller than 1 an `elitest selection' can be implemented.
• Option number in previous versions: 23 (2.x), not available/internal option (1.x)

### Selection.RankingMethod

This option sets the employed ranking method (fitness assignment). Employ this option only when the ranking method should be set to non-linear ranking for a Selection.Pressure <= 2.

• Default value: 0
• Type: integer in {0, 1}; multi strategy support
• Example - set ranking method to non-linear ranking for a selection pressure of 1.3:
```GeaOpt = geaoptset(GeaOpt, 'Selection.Pressure', 1.3, ...
'Selection.RankingMethod', 1);```
• The setting of this option corresponds with Selection.Pressure.
• Option number in previous versions: not available/internal option (2.x and 1.x)

### Selection.RankingMultiobj

This option defines the use of multi-objective ranking (fitness assignment). Employ this option only when the objective function uses/returns multiple objective values and multi-objective ranking should be employed.

• Default value: 0
• Type: integer in [0, Inf]; multi strategy support
• Example - switch multi-objective ranking on:
`GeaOpt = geaoptset(GeaOpt, 'Selection.RankingMultiobj', 1);`
• The multi-objective ranking is done inside the ranking function. All other ranking parameters apply as well (selection pressure, ranking method). Multi-objective ranking means, that the sorting/ranking of the individuals is done multi-objective (using pareto ranking and goal attainment) instead of the simple sorting of single-objective individuals. An example for multi-objective ranking and the visualization of such functions is provided in demomop.
• This option corresponds with System.ObjFunGoals.
• Option number in previous versions: not available (2.x and 1.x)

### Selection.ReinsertionMethod

This option sets the employed reinsertion method (selection of offspring for reinsertion in reins).

• Default value: 2
• Type: integer in [0, 6]; multi strategy support
• Reinsertion methods for the global and regional population model (reinsreg), the option Selection.ReinsertionRate is employed:
• 0, 1: uniform at random selection
• >=2: fitness based selection
• Reinsertion methods for the local model (reinsreg), the Selection.ReinsertionRate is not used:
• 0: all offspring are reinserted, neighbors are replaced randomly
• 1: all offspring are reinserted, weakest neighbors are replaced
• 2: only offspring fitter than weakest neighbor are reinserted, weakest neighbors are replaced
• 3: only offspring fitter than weakest neighbor are reinserted, parents are replaced
• 4: only offspring fitter than weakest neighbor are reinserted, neighbors are replaced randomly
• 5: only offspring fitter than parents are reinserted, parents are replaced
• 6: all offspring are reinserted, parents are replaced
• Example - set reinsertion method to uniform at random (global/regional population model):
`GeaOpt = geaoptset(GeaOpt, 'Selection.ReinsertionMethod', 0);`

### Selection.LocalDimension

This option determines the number of dimensions of the population when using the local population model (the use of the local population model is defined by using sellocal as selection algorithm (Selection.Name) for the respective subpopulation).

• Default value: 0
• Type: integer in [0, Inf]; multi strategy support
• 0: number of dimensions is calculated depending on NumberIndividuals (see comploc),
1: 1-D - linear,
2: 2-D - grid,
3: 3-D - ... (The number of dimensions of the local model could be as large as sensible.)
The number of individuals in every dimension is calculated inside comploc. Special values may be defined by setting Selection.LocalDimension=0 and the global variable GLOBAL_LOCALDIM. These values for the number of individuals in every dimension are directly used.
• Example - set number of local dimensions to 3:
`GeaOpt = geaoptset(GeaOpt, 'Selection.LocalDimension', 3);`
• Example - set individuals per dimension directly:
```global GLOBAL_LOCALDIM;
GLOBAL_LOCALDIM = [2, 20]; (ladder topology)
GeaOpt = geaoptset(GeaOpt, 'Selection.LocalDimension', 0);```

### Selection.LocalTopology

This option determines the topology of the neighborhood when using the local population model. The calculation of the neighborhood is done in comploc.

• Default value: 0
• Type: positive integer in [0, 19]; multi strategy support
• The topology defined is independent of the dimension of the neighborhood. The internal neighborhood description calculates the correct neighbors for all possible dimensions:
• 0: ring (1-D), cross (2-D); full topology
• 1: star (2-D); full topology
• 2: inclined star (2-D); full topology
• 8: all neighbors within a radius smaller than Selection.LocalDistance; full topology
• 9: as many neighbors as defined in Selection.LocalDistance; full topology
• +10: the same as all previous options above with half topology
• i.e., 11: half star (star with half topology)
• Example - set topology of local neighborhood to full cross for first and half star for second subpopulation:
`GeaOpt = geaoptset(GeaOpt, 'Selection.LocalTopology', [0, 11]);`

### Selection.LocalDistance

This option determines the largest distance to neighbors or the number of neighbors when using the local population model, depending on Selection.LocalTopology.

• Default value: 1
• Type: positive integer in [1, Inf]; multi strategy support
• Example - set local topology to full star and distance to 3:
```GeaOpt = geaoptset(GeaOpt, 'Selection.LocalTopology', 1, ...
'Selection.LocalDistance', 3);```

 GEATbx: Main page  Tutorial  Algorithms  M-functions  Parameter/Options  Example functions  www.geatbx.com

This document is part of version 3.8 of the GEATbx: Genetic and Evolutionary Algorithm Toolbox for use with Matlab - www.geatbx.com.
The Genetic and Evolutionary Algorithm Toolbox is not public domain.