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::NetworkDispersalKernel< RasterIndex > Class Template Reference

Dispersal kernel for dispersal over a network. More...

#include <network_kernel.hpp>

Public Member Functions

 NetworkDispersalKernel (const Network< RasterIndex > &network, double min_time, double max_time)
 Create kernel. More...
 
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)
 Test if cell is eligible to be used with the kernel. 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 Network< RasterIndex > & network_
 Reference to the network. More...
 
std::uniform_real_distribution< double > time_distribution_
 Travel Time distribnution. More...
 

Detailed Description

template<typename RasterIndex>
class pops::NetworkDispersalKernel< RasterIndex >

Dispersal kernel for dispersal over a network.

Network node must be present in the cell to start traveling, so is_cell_eligible() needs to be called first to see if the kernel can be used with the given row and column.

Definition at line 725 of file network_kernel.hpp.

Constructor & Destructor Documentation

◆ NetworkDispersalKernel()

template<typename RasterIndex >
pops::NetworkDispersalKernel< RasterIndex >::NetworkDispersalKernel ( const Network< RasterIndex > &  network,
double  min_time,
double  max_time 
)
inline

Create kernel.

The kernel assumes that the network is already initialized. It does not modify the network.

The min_time and max_time parameters are used as a range for uniform real distribution which determines the travel time through the network for one trip.

Parameters
networkExisting network
min_timeMinimum travel time
max_timeMaximum travel time

Definition at line 742 of file network_kernel.hpp.

Member Function Documentation

◆ is_cell_eligible()

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

Test if cell is eligible to be used with the kernel.

Parameters
rowRow to be used with the kernel
colColumn to be used with the kernel
Returns
true if cell can be used, false otherwise

Definition at line 768 of file network_kernel.hpp.

◆ operator()()

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

Generates a new position for the spread.

Exceptions
std::invalid_argumentif there is no network node at a given row and col (can be checked with is_cell_eligible() beforehand)

Definition at line 753 of file network_kernel.hpp.

◆ supports_kernel()

template<typename RasterIndex >
static bool pops::NetworkDispersalKernel< 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 775 of file network_kernel.hpp.

Member Data Documentation

◆ network_

template<typename RasterIndex >
const Network<RasterIndex>& pops::NetworkDispersalKernel< RasterIndex >::network_
protected

Reference to the network.

Definition at line 782 of file network_kernel.hpp.

◆ time_distribution_

template<typename RasterIndex >
std::uniform_real_distribution<double> pops::NetworkDispersalKernel< RasterIndex >::time_distribution_
protected

Travel Time distribnution.

Definition at line 784 of file network_kernel.hpp.


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