pops-core  0.9
PoPS (Pest or Pathogen Spread) Model Core C++ library
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
pops::NaturalAnthropogenicDispersalKernel< NaturalKernelType, AnthropogenicKernelType > Class Template Reference

Dispersal kernel template for natural and anthropogenic distance dispersal. More...

#include <natural_anthropogenic_kernel.hpp>

Public Member Functions

 NaturalAnthropogenicDispersalKernel (const NaturalKernelType &natural_kernel, const AnthropogenicKernelType &anthropogenic_kernel, bool use_anthropogenic_kernel, double percent_natural_dispersal)
 
template<typename Generator >
std::tuple< int, int > operator() (Generator &generator, int row, int col)
 Generates a new position for the spread. More...
 

Static Public Member Functions

static bool supports_kernel (const DispersalKernelType type)
 Returns true if the kernel class support a given kernel type. More...
 

Protected Attributes

bool use_anthropogenic_kernel_
 
NaturalKernelType natural_kernel_
 
AnthropogenicKernelType anthropogenic_kernel_
 
std::bernoulli_distribution bernoulli_distribution
 

Detailed Description

template<typename NaturalKernelType, typename AnthropogenicKernelType>
class pops::NaturalAnthropogenicDispersalKernel< NaturalKernelType, AnthropogenicKernelType >

Dispersal kernel template for natural and anthropogenic distance dispersal.

This class template can be used for switching between two kernels specified as template parameters where one kernel is assumed to be used natural distance distance dispersal and the other for anthropogenic distance one. The two disperal kernels can be the same or different.

There are no assumptions for natural or anthropogenic kernels. We are using these names for clarity since this is how we expect the template to be used.

Bernoulli distribution is used to decide between the natural and anthropogenic distance kernel. The anthropogenic distance dispersal can be also competely disabled.

Definition at line 43 of file natural_anthropogenic_kernel.hpp.

Constructor & Destructor Documentation

◆ NaturalAnthropogenicDispersalKernel()

template<typename NaturalKernelType , typename AnthropogenicKernelType >
pops::NaturalAnthropogenicDispersalKernel< NaturalKernelType, AnthropogenicKernelType >::NaturalAnthropogenicDispersalKernel ( const NaturalKernelType &  natural_kernel,
const AnthropogenicKernelType &  anthropogenic_kernel,
bool  use_anthropogenic_kernel,
double  percent_natural_dispersal 
)
inline

Definition at line 52 of file natural_anthropogenic_kernel.hpp.

Member Function Documentation

◆ operator()()

template<typename NaturalKernelType , typename AnthropogenicKernelType >
template<typename Generator >
std::tuple<int, int> pops::NaturalAnthropogenicDispersalKernel< NaturalKernelType, AnthropogenicKernelType >::operator() ( Generator &  generator,
int  row,
int  col 
)
inline

Generates a new position for the spread.

The randomness is based on the generator. The result may depend on previous calls of this operator (see e.g. std::cauchy_distribution<RealType>::reset()). Parameters row and col are row and column position of the current disperser. The generated position will be relative to it.

Definition at line 69 of file natural_anthropogenic_kernel.hpp.

◆ supports_kernel()

template<typename NaturalKernelType , typename AnthropogenicKernelType >
static bool pops::NaturalAnthropogenicDispersalKernel< NaturalKernelType, AnthropogenicKernelType >::supports_kernel ( const DispersalKernelType  type)
inlinestatic

Returns true if the kernel class support a given kernel type.

Warning
This function is experimental and may be removed or changed at any time.

Returns true if at least one of the kernels (natural or anthropogenic) supports the given kernel type.

Note
Note that if natural and anthropogenic kernels are different, this is not generally usable because one kernel can support that and the other not. However, there is not much room for accidental misuse of this because this class does not use the type directly (it is handled by the underlying kernels).

Definition at line 91 of file natural_anthropogenic_kernel.hpp.

Member Data Documentation

◆ anthropogenic_kernel_

template<typename NaturalKernelType , typename AnthropogenicKernelType >
AnthropogenicKernelType pops::NaturalAnthropogenicDispersalKernel< NaturalKernelType, AnthropogenicKernelType >::anthropogenic_kernel_
protected

Definition at line 48 of file natural_anthropogenic_kernel.hpp.

◆ bernoulli_distribution

template<typename NaturalKernelType , typename AnthropogenicKernelType >
std::bernoulli_distribution pops::NaturalAnthropogenicDispersalKernel< NaturalKernelType, AnthropogenicKernelType >::bernoulli_distribution
protected

Definition at line 49 of file natural_anthropogenic_kernel.hpp.

◆ natural_kernel_

template<typename NaturalKernelType , typename AnthropogenicKernelType >
NaturalKernelType pops::NaturalAnthropogenicDispersalKernel< NaturalKernelType, AnthropogenicKernelType >::natural_kernel_
protected

Definition at line 47 of file natural_anthropogenic_kernel.hpp.

◆ use_anthropogenic_kernel_

template<typename NaturalKernelType , typename AnthropogenicKernelType >
bool pops::NaturalAnthropogenicDispersalKernel< NaturalKernelType, AnthropogenicKernelType >::use_anthropogenic_kernel_
protected

Definition at line 46 of file natural_anthropogenic_kernel.hpp.


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