pops-core
0.9
PoPS (Pest or Pathogen Spread) Model Core C++ library
|
Dispersal kernel for deterministic spread to a next cell. More...
#include <neighbor_kernel.hpp>
Public Member Functions | |
DeterministicNeighborDispersalKernel (Direction dispersal_direction) | |
Creates kernel based on the spread direction. More... | |
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 | |
Direction | direction_ |
Dispersal kernel for deterministic spread to a next cell.
This kernel spreads only in one direction specified by a parameter. It is useful for testing because the result is completely deterministic.
When a diagonal direction such as SE is used, disperser is moved one cell in each corresponding cardinal direction, i.e., 1 S and 1 E for SE.
Definition at line 35 of file neighbor_kernel.hpp.
|
inline |
Creates kernel based on the spread direction.
If the spread direction is None, i.e., Direction::None, the object is created, but it cannot be actually used as a kernel. If it is called, it throws std::invalid_argument. This allows creating "default" instance of this object which is never actually used in the simulation.
dispersal_direction | Direction of the spread |
Definition at line 52 of file neighbor_kernel.hpp.
|
inline |
Generates a new position for the spread.
Thehere is no randomness, so the generator is unused.
Definition at line 62 of file neighbor_kernel.hpp.
|
inlinestatic |
Returns true if the kernel class support a given kernel type.
Definition at line 103 of file neighbor_kernel.hpp.
|
protected |
Definition at line 38 of file neighbor_kernel.hpp.