pops-core
0.9
PoPS (Pest or Pathogen Spread) Model Core C++ library
|
Go to the documentation of this file.
19 #ifndef POPS_RADIAL_KERNEL_HPP
20 #define POPS_RADIAL_KERNEL_HPP
53 std::map<std::string, Direction> mapping{
67 return mapping.at(text);
69 catch (
const std::out_of_range&) {
70 throw std::invalid_argument(
71 "direction_from_string: Invalid value '" + text +
"' provided");
93 template<
typename IntegerRaster>
119 double distance_scale,
121 double dispersal_direction_kappa = 0,
144 static_cast<int>(dispersal_direction) *
PI / 180,
145 dispersal_direction ==
Direction::
None ? 0 : dispersal_direction_kappa)
156 template<
typename Generator>
157 std::tuple<int, int>
operator()(Generator& generator,
int row,
int col)
196 throw std::invalid_argument(
197 "RadialDispersalKernel: Unsupported dispersal kernel type");
204 return std::make_tuple(row, col);
214 static const std::array<DispersalKernelType, 10> supports = {
225 auto it = std::find(supports.cbegin(), supports.cend(), type);
226 return it != supports.cend();
232 #endif // POPS_RADIAL_KERNEL_HPP
@ HyperbolicSecant
Hyperbolic secant dispersal kernel.
PowerLawKernel power_law_distribution
@ Gamma
Gamma dispersal kernel.
CauchyKernel cauchy_distribution
DispersalKernelType dispersal_kernel_type_
double random(Generator &generator)
Returns random value from cauchy distribution Used by RadialKernel to determine location of spread.
@ Logistic
Logistic dispersal kernel.
GammaKernel gamma_distribution
Dispersal kernel for weibull distribution class utilized by RadialKernel and DeterministicKernel.
double random(Generator &generator)
Returns random value from weibull distribution Used by RadialKernel to determine location of spread.
@ Exponential
Exponential dispersal kernel.
double north_south_resolution
static bool supports_kernel(const DispersalKernelType type)
Returns true if the kernel class support a given kernel type.
@ Weibull
Weibull dispersal kernel.
Dispersal kernel for exponential power distribution class utilized by RadialKernel and DeterministicK...
@ ExponentialPower
Exponential power dispersal kernel.
Dispersal kernel for cauchy distribution class utilized by RadialKernel and DeterministicKernel.
double east_west_resolution
double random(Generator &generator)
Returns random value from gamma distribution Used by RadialKernel to determine location of spread.
@ Normal
Normal dispersal kernel.
Von Mises Distribution (Circular data distribution)
double random(Generator &generator)
Returns random value from normal distribution Used by RadialKernel to determine location of spread.
ExponentialKernel exponential_distribution
DispersalKernelType
Type of dispersal kernel.
Dispersal kernel for logistic distribution class utilized by RadialKernel and DeterministicKernel.
@ Cauchy
Cauchy dispersal kernel.
@ PowerLaw
Power law dispersal kernel.
double random(Generator &generator)
Returns random value from hyperbolic secant distribution Used by RadialKernel to determine location o...
NormalKernel normal_distribution
double random(Generator &generator)
Returns random value from exponential distribution Used by RadialKernel to determine location of spre...
Dispersal kernel for power law distribution class utilized by RadialKernel and DeterministicKernel.
@ LogNormal
Log-normal dispersal kernel.
double random(Generator &generator)
Returns random value from exponential power distribution Used by RadialKernel to determine location o...
ExponentialPowerKernel exponential_power_distribution
HyperbolicSecantKernel hyperbolic_secant_distribution
double random(Generator &generator)
Returns random value from power law distribution Used by RadialKernel to determine location of spread...
Dispersal kernel for log normal distribution class utilized by RadialKernel and DeterministicKernel.
LogisticKernel logistic_distribution
@ None
No dispersal kernel (no spread)
Dispersal kernel for exponential distribution class utilized by RadialKernel and DeterministicKernel.
Dispersal kernel for normal distribution class utilized by RadialKernel and DeterministicKernel.
Dispersal kernel for hyperbolic secant class utilized by RadialKernel and DeterministicKernel.
Direction direction_from_string(const std::string &text)
Get a corresponding enum value for a string which direction.
double random(Generator &generator)
Returns random value from logistic distribution Used by RadialKernel to determine location of spread.
double random(Generator &generator)
Returns random value from log normal distribution Used by RadialKernel to determine location of sprea...
Dispersal kernel providing all the radial kernels.
Kernel types enum and helper functions.
RadialDispersalKernel(double ew_res, double ns_res, DispersalKernelType dispersal_kernel, double distance_scale, Direction dispersal_direction=Direction::None, double dispersal_direction_kappa=0, double shape=1)
@ None
No direction (non-directional)
VonMisesDistribution von_mises
LogNormalKernel lognormal_distribution
WeibullKernel weibull_distribution
std::tuple< int, int > operator()(Generator &generator, int row, int col)
Generates a new position for the spread.
Dispersal kernel for gamma distribution class utilized by RadialKernel and DeterministicKernel.
Direction
Spread direction.