Class Dispersal#
Defined in File Dispersal.h
Inheritance Relationships#
Derived Types#
public DistanceKernelDispersal
(Class DistanceKernelDispersal)public RadialDispersal
(Class RadialDispersal)
Class Documentation#
-
class Dispersal
Dispersal base class.
Defines the interface for dispersal classes.
The Dispersal classes compute the connections between Patch objects with their respective connection weights, dependent on the maximum dispersal distance
max_disp
, and carry out dispersal in and out of the patches, dependent on the dispersal ratedisp_rate
.See also
Subclassed by DistanceKernelDispersal, RadialDispersal
Public Functions
-
Dispersal(DispersalParams *params, BoundaryType boundary, double side_x, double side_y)
Dispersal constructor.
Constructs the BoundaryStrategy object from the boundary type passed.
- Parameters:
params – [in] dispersal parameters
boundary – [in] boundary type to use for calculating dispersal distances
side_x – [in] size of one side of the simulation area (x-axis)
side_y – [in] size of one side of the simulation area (y-axis)
-
inline virtual ~Dispersal()
-
virtual void set_connecs(std::vector<Patch*> &sites) = 0
-
virtual void adults_disperse(std::vector<Patch*> &sites) = 0
Protected Functions
-
std::vector<std::array<long long int, constants::num_gen>> M_dispersing_out(const std::vector<Patch*> &sites)
Determines the number of adult males (of each genotype) dispersing out from each patch.
The number of adult males of a given genotype dispersing from a given patch is determined by a random draw from a binomial distribution with probability of adult dispersal rate.
- Parameters:
sites – [in] vector of all Patch objects
- Returns:
The number of adult males dispersing out, divided by genotype and outgoing patch.
-
std::vector<std::array<std::array<long long int, constants::num_gen>, constants::num_gen>> F_dispersing_out(const std::vector<Patch*> &sites)
Determines the number of adult mated females (of each genotype combination) dispersing out from each patch.
The number of adult females of a given genotype combination dispersing from a given patch is determined by a random draw from a binomial distribution with probability of adult dispersal rate.
- Parameters:
sites – [in] vector of all Patch objects
- Returns:
The number of adult mated females dispersing out, divided by female genotype, male sperm genotype and outgoing patch.
Protected Attributes
-
double disp_rate
Adult dispersal rate.
-
double max_disp
Maximum distance at which two sites are connected.
-
std::vector<std::vector<int>> connec_indices
Connected patch indices ordered by each patch in Model::sites, such that the first element contains the indices of all the patches connected to the first sites patch, etc.
-
std::vector<std::vector<double>> connec_weights
Connection weights of the connected patches ordered by each patch in Model::sites, such that the first element contains the connection weights between the first patch in sites and all the patches connected to it, etc.
-
BoundaryStrategy *boundary_strategy
-
Dispersal(DispersalParams *params, BoundaryType boundary, double side_x, double side_y)