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::UniformDispersalKernel Class Reference

Dispersal kernel for random uniform dispersal over the whole landscape. More...

#include <uniform_kernel.hpp>

Public Member Functions

 UniformDispersalKernel (int row_max, int col_max)
 
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

int row_max_
 
int col_max_
 
std::uniform_int_distribution row_distribution
 
std::uniform_int_distribution col_distribution
 

Detailed Description

Dispersal kernel for random uniform dispersal over the whole landscape.

This class is a good example of how to write a kernel and it is useful for testing due to its simplicity. It tends to generate a lot of spread because it quickly spreads over the landscape. However, it may work as a good starting point for cases where no theory about the spread is available.

Definition at line 34 of file uniform_kernel.hpp.

Constructor & Destructor Documentation

◆ UniformDispersalKernel()

pops::UniformDispersalKernel::UniformDispersalKernel ( int  row_max,
int  col_max 
)
inline

Definition at line 43 of file uniform_kernel.hpp.

Member Function Documentation

◆ operator()()

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

Generates a new position for the spread.

The randomness is based on the generator. The new position does not depend on the position of the current disperser thus row and col are unused.

Definition at line 57 of file uniform_kernel.hpp.

◆ supports_kernel()

static bool pops::UniformDispersalKernel::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.

Definition at line 67 of file uniform_kernel.hpp.

Member Data Documentation

◆ col_distribution

std::uniform_int_distribution pops::UniformDispersalKernel::col_distribution
protected

Definition at line 40 of file uniform_kernel.hpp.

◆ col_max_

int pops::UniformDispersalKernel::col_max_
protected

Definition at line 38 of file uniform_kernel.hpp.

◆ row_distribution

std::uniform_int_distribution pops::UniformDispersalKernel::row_distribution
protected

Definition at line 39 of file uniform_kernel.hpp.

◆ row_max_

int pops::UniformDispersalKernel::row_max_
protected

Definition at line 37 of file uniform_kernel.hpp.


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