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

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_
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ DeterministicNeighborDispersalKernel()

pops::DeterministicNeighborDispersalKernel::DeterministicNeighborDispersalKernel ( Direction  dispersal_direction)
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.

Parameters
dispersal_directionDirection of the spread

Definition at line 52 of file neighbor_kernel.hpp.

Member Function Documentation

◆ operator()()

template<typename Generator >
std::tuple<int, int> pops::DeterministicNeighborDispersalKernel::operator() ( Generator &  generator,
int  row,
int  col 
)
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.

◆ supports_kernel()

static bool pops::DeterministicNeighborDispersalKernel::supports_kernel ( const DispersalKernelType  type)
inlinestatic

Returns true if the kernel class support a given kernel type.

Definition at line 103 of file neighbor_kernel.hpp.

Member Data Documentation

◆ direction_

Direction pops::DeterministicNeighborDispersalKernel::direction_
protected

Definition at line 38 of file neighbor_kernel.hpp.


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