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::DeterministicDispersalKernel< IntegerRaster > Class Template Reference

Dispersal kernel for deterministic spread to cell with highest probability of spread. More...

#include <deterministic_kernel.hpp>

Collaboration diagram for pops::DeterministicDispersalKernel< IntegerRaster >:
Collaboration graph
[legend]

Public Member Functions

 DeterministicDispersalKernel (DispersalKernelType dispersal_kernel, const IntegerRaster &dispersers, double dispersal_percentage, double ew_res, double ns_res, double distance_scale, double shape=1.0)
 DeterministicDispersalKernel constructor. More...
 
template<class 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

const IntegerRaster & dispersers_
 
int mid_row = 0
 
int mid_col = 0
 
int prev_row = -1
 
int prev_col = -1
 
int number_of_rows = 0
 
int number_of_columns = 0
 
double max_distance {0}
 
Raster< double > probability
 
Raster< double > probability_copy
 
CauchyKernel cauchy
 
ExponentialKernel exponential
 
WeibullKernel weibull
 
LogNormalKernel log_normal
 
NormalKernel normal
 
HyperbolicSecantKernel hyperbolic_secant
 
PowerLawKernel power_law
 
LogisticKernel logistic
 
GammaKernel gamma
 
ExponentialPowerKernel exponential_power
 
DispersalKernelType kernel_type_
 
double proportion_of_dispersers
 
double east_west_resolution
 
double north_south_resolution
 

Detailed Description

template<typename IntegerRaster>
class pops::DeterministicDispersalKernel< IntegerRaster >

Dispersal kernel for deterministic spread to cell with highest probability of spread.

Dispersal Kernel type determines use of Exponential or Cauchy distribution to find probability.

dispersal_percentage is the percent of all possible dispersal to be included in the moving window size (e.g for 99% input 0.99).

Useful for testing as it is deterministic and provides fully replicable results

Definition at line 59 of file deterministic_kernel.hpp.

Constructor & Destructor Documentation

◆ DeterministicDispersalKernel()

template<typename IntegerRaster >
pops::DeterministicDispersalKernel< IntegerRaster >::DeterministicDispersalKernel ( DispersalKernelType  dispersal_kernel,
const IntegerRaster &  dispersers,
double  dispersal_percentage,
double  ew_res,
double  ns_res,
double  distance_scale,
double  shape = 1.0 
)
inline

DeterministicDispersalKernel constructor.

When an unsupported (invalid) kernel type is passed as dispersal_kernel, std::invalid_argument is thrown when the function call operator is used, i.e., it is accepted by the constructor. This is to allow for constuction of invalid, but unused kernels which are created as a part of larger kernels.

The reference dispersers is later used to obtain the current counts of dispersers.

Parameters
dispersal_kernelType of kernel to be used
dispersersReference to a dispersers raster
dispersal_percentagePercentage used to compute the kernel size
ew_resEast-west resolution
ns_resNorth-south resolution
distance_scaleScale parameter for the kernels
shapeShape parameter for the kernels

Definition at line 114 of file deterministic_kernel.hpp.

Here is the call graph for this function:

Member Function Documentation

◆ operator()()

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

Generates a new position for the spread.

Creates a copy of the probability matrix to mark where dispersers are assigned. New window created any time a new cell is selected from simulation.disperse

Selects next row/col value based on the cell with the highest probability in the window.

Definition at line 237 of file deterministic_kernel.hpp.

◆ supports_kernel()

template<typename IntegerRaster >
static bool pops::DeterministicDispersalKernel< IntegerRaster >::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 295 of file deterministic_kernel.hpp.

Member Data Documentation

◆ cauchy

template<typename IntegerRaster >
CauchyKernel pops::DeterministicDispersalKernel< IntegerRaster >::cauchy
protected

Definition at line 76 of file deterministic_kernel.hpp.

◆ dispersers_

template<typename IntegerRaster >
const IntegerRaster& pops::DeterministicDispersalKernel< IntegerRaster >::dispersers_
protected

Definition at line 62 of file deterministic_kernel.hpp.

◆ east_west_resolution

template<typename IntegerRaster >
double pops::DeterministicDispersalKernel< IntegerRaster >::east_west_resolution
protected

Definition at line 90 of file deterministic_kernel.hpp.

◆ exponential

template<typename IntegerRaster >
ExponentialKernel pops::DeterministicDispersalKernel< IntegerRaster >::exponential
protected

Definition at line 77 of file deterministic_kernel.hpp.

◆ exponential_power

template<typename IntegerRaster >
ExponentialPowerKernel pops::DeterministicDispersalKernel< IntegerRaster >::exponential_power
protected

Definition at line 85 of file deterministic_kernel.hpp.

◆ gamma

template<typename IntegerRaster >
GammaKernel pops::DeterministicDispersalKernel< IntegerRaster >::gamma
protected

Definition at line 84 of file deterministic_kernel.hpp.

◆ hyperbolic_secant

template<typename IntegerRaster >
HyperbolicSecantKernel pops::DeterministicDispersalKernel< IntegerRaster >::hyperbolic_secant
protected

Definition at line 81 of file deterministic_kernel.hpp.

◆ kernel_type_

template<typename IntegerRaster >
DispersalKernelType pops::DeterministicDispersalKernel< IntegerRaster >::kernel_type_
protected

Definition at line 87 of file deterministic_kernel.hpp.

◆ log_normal

template<typename IntegerRaster >
LogNormalKernel pops::DeterministicDispersalKernel< IntegerRaster >::log_normal
protected

Definition at line 79 of file deterministic_kernel.hpp.

◆ logistic

template<typename IntegerRaster >
LogisticKernel pops::DeterministicDispersalKernel< IntegerRaster >::logistic
protected

Definition at line 83 of file deterministic_kernel.hpp.

◆ max_distance

template<typename IntegerRaster >
double pops::DeterministicDispersalKernel< IntegerRaster >::max_distance {0}
protected

Definition at line 73 of file deterministic_kernel.hpp.

◆ mid_col

template<typename IntegerRaster >
int pops::DeterministicDispersalKernel< IntegerRaster >::mid_col = 0
protected

Definition at line 65 of file deterministic_kernel.hpp.

◆ mid_row

template<typename IntegerRaster >
int pops::DeterministicDispersalKernel< IntegerRaster >::mid_row = 0
protected

Definition at line 64 of file deterministic_kernel.hpp.

◆ normal

template<typename IntegerRaster >
NormalKernel pops::DeterministicDispersalKernel< IntegerRaster >::normal
protected

Definition at line 80 of file deterministic_kernel.hpp.

◆ north_south_resolution

template<typename IntegerRaster >
double pops::DeterministicDispersalKernel< IntegerRaster >::north_south_resolution
protected

Definition at line 92 of file deterministic_kernel.hpp.

◆ number_of_columns

template<typename IntegerRaster >
int pops::DeterministicDispersalKernel< IntegerRaster >::number_of_columns = 0
protected

Definition at line 71 of file deterministic_kernel.hpp.

◆ number_of_rows

template<typename IntegerRaster >
int pops::DeterministicDispersalKernel< IntegerRaster >::number_of_rows = 0
protected

Definition at line 70 of file deterministic_kernel.hpp.

◆ power_law

template<typename IntegerRaster >
PowerLawKernel pops::DeterministicDispersalKernel< IntegerRaster >::power_law
protected

Definition at line 82 of file deterministic_kernel.hpp.

◆ prev_col

template<typename IntegerRaster >
int pops::DeterministicDispersalKernel< IntegerRaster >::prev_col = -1
protected

Definition at line 68 of file deterministic_kernel.hpp.

◆ prev_row

template<typename IntegerRaster >
int pops::DeterministicDispersalKernel< IntegerRaster >::prev_row = -1
protected

Definition at line 67 of file deterministic_kernel.hpp.

◆ probability

template<typename IntegerRaster >
Raster<double> pops::DeterministicDispersalKernel< IntegerRaster >::probability
protected

Definition at line 74 of file deterministic_kernel.hpp.

◆ probability_copy

template<typename IntegerRaster >
Raster<double> pops::DeterministicDispersalKernel< IntegerRaster >::probability_copy
protected

Definition at line 75 of file deterministic_kernel.hpp.

◆ proportion_of_dispersers

template<typename IntegerRaster >
double pops::DeterministicDispersalKernel< IntegerRaster >::proportion_of_dispersers
protected

Definition at line 88 of file deterministic_kernel.hpp.

◆ weibull

template<typename IntegerRaster >
WeibullKernel pops::DeterministicDispersalKernel< IntegerRaster >::weibull
protected

Definition at line 78 of file deterministic_kernel.hpp.


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