pops-core
0.9
PoPS (Pest or Pathogen Spread) Model Core C++ library
|
Dispersal kernel for deterministic spread to cell with highest probability of spread. More...
#include <deterministic_kernel.hpp>
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 |
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.
|
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.
dispersal_kernel | Type of kernel to be used |
dispersers | Reference to a dispersers raster |
dispersal_percentage | Percentage used to compute the kernel size |
ew_res | East-west resolution |
ns_res | North-south resolution |
distance_scale | Scale parameter for the kernels |
shape | Shape parameter for the kernels |
Definition at line 114 of file deterministic_kernel.hpp.
|
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.
|
inlinestatic |
Returns true if the kernel class support a given kernel type.
Definition at line 295 of file deterministic_kernel.hpp.
|
protected |
Definition at line 76 of file deterministic_kernel.hpp.
|
protected |
Definition at line 62 of file deterministic_kernel.hpp.
|
protected |
Definition at line 90 of file deterministic_kernel.hpp.
|
protected |
Definition at line 77 of file deterministic_kernel.hpp.
|
protected |
Definition at line 85 of file deterministic_kernel.hpp.
|
protected |
Definition at line 84 of file deterministic_kernel.hpp.
|
protected |
Definition at line 81 of file deterministic_kernel.hpp.
|
protected |
Definition at line 87 of file deterministic_kernel.hpp.
|
protected |
Definition at line 79 of file deterministic_kernel.hpp.
|
protected |
Definition at line 83 of file deterministic_kernel.hpp.
|
protected |
Definition at line 73 of file deterministic_kernel.hpp.
|
protected |
Definition at line 65 of file deterministic_kernel.hpp.
|
protected |
Definition at line 64 of file deterministic_kernel.hpp.
|
protected |
Definition at line 80 of file deterministic_kernel.hpp.
|
protected |
Definition at line 92 of file deterministic_kernel.hpp.
|
protected |
Definition at line 71 of file deterministic_kernel.hpp.
|
protected |
Definition at line 70 of file deterministic_kernel.hpp.
|
protected |
Definition at line 82 of file deterministic_kernel.hpp.
|
protected |
Definition at line 68 of file deterministic_kernel.hpp.
|
protected |
Definition at line 67 of file deterministic_kernel.hpp.
|
protected |
Definition at line 74 of file deterministic_kernel.hpp.
|
protected |
Definition at line 75 of file deterministic_kernel.hpp.
|
protected |
Definition at line 88 of file deterministic_kernel.hpp.
|
protected |
Definition at line 78 of file deterministic_kernel.hpp.