pops-core
0.9
PoPS (Pest or Pathogen Spread) Model Core C++ library
|
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 |
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.
|
inline |
Definition at line 52 of file natural_anthropogenic_kernel.hpp.
|
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.
|
inlinestatic |
Returns true if the kernel class support a given kernel type.
Returns true if at least one of the kernels (natural or anthropogenic) supports the given kernel type.
Definition at line 91 of file natural_anthropogenic_kernel.hpp.
|
protected |
Definition at line 48 of file natural_anthropogenic_kernel.hpp.
|
protected |
Definition at line 49 of file natural_anthropogenic_kernel.hpp.
|
protected |
Definition at line 47 of file natural_anthropogenic_kernel.hpp.
|
protected |
Definition at line 46 of file natural_anthropogenic_kernel.hpp.