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::SwitchDispersalKernel< IntegerRaster, RasterIndex > Class Template Reference

Dispersal kernel providing all the radial kernels. More...

#include <switch_kernel.hpp>

Collaboration diagram for pops::SwitchDispersalKernel< IntegerRaster, RasterIndex >:
Collaboration graph
[legend]

Public Member Functions

 SwitchDispersalKernel (const DispersalKernelType &dispersal_kernel_type, const RadialDispersalKernel< IntegerRaster > &radial_kernel, const DeterministicDispersalKernel< IntegerRaster > &deterministic_kernel, const UniformDispersalKernel &uniform_kernel, const NetworkDispersalKernel< RasterIndex > &network_kernel, const DeterministicNeighborDispersalKernel &deterministic_neighbor_kernel=DeterministicNeighborDispersalKernel(Direction::None), const bool deterministic=false)
 
template<typename Generator >
std::tuple< int, int > operator() (Generator &generator, int row, int col)
 Generates a new position for the spread. More...
 
bool is_cell_eligible (int row, int col)
 

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

DispersalKernelType dispersal_kernel_type_
 
RadialDispersalKernel< IntegerRaster > radial_kernel_
 
DeterministicDispersalKernel< IntegerRaster > deterministic_kernel_
 
UniformDispersalKernel uniform_kernel_
 
DeterministicNeighborDispersalKernel deterministic_neighbor_kernel_
 
NetworkDispersalKernel< RasterIndex > network_kernel_
 
bool deterministic_
 

Detailed Description

template<typename IntegerRaster, typename RasterIndex>
class pops::SwitchDispersalKernel< IntegerRaster, RasterIndex >

Dispersal kernel providing all the radial kernels.

We understand a radial kernel to be a kernel which has parameters which translate into a distance and direction.

To add new kernel, add new member, constructor parameter, its call in the function call operator, and extend the supports_kernel() function.

Definition at line 39 of file switch_kernel.hpp.

Constructor & Destructor Documentation

◆ SwitchDispersalKernel()

template<typename IntegerRaster , typename RasterIndex >
pops::SwitchDispersalKernel< IntegerRaster, RasterIndex >::SwitchDispersalKernel ( const DispersalKernelType dispersal_kernel_type,
const RadialDispersalKernel< IntegerRaster > &  radial_kernel,
const DeterministicDispersalKernel< IntegerRaster > &  deterministic_kernel,
const UniformDispersalKernel uniform_kernel,
const NetworkDispersalKernel< RasterIndex > &  network_kernel,
const DeterministicNeighborDispersalKernel deterministic_neighbor_kernel = DeterministicNeighborDispersalKernel(Direction::None),
const bool  deterministic = false 
)
inline

Definition at line 51 of file switch_kernel.hpp.

Member Function Documentation

◆ is_cell_eligible()

template<typename IntegerRaster , typename RasterIndex >
bool pops::SwitchDispersalKernel< IntegerRaster, RasterIndex >::is_cell_eligible ( int  row,
int  col 
)
inline

Definition at line 94 of file switch_kernel.hpp.

◆ operator()()

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

Generates a new position for the spread.

The randomness is based on the generator. The result may depend on previous calls of this operator (see e.g. std::cauchy_distribution<RealType>::reset()). Parameters row and col are row and column position of the current disperser. The generated position will be relative to it.

Definition at line 74 of file switch_kernel.hpp.

◆ supports_kernel()

template<typename IntegerRaster , typename RasterIndex >
static bool pops::SwitchDispersalKernel< IntegerRaster, RasterIndex >::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 117 of file switch_kernel.hpp.

Here is the call graph for this function:

Member Data Documentation

◆ deterministic_

template<typename IntegerRaster , typename RasterIndex >
bool pops::SwitchDispersalKernel< IntegerRaster, RasterIndex >::deterministic_
protected

Definition at line 48 of file switch_kernel.hpp.

◆ deterministic_kernel_

template<typename IntegerRaster , typename RasterIndex >
DeterministicDispersalKernel<IntegerRaster> pops::SwitchDispersalKernel< IntegerRaster, RasterIndex >::deterministic_kernel_
protected

Definition at line 44 of file switch_kernel.hpp.

◆ deterministic_neighbor_kernel_

template<typename IntegerRaster , typename RasterIndex >
DeterministicNeighborDispersalKernel pops::SwitchDispersalKernel< IntegerRaster, RasterIndex >::deterministic_neighbor_kernel_
protected

Definition at line 46 of file switch_kernel.hpp.

◆ dispersal_kernel_type_

template<typename IntegerRaster , typename RasterIndex >
DispersalKernelType pops::SwitchDispersalKernel< IntegerRaster, RasterIndex >::dispersal_kernel_type_
protected

Definition at line 42 of file switch_kernel.hpp.

◆ network_kernel_

template<typename IntegerRaster , typename RasterIndex >
NetworkDispersalKernel<RasterIndex> pops::SwitchDispersalKernel< IntegerRaster, RasterIndex >::network_kernel_
protected

Definition at line 47 of file switch_kernel.hpp.

◆ radial_kernel_

template<typename IntegerRaster , typename RasterIndex >
RadialDispersalKernel<IntegerRaster> pops::SwitchDispersalKernel< IntegerRaster, RasterIndex >::radial_kernel_
protected

Definition at line 43 of file switch_kernel.hpp.

◆ uniform_kernel_

template<typename IntegerRaster , typename RasterIndex >
UniformDispersalKernel pops::SwitchDispersalKernel< IntegerRaster, RasterIndex >::uniform_kernel_
protected

Definition at line 45 of file switch_kernel.hpp.


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