Benchmarks¶
deap_er.benchmarks
¶
MovingPeaks(dimensions, **kwargs)
¶
A fitness landscape whose peaks change over time.
Peaks move in height, width, and location. If npeaks is a list
of three integers, the peak count fluctuates between the first and
third values, starting at the second. Fluctuating the count requires
change_severity in kwargs. The default preset is
MPConfigs.DEFAULT.
.. dropdown:: Table of Kwargs :margin: 0 5 0 0
pfunc (Callable)
The peak function or a list of peak functions.
bfunc (Callable)
Basis function for static landscape.
npeaks (NumOrSeq)
Number of peaks. An integer or a list of three
integers [min, initial, max].
change_severity (float)
The fraction of the number of peaks that is
allowed to change.
min_coord (float)
Minimum coordinate for the centre of the peaks.
max_coord (float)
Maximum coordinate for the centre of the peaks.
min_height (float)
Minimum height of the peaks.
max_height (float)
Maximum height of the peaks.
uniform_height (float)
Starting height of all peaks. Random, if
uniform_height <= 0.
min_width (float)
Minimum width of the peaks.
max_width (float)
Maximum width of the peaks
uniform_width (float)
Starting width of all peaks. Random, if
uniform_width <= 0.
lambda_ (float)
Correlation between changes.
move_severity (float)
The distance a single peak moves when peaks change.
height_severity (float)
The standard deviation of the change to the height
of a peak when peaks change.
width_severity (float)
The standard deviation of the change to the width
of a peak when peaks change.
period (int)
Period between two changes.
Build a moving-peaks landscape.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dimensions
|
int
|
Dimensionality of the search domain. |
required |
**kwargs
|
Any
|
Optional landscape settings. See the class docstring table of kwargs. |
{}
|
Source code in deap_er/private/benchmarks/moving_peaks.py
global_maximum
property
¶
Returns the value and position of the largest peak.
sorted_maxima
property
¶
Return visible peak values and positions, largest first.
offline_error
property
¶
Returns the offline error of the landscape, or 0.0 before the first evaluation.
current_error
property
¶
Returns the current error of the landscape.
__call__(individual, count=True)
¶
Evaluate the given individual in the context of the current configuration.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
individual
|
Sequence[float]
|
Individual to evaluate. |
required |
count
|
bool
|
Whether to include this evaluation in the evaluation count and error statistics. |
True
|
Returns:
| Type | Description |
|---|---|
tuple[float]
|
The fitness of the individual. |
Source code in deap_er/private/benchmarks/moving_peaks.py
MPConfigs
¶
Configuration presets for the Moving Peaks problem.
Each preset is a dict class attribute.
.. dropdown:: Table of Presets :margin: 0 5 0 0
=================== ===================== ===================== =====================
Keys / Presets **DEFAULT** **ALT1** **ALT2**
=================== ===================== ===================== =====================
``pfunc`` ``MPFuncs.pf1`` ``MPFuncs.pf2`` ``MPFuncs.pf2``
``bfunc`` :obj:`None` :obj:`None` :obj:`lambda x: 10`
``npeaks`` 5 10 50
``change_severity`` :obj:`None` :obj:`None` :obj:`None`
``min_coord`` 0.0 0.0 0.0
``max_coord`` 100.0 100.0 100.0
``min_height`` 30.0 30.0 30.0
``max_height`` 70.0 70.0 70.0
``uniform_height`` 50.0 50.0 0.0
``min_width`` 0.0001 1.0 1.0
``max_width`` 0.2 12.0 12.0
``uniform_width`` 0.1 0.0 0.0
``lambda_`` 0.0 0.5 0.5
``move_severity`` 1.0 1.5 1.0
``height_severity`` 7.0 7.0 1.0
``width_severity`` 0.01 1.0 0.5
``period`` 5000 5000 1000
=================== ===================== ===================== =====================
MPFuncs
¶
Peak functions for Moving Peaks custom presets.
pf1(individual, positions, height, width)
staticmethod
¶
The peak function of the :data:DEFAULT preset.
Official Moving Peaks scenario 1 is the squared form
height / (1 + width * sum((x_i - p_i)^2)).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
individual
|
Sequence[float]
|
Individual to evaluate. |
required |
positions
|
Iterable[float]
|
Peak centre coordinates. |
required |
height
|
float
|
Peak height. |
required |
width
|
float
|
Peak width. |
required |
Returns:
| Type | Description |
|---|---|
float
|
The fitness of the individual. |
Source code in deap_er/private/benchmarks/moving_peaks_catalog.py
pf2(individual, positions, height, width)
staticmethod
¶
The peak function of the :data:ALT1 and :data:ALT2 presets.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
individual
|
Sequence[float]
|
Individual to evaluate. |
required |
positions
|
Iterable[float]
|
Peak centre coordinates. |
required |
height
|
float
|
Peak height. |
required |
width
|
float
|
Peak width. |
required |
Returns:
| Type | Description |
|---|---|
float
|
The fitness of the individual. |
Source code in deap_er/private/benchmarks/moving_peaks_catalog.py
pf3(individual, positions, height, *_)
staticmethod
¶
An optional peak function.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
individual
|
Sequence[float]
|
Individual to evaluate. |
required |
positions
|
Iterable[float]
|
Peak centre coordinates. |
required |
height
|
float
|
Peak height. |
required |
Returns:
| Type | Description |
|---|---|
float
|
The fitness of the individual. |
Source code in deap_er/private/benchmarks/moving_peaks_catalog.py
bm_chuang_f1(individual)
¶
Evaluate Chuang and Hsu's first binary deceptive function.
From "Multivariate Multi-Model Approach for Globally Multimodal Problems". Two global optima at all-ones and all-zeros. The individual must have 41 dimensions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
individual
|
Individual
|
Individual to evaluate. |
required |
Returns:
| Type | Description |
|---|---|
tuple[int]
|
The deceptive function value. |
Source code in deap_er/private/benchmarks/binary.py
bm_chuang_f2(individual)
¶
Evaluate Chuang and Hsu's second binary deceptive function.
From "Multivariate Multi-Model Approach for Globally Multimodal Problems". Four global optima: half-and-half, reverse half-and-half, all-ones, and all-zeros. The individual must have 41 dimensions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
individual
|
Individual
|
Individual to evaluate. |
required |
Returns:
| Type | Description |
|---|---|
tuple[int]
|
The deceptive function value. |
Source code in deap_er/private/benchmarks/binary.py
bm_chuang_f3(individual)
¶
Evaluate Chuang and Hsu's third binary deceptive function.
From "Multivariate Multi-Model Approach for Globally Multimodal Problems". Two global optima at all-ones and all-zeros. The individual must have 41 dimensions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
individual
|
Individual
|
Individual to evaluate. |
required |
Returns:
| Type | Description |
|---|---|
tuple[int]
|
The deceptive function value. |
Source code in deap_er/private/benchmarks/binary.py
bm_royal_road_1(individual, order)
¶
Evaluate Royal Road function R1.
As presented by Melanie Mitchell in "An introduction to Genetic Algorithms".
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
individual
|
Individual
|
Individual to evaluate. |
required |
order
|
int
|
Order of the royal road function. |
required |
Returns:
| Type | Description |
|---|---|
tuple[int]
|
The royal road function value. |
Source code in deap_er/private/benchmarks/binary.py
bm_royal_road_2(individual, order)
¶
Evaluate Royal Road function R2.
As presented by Melanie Mitchell in "An introduction to Genetic Algorithms".
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
individual
|
Individual
|
Individual to evaluate. |
required |
order
|
int
|
Order of the royal road function. |
required |
Returns:
| Type | Description |
|---|---|
tuple[int]
|
The royal road function value. |
Source code in deap_er/private/benchmarks/binary.py
bm_dtlz_1(individual, count)
¶
Evaluate the DTLZ1 multi-objective function.
Returns a list of size count. The individual must have at
least count elements.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
individual
|
Individual
|
Individual to evaluate. |
required |
count
|
int
|
Number of objectives. |
required |
Returns:
| Type | Description |
|---|---|
list[float]
|
Fitness values of the individual. |
Equations
\(f_{1}(\mathbf{x}) = \frac{1}{2} (1 + g(\mathbf{x}_m)) \prod_{i=1}^{m-1}x_i\)
\(f_{m-1}(\mathbf{x}) = \frac{1}{2} (1 + g(\mathbf{x}_m)) (1 - x_2) x_1\)
\(\ldots\)
\(f_{m}(\mathbf{x}) = \frac{1}{2} (1 - x_1)(1 + g(\mathbf{x}_m))\)
Where \(m\) is the number of objectives and \(\mathbf{x}_m\) is a vector of the remaining attributes \([x_m~\ldots~x_n]\) of the individual in \(n > m\) dimensions.
Source code in deap_er/private/benchmarks/bm_dtlz_1_4.py
bm_dtlz_2(individual, count)
¶
Evaluate the DTLZ2 multi-objective function.
Returns a list of size count. The individual must have at
least count elements.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
individual
|
Individual
|
Individual to evaluate. |
required |
count
|
int
|
Number of objectives. |
required |
Returns:
| Type | Description |
|---|---|
list[float]
|
Fitness values of the individual. |
Equations
\(g(\mathbf{x}_m) = \sum_{x_i \in \mathbf{x}_m} (x_i - 0.5)^2\)
\(f_{1}(\mathbf{x}) = (1 + g(\mathbf{x}_m)) \prod_{i=1}^{m-1} \cos(0.5x_i\pi)\)
\(\ldots\)
\(f_{m}(\mathbf{x}) = (1 + g(\mathbf{x}_m)) \sin(0.5x_{1}\pi )\)
Where \(m\) is the number of objectives and \(\mathbf{x}_m\) is a vector of the remaining attributes \([x_m~\ldots~x_n]\) of the individual in \(n > m\) dimensions.
Source code in deap_er/private/benchmarks/bm_dtlz_1_4.py
bm_dtlz_3(individual, count)
¶
Evaluate the DTLZ3 multi-objective function.
Returns a list of size count. The individual must have at
least count elements.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
individual
|
Individual
|
Individual to evaluate. |
required |
count
|
int
|
Number of objectives. |
required |
Returns:
| Type | Description |
|---|---|
list[float]
|
Fitness values of the individual. |
Equations
\(f_{1}(\mathbf{x}) = (1 + g(\mathbf{x}_m)) \prod_{i=1}^{m-1} \cos(0.5x_i\pi)\)
\(\ldots\)
\(f_{m}(\mathbf{x}) = (1 + g(\mathbf{x}_m)) \sin(0.5x_{1}\pi )\)
Where \(m\) is the number of objectives and \(\mathbf{x}_m\) is a vector of the remaining attributes \([x_m~\ldots~x_n]\) of the individual in \(n > m\) dimensions.
Source code in deap_er/private/benchmarks/bm_dtlz_1_4.py
bm_dtlz_4(individual, count, alpha)
¶
Evaluate the DTLZ4 multi-objective function.
Returns a list of size count. The individual must have at
least count elements.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
individual
|
Individual
|
Individual to evaluate. |
required |
count
|
int
|
Number of objectives. |
required |
alpha
|
float
|
Fitness values exponentiation factor. |
required |
Returns:
| Type | Description |
|---|---|
list[float]
|
Fitness values of the individual. |
Equations
\(g(\mathbf{x}_m) = \sum_{x_i \in \mathbf{x}_m} (x_i - 0.5)^2\)
\(f_{1}(\mathbf{x}) = (1 + g(\mathbf{x}_m)) \prod_{i=1}^{m-1} \cos(0.5x_i^\alpha\pi)\)
\(\ldots\)
\(f_{m}(\mathbf{x}) = (1 + g(\mathbf{x}_m)) \sin(0.5x_{1}^\alpha\pi )\)
Where \(m\) is the number of objectives and \(\mathbf{x}_m\) is a vector of the remaining attributes \([x_m~\ldots~x_n]\) of the individual in \(n > m\) dimensions.
Source code in deap_er/private/benchmarks/bm_dtlz_1_4.py
bm_dtlz_5(individual, count)
¶
Evaluate the DTLZ5 multi-objective function.
Returns a list of size count. The individual must have at
least count elements.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
individual
|
Individual
|
Individual to evaluate. |
required |
count
|
int
|
Number of objectives. |
required |
Returns:
| Type | Description |
|---|---|
list[float]
|
Fitness values of the individual. |
Equations
\(g(\mathbf{x}_m) = \text{ ?}\)
\(f_{1}(\mathbf{x}) = \text{ ?}\)
\(f_{2}(\mathbf{x}) = \text{ ?}\)
\(\ldots\)
\(f_{m}(\mathbf{x}) = \text{ ?}\)
Where \(m\) is the number of objectives and \(\mathbf{x}_m\) is a vector of the remaining attributes \([x_m~\ldots~x_n]\) of the individual in \(n > m\) dimensions.
Source code in deap_er/private/benchmarks/bm_dtlz_5_7.py
bm_dtlz_6(individual, count)
¶
Evaluate the DTLZ6 multi-objective function.
Returns a list of size count. The individual must have at
least count elements.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
individual
|
Individual
|
Individual to evaluate. |
required |
count
|
int
|
Number of objectives. |
required |
Returns:
| Type | Description |
|---|---|
list[float]
|
Fitness values of the individual. |
Equations
\(g(\mathbf{x}_m) = \text{ ?}\)
\(f_{1}(\mathbf{x}) = \text{ ?}\)
\(f_{2}(\mathbf{x}) = \text{ ?}\)
\(\ldots\)
\(f_{m}(\mathbf{x}) = \text{ ?}\)
Where \(m\) is the number of objectives and \(\mathbf{x}_m\) is a vector of the remaining attributes \([x_m~\ldots~x_n]\) of the individual in \(n > m\) dimensions.
Source code in deap_er/private/benchmarks/bm_dtlz_5_7.py
bm_dtlz_7(individual, count)
¶
Evaluate the DTLZ7 multi-objective function.
Returns a list of size count. The individual must have at
least count elements.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
individual
|
Individual
|
Individual to evaluate. |
required |
count
|
int
|
Number of objectives. |
required |
Returns:
| Type | Description |
|---|---|
list[float]
|
Fitness values of the individual. |
Equations
\(g(\mathbf{x}_m) = \text{ ?}\)
\(f_{1}(\mathbf{x}) = \text{ ?}\)
\(f_{2}(\mathbf{x}) = \text{ ?}\)
\(\ldots\)
\(f_{m}(\mathbf{x}) = \text{ ?}\)
Where \(m\) is the number of objectives and \(\mathbf{x}_m\) is a vector of the remaining attributes \([x_m~\ldots~x_n]\) of the individual in \(n > m\) dimensions.
Source code in deap_er/private/benchmarks/bm_dtlz_5_7.py
bm_himmelblau(individual)
¶
The Himmelblau function has four minima in \([-6, 6]^2\).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
individual
|
Individual
|
Individual to evaluate. |
required |
Returns:
| Type | Description |
|---|---|
tuple[float]
|
Fitness value of the individual. |
Equations
| Type | minimization |
| Range | \(x_i \in [-6, 6]\) |
| Global optima | see below |
| Function | see below |
\(\mathbf{x}_1 = (3.0, 2.0)\), \(f(\mathbf{x}_1) = 0\)
\(\mathbf{x}_2 = (-2.805118, 3.131312)\), \(f(\mathbf{x}_2) = 0\)
\(\mathbf{x}_3 = (-3.779310, -3.283186)\), \(f(\mathbf{x}_3) = 0\)
\(\mathbf{x}_4 = (3.584428, -1.848126)\), \(f(\mathbf{x}_4) = 0\)
Source code in deap_er/private/benchmarks/bm_landscape.py
bm_schaffer(individual)
¶
Schaffer test objective function.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
individual
|
Individual
|
Individual to evaluate. |
required |
Returns:
| Type | Description |
|---|---|
tuple[float]
|
Fitness value of the individual. |
Equations
| Type | minimization |
| Range | \(x_i \in [-100, 100]\) |
| Global optima | \(x_i = 0, \forall i \in \lbrace 1 \ldots N\rbrace\), \(f(\mathbf{x}) = 0\) |
| Function | see below |
Source code in deap_er/private/benchmarks/bm_landscape.py
bm_schwefel(individual)
¶
Schwefel test objective function.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
individual
|
Individual
|
Individual to evaluate. |
required |
Returns:
| Type | Description |
|---|---|
tuple[float]
|
Fitness value of the individual. |
Equations
| Type | minimization |
| Range | \(x_i \in [-500, 500]\) |
| Global optima | see below |
| Function | see below |
\(x_i = 420.96874636\), \(\forall i \in \lbrace 1 \ldots N\rbrace\), \(f(\mathbf{x}) = 0\)
Source code in deap_er/private/benchmarks/bm_landscape.py
bm_dent(individual, dent_size=0.85)
¶
Evaluate a two-objective problem with a dent.
The individual must have two attributes in [-1.5, 1.5].
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
individual
|
Individual
|
Individual to evaluate. |
required |
dent_size
|
float
|
Size of the dent. |
0.85
|
Returns:
| Type | Description |
|---|---|
tuple[float, float]
|
Fitness values of the individual. |
Equations
\(f_{1}(\mathbf{x}) = \text{ ?}\)
\(f_{2}(\mathbf{x}) = \text{ ?}\)
Returns \(f_{1}(\mathbf{x})\) and \(f_{2}(\mathbf{x})\).
Source code in deap_er/private/benchmarks/bm_mo_classic.py
bm_fonseca(individual)
¶
Fonseca and Fleming's multiobjective function.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
individual
|
Individual
|
Individual to evaluate. |
required |
Returns:
| Type | Description |
|---|---|
tuple[float, float]
|
Fitness values of the individual. |
Equations
\(f_{1}(\mathbf{x}) = 1 - e^{-\sum_{i=1}^{3}(x_i - \frac{1}{\sqrt{3}})^2}\)
\(f_{2}(\mathbf{x}) = 1 - e^{-\sum_{i=1}^{3}(x_i + \frac{1}{\sqrt{3}})^2}\)
Returns \(f_{1}(\mathbf{x})\) and \(f_{2}(\mathbf{x})\).
Source code in deap_er/private/benchmarks/bm_mo_classic.py
bm_kursawe(individual)
¶
Kursawe multi-objective function.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
individual
|
Individual
|
Individual to evaluate. |
required |
Returns:
| Type | Description |
|---|---|
tuple[float, float]
|
Fitness values of the individual. |
Equations
\(f_{1}(\mathbf{x}) = \sum_{i=1}^{N-1} -10 e^{-0.2 \sqrt{x_i^2 + x_{i+1}^2} }\)
\(f_{2}(\mathbf{x}) = \sum_{i=1}^{N} |x_i|^{0.8} + 5 \sin(x_i^3)\)
Returns \(f_{1}(\mathbf{x})\) and \(f_{2}(\mathbf{x})\).
Source code in deap_er/private/benchmarks/bm_mo_classic.py
bm_poloni(individual)
¶
Poloni's multiobjective function on a two-attribute individual.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
individual
|
Individual
|
Individual to evaluate. |
required |
Returns:
| Type | Description |
|---|---|
tuple[float, float]
|
Fitness values of the individual. |
Equations
\(A_1 = 0.5 \sin (1) - 2 \cos (1) + \sin (2) - 1.5 \cos (2)\)
\(A_2 = 1.5 \sin (1) - \cos (1) + 2 \sin (2) - 0.5 \cos (2)\)
\(B_1 = 0.5 \sin (x_1) - 2 \cos (x_1) + \sin (x_2) - 1.5 \cos (x_2)\)
\(B_2 = 1.5 \sin (x_1) - cos(x_1) + 2 \sin (x_2) - 0.5 \cos (x_2)\)
\(f_{1}(\mathbf{x}) = 1 + (A_1 - B_1)^2 + (A_2 - B_2)^2\)
\(f_{2}(\mathbf{x}) = (x_1 + 3)^2 + (x_2 + 1)^2\)
Returns \(f_{1}(\mathbf{x})\) and \(f_{2}(\mathbf{x})\).
Source code in deap_er/private/benchmarks/bm_mo_classic.py
bm_schaffer_mo(individual)
¶
Schaffer's multi-objective function on a one-attribute individual.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
individual
|
Individual
|
Individual to evaluate. |
required |
Returns:
| Type | Description |
|---|---|
tuple[float, float]
|
Fitness values of the individual. |
Equations
\(f_{1}(\mathbf{x}) = x_1^2\)
\(f_{2}(\mathbf{x}) = (x_1-2)^2\)
Returns \(f_{1}(\mathbf{x})\) and \(f_{2}(\mathbf{x})\).
Source code in deap_er/private/benchmarks/bm_mo_classic.py
bm_ackley(individual)
¶
Ackley test objective function.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
individual
|
Individual
|
Individual to evaluate. |
required |
Returns:
| Type | Description |
|---|---|
tuple[float]
|
Fitness value of the individual. |
Equations
| Type | minimization |
| Range | \(x_i \in [-15, 30]\) |
| Global optima | \(x_i = 0, \forall i \in \lbrace 1 \ldots N\rbrace\), \(f(\mathbf{x}) = 0\) |
| Function | see below |
Source code in deap_er/private/benchmarks/bm_multimodal.py
bm_bohachevsky(individual)
¶
Bohachevsky test objective function.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
individual
|
Individual
|
Individual to evaluate. |
required |
Returns:
| Type | Description |
|---|---|
tuple[float]
|
Fitness value of the individual. |
Equations
| Type | minimization |
| Range | \(x_i \in [-100, 100]\) |
| Global optima | \(x_i = 0, \forall i \in \lbrace 1 \ldots N\rbrace\), \(f(\mathbf{x}) = 0\) |
| Function | see below |
Source code in deap_er/private/benchmarks/bm_multimodal.py
bm_griewank(individual)
¶
Griewank test objective function.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
individual
|
Individual
|
Individual to evaluate. |
required |
Returns:
| Type | Description |
|---|---|
tuple[float]
|
Fitness value of the individual. |
Equations
| Type | minimization |
| Range | \(x_i \in [-600, 600]\) |
| Global optima | \(x_i = 0, \forall i \in \lbrace 1 \ldots N\rbrace\), \(f(\mathbf{x}) = 0\) |
| Function | see below |
Source code in deap_er/private/benchmarks/bm_multimodal.py
bm_h1(individual)
¶
Simple two-dimensional function containing several local maxima.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
individual
|
Individual
|
Individual to evaluate. |
required |
Returns:
| Type | Description |
|---|---|
tuple[float]
|
Fitness value of the individual. |
Equations
| Type | maximization |
| Range | \(x_i \in [-100, 100]\) |
| Global optima | \(\mathbf{x} = (8.6998, 6.7665)\), \(f(\mathbf{x}) = 2\) |
| Function | see below |
Source code in deap_er/private/benchmarks/bm_multimodal.py
bm_rastrigin(individual)
¶
Rastrigin test objective function.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
individual
|
Individual
|
Individual to evaluate. |
required |
Returns:
| Type | Description |
|---|---|
tuple[float]
|
Fitness value of the individual. |
Equations
| Type | minimization |
| Range | \(x_i \in [-5.12, 5.12]\) |
| Global optima | \(x_i = 0, \forall i \in \lbrace 1 \ldots N\rbrace\), \(f(\mathbf{x}) = 0\) |
| Function | \(f(\mathbf{x}) = 10N + \sum_{i=1}^N x_i^2 - 10 \cos(2\pi x_i)\) |
Source code in deap_er/private/benchmarks/bm_rastrigin.py
bm_rastrigin_scaled(individual)
¶
Scaled Rastrigin test objective function.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
individual
|
Individual
|
Individual to evaluate. |
required |
Returns:
| Type | Description |
|---|---|
tuple[float]
|
Fitness value of the individual. |
Equations
| Type | minimization |
| Range | \(x_i \in [-5.12, 5.12]\) |
| Global optima | \(x_i = 0, \forall i \in \lbrace 1 \ldots N\rbrace\), \(f(\mathbf{x}) = 0\) |
| Function | see below |
Source code in deap_er/private/benchmarks/bm_rastrigin.py
bm_rastrigin_skewed(individual)
¶
Skewed Rastrigin test objective function.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
individual
|
Individual
|
Individual to evaluate. |
required |
Returns:
| Type | Description |
|---|---|
tuple[float]
|
Fitness value of the individual. |
Equations
| Type | minimization |
| Range | \(x_i \in [-5.12, 5.12]\) |
| Global optima | \(x_i = 0, \forall i \in \lbrace 1 \ldots N\rbrace\), \(f(\mathbf{x}) = 0\) |
| Function | see below |
\(f(\mathbf{x}) = 10N + \sum_{i=1}^N \left(y_i^2 - 10 \cos(2\pi x_i)\right)\)
\(\text{where } y_i = 10\cdot x_i \text{ if } x_i > 0 \text{, else } x_i\)
Source code in deap_er/private/benchmarks/bm_rastrigin.py
bm_shekel(individual, matrix, vector)
¶
Evaluate the Shekel multimodal function.
The number of maxima is the length of matrix and vector.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
individual
|
Individual
|
Individual to evaluate. |
required |
matrix
|
ndarray
|
Matrix of size \(M\times N\), where \(M\) is the number of maxima and \(N\) is the number of dimensions. |
required |
vector
|
ndarray
|
Vector of size \(M\times 1\), where \(M\) is the number of maxima. |
required |
Returns:
| Type | Description |
|---|---|
tuple[float]
|
Fitness value of the individual. |
Equations
| Type | maximization |
| Range | None |
| Global optima | None |
| Function | see below |
Source code in deap_er/private/benchmarks/bm_rastrigin.py
bm_cigar(individual)
¶
Cigar test objective function.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
individual
|
Individual
|
Individual to evaluate. |
required |
Returns:
| Type | Description |
|---|---|
tuple[float]
|
Fitness value of the individual. |
Equations
| Type | minimization |
| Range | none |
| Global optima | \(x_i = 0, \forall i \in \lbrace 1 \ldots N\rbrace\), \(f(\mathbf{x}) = 0\) |
| Function | \(f(\mathbf{x}) = x_0^2 + 10^6\sum_{i=1}^N\,x_i^2\) |
Source code in deap_er/private/benchmarks/bm_unimodal.py
bm_plane(individual)
¶
Plane test objective function.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
individual
|
Individual
|
Individual to evaluate. |
required |
Returns:
| Type | Description |
|---|---|
tuple[float]
|
The first attribute of the individual. |
Equations
| Type | minimization |
| Range | none |
| Global optima | \(x_i = 0, \forall i \in \lbrace 1 \ldots N\rbrace\), \(f(\mathbf{x}) = 0\) |
| Function | \(f(\mathbf{x}) = x_0\) |
Source code in deap_er/private/benchmarks/bm_unimodal.py
bm_rand(*_)
¶
Random test objective function. Unused extra arguments are ignored.
Returns:
| Type | Description |
|---|---|
tuple[float]
|
A uniformly random number in |
Equations
| Type | minimization or maximization |
| Range | none |
| Global optima | none |
| Function | \(f(\mathbf{x}) = \text{random}(0,1)\) |
Source code in deap_er/private/benchmarks/bm_unimodal.py
bm_rosenbrock(individual)
¶
Rosenbrock test objective function.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
individual
|
Individual
|
Individual to evaluate. |
required |
Returns:
| Type | Description |
|---|---|
tuple[float]
|
Fitness value of the individual. |
Equations
| Type | minimization |
| Range | none |
| Global optima | \(x_i = 1, \forall i \in \lbrace 1 \ldots N\rbrace\), \(f(\mathbf{x}) = 0\) |
| Function | \(f(\mathbf{x}) = \sum_{i=1}^{N-1} (1-x_i)^2 + 100 (x_{i+1} - x_i^2 )^2\) |
Source code in deap_er/private/benchmarks/bm_unimodal.py
bm_sphere(individual)
¶
Sphere test objective function.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
individual
|
Individual
|
Individual to evaluate. |
required |
Returns:
| Type | Description |
|---|---|
tuple[float]
|
Fitness value of the individual. |
Equations
| Type | minimization |
| Range | none |
| Global optima | \(x_i = 0, \forall i \in \lbrace 1 \ldots N\rbrace\), \(f(\mathbf{x}) = 0\) |
| Function | \(f(\mathbf{x}) = \sum_{i=1}^Nx_i^2\) |
Source code in deap_er/private/benchmarks/bm_unimodal.py
bm_zdt_1(individual)
¶
ZDT1 multi-objective function.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
individual
|
Individual
|
Individual to evaluate. |
required |
Returns:
| Type | Description |
|---|---|
tuple[float, float]
|
Fitness values of the individual. |
Equations
\(g(\mathbf{x}) = 1 + \frac{9}{n-1}\sum_{i=2}^n x_i\)
\(f_{1}(\mathbf{x}) = x_1\)
\(f_{2}(\mathbf{x}) = g(\mathbf{x})\left[1 - \sqrt{\frac{x_1}{g(\mathbf{x})}}\right]\)
Returns \(f_{1}(\mathbf{x})\) and \(f_{2}(\mathbf{x})\).
Source code in deap_er/private/benchmarks/bm_zdt.py
bm_zdt_2(individual)
¶
ZDT2 multi-objective function.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
individual
|
Individual
|
Individual to evaluate. |
required |
Returns:
| Type | Description |
|---|---|
tuple[float, float]
|
Fitness values of the individual. |
Equations
\(g(\mathbf{x}) = 1 + \frac{9}{n-1}\sum_{i=2}^n x_i\)
\(f_{1}(\mathbf{x}) = x_1\)
Returns \(f_{1}(\mathbf{x})\) and \(f_{2}(\mathbf{x})\).
Source code in deap_er/private/benchmarks/bm_zdt.py
bm_zdt_3(individual)
¶
ZDT3 multi-objective function.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
individual
|
Individual
|
Individual to evaluate. |
required |
Returns:
| Type | Description |
|---|---|
tuple[float, float]
|
Fitness values of the individual. |
Equations
\(g(\mathbf{x}) = 1 + \frac{9}{n-1}\sum_{i=2}^n x_i\)
\(f_{1}(\mathbf{x}) = x_1\)
Returns \(f_{1}(\mathbf{x})\) and \(f_{2}(\mathbf{x})\).
Source code in deap_er/private/benchmarks/bm_zdt.py
bm_zdt_4(individual)
¶
ZDT4 multi-objective function.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
individual
|
Individual
|
Individual to evaluate. |
required |
Returns:
| Type | Description |
|---|---|
tuple[float, float]
|
Fitness values of the individual. |
Equations
\(g(\mathbf{x}) = 1 + 10(n-1) + \sum_{i=2}^n \left[ x_i^2 - 10\cos(4\pi x_i) \right]\)
\(f_{1}(\mathbf{x}) = x_1\)
Returns \(f_{1}(\mathbf{x})\) and \(f_{2}(\mathbf{x})\).
Source code in deap_er/private/benchmarks/bm_zdt.py
bm_zdt_6(individual)
¶
ZDT6 multi-objective function.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
individual
|
Individual
|
Individual to evaluate. |
required |
Returns:
| Type | Description |
|---|---|
tuple[float, float]
|
Fitness values of the individual. |
Equations
\(g(\mathbf{x}) = 1 + 9 \left[ \left(\sum_{i=2}^n x_i\right)/(n-1) \right]^{0.25}\)
\(f_{1}(\mathbf{x}) = 1 - \exp(-4x_1)\sin^6(6\pi x_1)\)
Returns \(f_{1}(\mathbf{x})\) and \(f_{2}(\mathbf{x})\).
Source code in deap_er/private/benchmarks/bm_zdt.py
bm_kotanchek(individual)
¶
Kotanchek benchmark function.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
individual
|
Individual
|
Individual to evaluate. |
required |
Returns:
| Type | Description |
|---|---|
float
|
The fitness of the individual. |
Equations
| Range | \(\mathbf{x} \in [-1, 7]^2\) |
| Function | \(f(\mathbf{x}) = \frac{e^{-(x_1 - 1)^2}}{1.2 + (x_2 - 2.5)^2}\) |
Source code in deap_er/private/benchmarks/symb_regr.py
bm_rational_polynomial_1(individual)
¶
Rational polynomial ball benchmark function.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
individual
|
Individual
|
Individual to evaluate. |
required |
Returns:
| Type | Description |
|---|---|
float
|
The fitness of the individual. |
Equations
| Range | \(\mathbf{x} \in [0, 2]^3\) |
| Function | \(f(\mathbf{x}) = \frac{30 * (x_1 - 1) (x_3 - 1)}{x_2^2 (x_1 - 10)}\) |
Source code in deap_er/private/benchmarks/symb_regr.py
bm_rational_polynomial_2(individual)
¶
Rational polynomial benchmark function.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
individual
|
Individual
|
Individual to evaluate. |
required |
Returns:
| Type | Description |
|---|---|
float
|
The fitness of the individual. |
Equations
| Range | \(\mathbf{x} \in [0, 6]^2\) |
| Function | see below |
Source code in deap_er/private/benchmarks/symb_regr.py
bm_ripple(individual)
¶
Ripple benchmark function.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
individual
|
Individual
|
Individual to evaluate. |
required |
Returns:
| Type | Description |
|---|---|
float
|
The fitness of the individual. |
Equations
| Range | \(\mathbf{x} \in [-5, 5]^2\) |
| Function | \(f(\mathbf{x}) = (x_1 - 3) (x_2 - 3) + 2 \sin((x_1 - 4) (x_2 -4))\) |
Source code in deap_er/private/benchmarks/symb_regr.py
bm_salustowicz_1d(individual)
¶
Salustowicz benchmark function.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
individual
|
Individual
|
Individual to evaluate. |
required |
Returns:
| Type | Description |
|---|---|
float
|
The fitness of the individual. |
Equations
| Range | \(x \in [0, 10]\) |
| Function | \(f(x) = e^{-x} x^3 \cos(x) \sin(x) (\cos(x) \sin^2(x) - 1)\) |
Source code in deap_er/private/benchmarks/symb_regr.py
bm_salustowicz_2d(individual)
¶
Salustowicz benchmark function.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
individual
|
Individual
|
Individual to evaluate. |
required |
Returns:
| Type | Description |
|---|---|
float
|
The fitness of the individual. |
Equations
| Range | \(\mathbf{x} \in [0, 7]^2\) |
| Function | see below |
Source code in deap_er/private/benchmarks/symb_regr.py
bm_sin_cos(individual)
¶
Sine cosine benchmark function.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
individual
|
Individual
|
Individual to evaluate. |
required |
Returns:
| Type | Description |
|---|---|
float
|
The fitness of the individual. |
Equations
| Range | \(\mathbf{x} \in [0, 6]^2\) |
| Function | \(f(\mathbf{x}) = 6\sin(x_1)\cos(x_2)\) |
Source code in deap_er/private/benchmarks/symb_regr.py
bm_unwrapped_ball(individual)
¶
Unwrapped ball benchmark function.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
individual
|
Individual
|
Individual to evaluate. |
required |
Returns:
| Type | Description |
|---|---|
float
|
The fitness of the individual. |
Equations
| Range | \(\mathbf{x} \in [-2, 8]^n\) |
| Function | \(f(\mathbf{x}) = \frac{10}{5 + \sum_{i=1}^n (x_i - 3)^2}\) |