pops-core  0.9
PoPS (Pest or Pathogen Spread) Model Core C++ library
Namespaces | Typedefs
kernel.hpp File Reference

Main entry point to dispersal kernel functionality. More...

#include "switch_kernel.hpp"
#include "natural_anthropogenic_kernel.hpp"
Include dependency graph for kernel.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 pops
 

Typedefs

template<typename IntegerRaster , typename RasterIndex >
using pops::DispersalKernel = NaturalAnthropogenicDispersalKernel< SwitchDispersalKernel< IntegerRaster, RasterIndex >, SwitchDispersalKernel< IntegerRaster, RasterIndex > >
 Dispersal kernel supporting all available kernels for natural and anthropogenic distance spread. More...
 

Detailed Description

Main entry point to dispersal kernel functionality.

This file contains convenient definitions or wrappers to be used when using this library.

Adding a new kernel

To add new kernel, decide if it needs to be a separate class, or if it is just a parameterization of the existing kernel. Many kernels can be handled by the RadialDispersalKernel class.

Generally, such class needs to provide contructor taking all required parameters and a function call operator which takes a random number generator object and returns a pair of coordinates as row and column. The signature of the function template should be:

template<typename Generator>
std::tuple<int, int> operator() (Generator& generator)

Besides implementation in a class, enum for the different types of kernels needs to be extented as well as function which transforms strings into enum values, i.e., you need to add to the DispersalKernelType enum and extend the kernel_type_from_string() function in kernel_types.hpp.

Definition in file kernel.hpp.