Quetzal-CoaTL
The Coalescence Template Library
Loading...
Searching...
No Matches
quetzal::demography::demographic_policy::mass_based Class Reference

#include <quetzal/demography/demographic_policy.hpp>

Detailed Description

Policy class to specialize the quetzal::demography::History class for simulation of population with large density.

Simulate the demographic history by considering populations of individuals as divisible masses.

Classes

class  neighboring_migration
 Dispersal kernel compatible with the mass-based policy, but that restricts migration to the vecinity of each deme. More...
 

Public Types

using value_type = unsigned int
 

Static Public Member Functions

template<typename T , typename F >
static auto make_distance_based_dispersal (std::vector< T > const &coords, F f)
 Build a dispersal kernel usable with class History specialized for mass-based simulation policy.
 
template<typename T , typename F >
static auto make_sparse_distance_based_dispersal (std::vector< T > const &coords, F f)
 Contruct a dispersal kernel compatible with the mass-based policy.
 
template<typename T , typename U , typename V >
static neighboring_migration< T, U, V > make_neighboring_migration (T, double emigrant_rate, U friction, V get_neighbors)
 Helper function to create a dispersal kernel compatible with History specialized for the mass-based policy, but that restricts migration to the vecinity of each deme.
 

Member Function Documentation

◆ make_distance_based_dispersal()

template<typename T , typename F >
static auto quetzal::demography::demographic_policy::mass_based::make_distance_based_dispersal ( std::vector< T > const &  coords,
f 
)
inlinestatic

Build a dispersal kernel usable with class History specialized for mass-based simulation policy.

Parameters
coordsa vector of geographic points
fa functor giving the migration coefficient between two points The signature should be equivalent to double f(T const& x, T const& Y)
Returns
A dispersal kernel

◆ make_neighboring_migration()

template<typename T , typename U , typename V >
static neighboring_migration< T, U, V > quetzal::demography::demographic_policy::mass_based::make_neighboring_migration ( ,
double  emigrant_rate,
friction,
get_neighbors 
)
inlinestatic

Helper function to create a dispersal kernel compatible with History specialized for the mass-based policy, but that restricts migration to the vecinity of each deme.

For more flexibility, vecinity is defined by an external callable (does not have to be only the four nearest neighbours). This implementation should be chosen when the scale of the migration is much less than the scale of a deme.

Template Parameters
TCoordinates type
Ufunctor used to describe friction of a deme. Its signature should be equivalent to double f(T const& x)
Vfunctor giving the neighbours of a deme. Signature should be equivalent to std::vector<T> f(T const& x)

◆ make_sparse_distance_based_dispersal()

template<typename T , typename F >
static auto quetzal::demography::demographic_policy::mass_based::make_sparse_distance_based_dispersal ( std::vector< T > const &  coords,
f 
)
inlinestatic

Contruct a dispersal kernel compatible with the mass-based policy.

This implementation should be chosen when the migration coefficients are expected to be null over most of the landscape.

Parameters
coordsa container of geopgrahic points
fa functor giving the migration coefficient between two points The signature should be equivalent to double f(T const& x, T const& Y)
Returns
A dispersal kernel

The documentation for this class was generated from the following file: