Quetzal-CoaTL
The Coalescence Template Library
Loading...
Searching...
No Matches
quetzal::demography::History< Space, DispersalPolicy, MemoryPolicy > Class Template Reference

#include <quetzal/demography/History.hpp>

Detailed Description

template<typename Space, typename DispersalPolicy, typename MemoryPolicy>
class quetzal::demography::History< Space, DispersalPolicy, MemoryPolicy >

Unspecialized class (CRTP design pattern)

Template Parameters
SpaceDemes identifiers.
demographic_policypolicy used for simulating populations dynamics

Public Types

using coord_type = Space
 
using time_type = unsigned int
 
using memory_policy = MemoryPolicy
 
using demographic_policy = DispersalPolicy
 
using value_type = typename demographic_policy::value_type
 
using flow_type = typename memory_policy::template flow_type< coord_type, time_type, value_type >
 
using pop_sizes_type = typename memory_policy::template pop_sizes_type< coord_type, time_type, value_type >
 
using discrete_distribution_type = quetzal::utils::random::DiscreteDistribution< coord_type >
 

Public Member Functions

auto distribution_area (time_type t) const
 Retrieve demes where N > 0 at time t.
 
auto & pop_size (coord_type const &x, time_type const &t)
 Population size at deme x at time t.
 
auto get_functor_N () const noexcept
 Read-only functor.
 
auto get_pop_size (coord_type const &x, time_type const &t)
 Read-only.
 
void set_pop_size (coord_type const &x, time_type const &t, value_type N)
 Used in derived class History to increment migrants.
 
unsigned int const & nb_generations () const
 Last time recorded in the foward-in-time database history.
 
coord_type backward_kernel (coord_type const &x, time_type t, Generator &gen) const
 Samples a coordinate from the backward-in-time transition matrix.
 

Protected Attributes

std::unique_ptr< flow_type > m_flows
 

Member Function Documentation

◆ backward_kernel()

coord_type quetzal::demography::HistoryBase< Space, DispersalPolicy , MemoryPolicy >::backward_kernel ( coord_type const &  x,
time_type  t,
Generator &  gen 
) const
inlineinherited

Samples a coordinate from the backward-in-time transition matrix.

The transition matrix is computed from the demographic flows database. The returned coordinate object will basically answer the question: when an individual is found in \(x\) at time \(t\), where could it have been at time \(t-1\) ?

◆ pop_size()

auto & quetzal::demography::HistoryBase< Space, DispersalPolicy , MemoryPolicy >::pop_size ( coord_type const &  x,
time_type const &  t 
)
inlineinherited

Population size at deme x at time t.

Returns
a reference to the value, initialized with value_type default constructor
Remarks
operator allows for more expressive mathematical style in client code

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