Problems
Benchmark Test Problems for numerical optimization.
Metaheuristics.TestProblems.get_problem
— Functionget_problem(problem)
Returns a 3-tuple with the objective function, the bounds and 100 Pareto solutions for multi-objective optimization problems or the optimal solutions for (box)constrained optimization problems.
Here, problem
can be one of the following symbols:
Single-objective:
:sphere
:discus
:rastrigin
Multi-objective:
:ZDT1
:ZDT2
:ZDT3
:ZDT4
:ZDT6
Many-objective:
:DTLZ1
:DTLZ2
:DTLZ3
:DTLZ4
:DTLZ5
:DTLZ6
Example
julia> import Metaheuristics: TestProblems, optimize
julia> f, bounds, pareto_solutions = TestProblems.get_problem(:ZDT3);
julia> bounds
2×30 Array{Float64,2}:
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 … 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0
julia> pareto_solutions
F space
┌────────────────────────────────────────┐
1 │⢅⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│
│⠈⢢⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│
│⠀⠀⠙⠒⠀⠀⠀⠀⡆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│
│⠀⠀⠀⠀⠀⠀⠀⠀⠘⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│
│⠀⠀⠀⠀⠀⠀⠀⠀⠀⠸⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│
│⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠱⠄⠀⠀⠀⠀⠀⠀⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│
│⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢱⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│
f_2 │⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠬⡦⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤│
│⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⠂⠀⠀⠀⠀⠀⠀⢢⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│
│⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠸⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│
│⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢧⡀⠀⠀⠀⠀⠀⠀⢀⠀⠀⠀│
│⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⠀⠀⠀│
│⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⡆⠀⠀│
│⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⠀⠀│
-1 │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│
└────────────────────────────────────────┘
0 0.9
f_1
Box-constrained Optimization
Metaheuristics.TestProblems.sphere
— Functionsphere(D)
The well-known D-dimensional Sphere function.
Metaheuristics.TestProblems.discus
— Functiondiscus(D)
The well-known D-dimensional Discus function.
Metaheuristics.TestProblems.rastrigin
— Functionrastrigin(D)
The well-known D-dimensional Rastrigin function.
Constrained Optimization
Multi-objective Optimization
Metaheuristics.TestProblems.ZDT1
— FunctionZDT1(D, n_solutions)
ZDT1 returns (f::function, bounds::Matrix{Float64}, pareto_set::Array{xFgh_indiv})
where f
is the objective function and pareto_set
is an array with optimal Pareto solutions with n_solutions
.
Parameters
D
number of variables (dimension)n_solutions
number of pareto solutions.
Main properties:
- convex
Metaheuristics.TestProblems.ZDT2
— FunctionZDT2(D, n_solutions)
ZDT2 returns (f::function, bounds::Matrix{Float64}, pareto_set::Array{xFgh_indiv})
where f
is the objective function and pareto_set
is an array with optimal Pareto solutions with n_solutions
.
Parameters
D
number of variables (dimension)n_solutions
number of pareto solutions.
Main properties:
- nonconvex
Metaheuristics.TestProblems.ZDT3
— FunctionZDT3(D, n_solutions)
ZDT3 returns (f::function, bounds::Matrix{Float64}, pareto_set::Array{xFgh_indiv})
where f
is the objective function and pareto_set
is an array with optimal Pareto solutions with n_solutions
.
Parameters
D
number of variables (dimension)n_solutions
number of pareto solutions.
Main properties:
- convex disconected
Metaheuristics.TestProblems.ZDT4
— FunctionZDT4(D, n_solutions)
ZDT4 returns (f::function, bounds::Matrix{Float64}, pareto_set::Array{xFgh_indiv})
where f
is the objective function and pareto_set
is an array with optimal Pareto solutions with n_solutions
.
Parameters
D
number of variables (dimension)n_solutions
number of pareto solutions.
Main properties:
- nonconvex
Metaheuristics.TestProblems.ZDT6
— FunctionZDT6(D, n_solutions)
ZDT6 returns (f::function, bounds::Matrix{Float64}, pareto_set::Array{xFgh_indiv})
where f
is the objective function and pareto_set
is an array with optimal Pareto solutions with n_solutions
.
Parameters
D
number of variables (dimension)n_solutions
number of Pareto solutions.
Main properties:
- nonconvex
- non-uniformly spaced
Metaheuristics.TestProblems.DTLZ2
— FunctionDTLZ2(m = 3, ref_dirs = gen_ref_dirs(m, 12))
DTLZ2 returns (f::function, bounds::Matrix{Float64}, pareto_set::Array{xFgh_indiv})
where f
is the objective function and pareto_set
is an array with optimal Pareto solutions with n_solutions
.
Parameters
m
number of objective functionsref_dirs
number of Pareto solutions (default: Das and Dennis' method).
Main properties:
- nonconvex
- unifrontal