Go to the source code of this file.
|
|
template<Fitness F> |
| constexpr F | lowest () noexcept |
|
template<std::integral F> |
| bool | isfinite (F) noexcept |
|
template<std::floating_point F> |
| bool | isfinite (F f) |
| template<MultiDimFitness F> |
| bool | isfinite (const F &f) |
template<Fitness F>
requires std::is_arithmetic_v<F> |
| bool | dominating (const F &lhs, const F &rhs) |
|
template<MultiDimFitness F> |
| bool | dominating (const F &lhs, const F &rhs) |
|
template<MultiDimFitness F> |
| bool | almost_equal (const F &lhs, const F &rhs) |
template<Fitness F>
requires std::is_arithmetic_v<F> |
| double | distance (F f1, F f2) |
|
template<MultiDimFitness F> |
| double | distance (const F &f1, const F &f2) |
template<Fitness F>
requires std::floating_point<F> |
| bool | save (std::ostream &out, F f) |
|
template<std::integral F> |
| bool | save (std::ostream &out, F f) |
template<MultiDimFitness F>
requires std::floating_point<std::ranges::range_value_t<F>> |
| bool | save (std::ostream &out, const F &f) |
| template<std::floating_point F> |
| bool | load (std::istream &in, F *f) |
|
template<std::integral F> |
| bool | load (std::istream &in, F *f) |
- Copyright
- Copyright (C) 2024 EOS di Manlio Morini.
- License
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/
◆ distance()
template<Fitness F>
requires std::is_arithmetic_v<F>
| double distance |
( |
F | f1, |
|
|
F | f2 ) |
|
nodiscard |
Taxicab distance between two vectors.
- Parameters
-
| [in] | f1 | first fitness value |
| [in] | f2 | second fitness value |
- Returns
- the distance between f1 and f2
The taxicab distance between two vectors in an n-dimensional real vector space with fixed Cartesian coordinate system, is the sum of the lengths of the projections of the line segment between the points onto the coordinate axes.
◆ dominating()
template<Fitness F>
requires std::is_arithmetic_v<F>
| bool dominating |
( |
const F & | lhs, |
|
|
const F & | rhs ) |
|
nodiscard |
Pareto dominance comparison.
- Parameters
-
| [in] | lhs | first term of comparison |
| [in] | rhs | second term of comparison |
- Returns
- true if lhs is a Pareto improvement of rhs
lhs dominates rhs (is a Pareto improvement) if:
- each component of lhs is not strictly worst (less) than the corresponding component of rhs;
- there is at least one component in which lhs is better than rhs.
- Note
- An interesting property is that if a vector x does not dominate a vector y, this does not imply that y dominates x (they can be both non-dominated).
◆ isfinite()
template<MultiDimFitness F>
| bool isfinite |
( |
const F & | f | ) |
|
|
nodiscard |
- Parameters
-
- Returns
- true if every component of the fitness is finite
◆ load()
template<std::floating_point F>
| bool load |
( |
std::istream & | in, |
|
|
F * | f ) |
- Parameters
-
| [in] | in | input stream |
| [out] | f | load the fitness here |
- Returns
- true if the object has been loaded correctly
- Note
- If the load operation isn't successful f isn't changed.
◆ save()
template<Fitness F>
requires std::floating_point<F>
| bool save |
( |
std::ostream & | out, |
|
|
F | f ) |
|
nodiscard |
- Parameters
-
| [out] | out | output stream |
| [in] | f | fitness to be saved |
- Returns
- true if object has been saved correctly