![]() |
Ultra 0.9.4
|
#include "kernel/individual.h"#include "kernel/random.h"#include <concepts>#include <ranges>#include <shared_mutex>Go to the source code of this file.
Namespaces | |
| namespace | ultra |
Concepts | |
| concept | ultra::RandomAccessIndividuals |
| concept | ultra::Population |
| concept | ultra::LayeredPopulation |
| concept | ultra::SizedRandomAccessPopulation |
| concept | ultra::PopulationWithMutex |
Typedefs | |
| using | ultra::population_uid = unsigned |
Functions | |
| template<SizedRandomAccessPopulation P> | |
| P::coord | ultra::random::coord (const P &p) |
| template<SizedRandomAccessPopulation P> | |
| P::coord | ultra::random::coord (const P &p, std::size_t i, std::size_t mate_zone) |
| template<PopulationWithMutex P> | |
| std::ranges::range_value_t< P > | ultra::random::individual (const P &p) |
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/
|
nodiscard |
Returns a coordinate sampled from a position's neighbourhood.
| [in] | p | a population |
| [in] | i | base coordinate |
| [in] | mate_zone | neighbourhood radius (must be non-zero) |
The neighbourhood is interpreted on a circular (ring) topology. For large neighbourhoods (mate_zone >= p.size() / 2) the sampling degenerates to a uniform choice over the whole population.
|
nodiscard |
| [in] | p | a population |