Moving Peaks
- class MovingPeaks(dimensions, **kwargs)
- The Moving Peaks Benchmark is a fitness function changing over time.It consists of a number of peaks changing in height, width and location.If the kwarg
npeaksis a list of three integers, the number of peakswill fluctuate between the first and the third element of that list, wherethe second element is the initial number of peaks. When fluctuating thenumber of peaks, the kwarg change_severity must be included in kwargs.The default configuration of the Moving Peaks benchmark isMPConfigs.DEFAULT.- Parameters
Table of Kwargs
Parameter
Type
Details
pfuncCallable
The peak function or a list of peak functions.
bfuncCallable
Basis function for static landscape.
npeaksNumOrSeq
Number of peaks. An integer or a list of three integers [min, initial, max].
change_severityfloat
The fraction of the number of peaks that is allowed to change.
min_coordfloat
Minimum coordinate for the centre of the peaks.
max_coordfloat
Maximum coordinate for the centre of the peaks.
min_heightfloat
Minimum height of the peaks.
max_heightfloat
Maximum height of the peaks.
uniform_heightfloat
Starting height of all peaks. Random, if
uniform_height <= 0.min_widthfloat
Minimum width of the peaks.
max_widthfloat
Maximum width of the peaks
uniform_widthfloat
Starting width of all peaks. Random, if
uniform_width <= 0.lambda_float
Correlation between changes.
move_severityfloat
The distance a single peak moves when peaks change.
height_severityfloat
The standard deviation of the change to the height of a peak when peaks change.
width_severityfloat
The standard deviation of the change to the width of a peak when peaks change.
periodint
Period between two changes.
- change_peaks()
Changes the position, the height, the width and the number of peaks.
- __call__(individual, count=True)
Evaluate the given individual in the context of the current configuration.
- Parameters
individual (Individual) – The individual to be evaluated.
count (bool) – Whether to count this evaluation in the total evaluation count, optional.
- Returns
The fitness of the individual.
- Return type
- class MPConfigs
- This class contains the configuration presets for the Moving Peaks problem.The presets are of type
dictand can be accessed as class attributes.Table of Presets
Keys / Presets
DEFAULT
ALT1
ALT2
pfuncMPFuncs.pf1()MPFuncs.pf2()MPFuncs.pf2()bfunclambda x: 10npeaks5
10
50
change_severitymin_coord0.0
0.0
0.0
max_coord100.0
100.0
100.0
min_height30.0
30.0
30.0
max_height70.0
70.0
70.0
uniform_height50.0
50.0
0.0
min_width0.0001
1.0
1.0
max_width0.2
12.0
12.0
uniform_width0.1
0.0
0.0
lambda_0.0
0.5
0.5
move_severity1.0
1.5
1.0
height_severity7.0
7.0
1.0
width_severity0.01
1.0
0.5
period5000
5000
1000
- class MPFuncs
- This class contains the peak functions for the Moving Peaks problem.These functions can be used for creating custom configuration presets.
Table of Functions
- pf1(individual, positions, height, width)
The peak function of the
DEFAULTpreset.- Parameters
individual – The individual to be evaluated.
positions – The positions of the peaks.
height – The height of the peaks.
width – The width of the peaks.
- Returns
The fitness of the individual.
- pf2(individual, positions, height, width)
The peak function of the
ALT1andALT2presets.- Parameters
individual – The individual to be evaluated.
positions – The positions of the peaks.
height – The height of the peaks.
width – The width of the peaks.
- Returns
The fitness of the individual.
- pf3(individual, positions, height, *_)
An optional peak function.
- Parameters
individual – The individual to be evaluated.
positions – The positions of the peaks.
height – The height of the peaks.
- Returns
The fitness of the individual.