pops-core  0.9
PoPS (Pest or Pathogen Spread) Model Core C++ library
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
pops::Model< IntegerRaster, FloatRaster, RasterIndex > Class Template Reference

#include <model.hpp>

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

Public Member Functions

 Model (const Config &config)
 
void run_step (int step, IntegerRaster &infected, IntegerRaster &susceptible, IntegerRaster &total_populations, IntegerRaster &total_hosts, IntegerRaster &dispersers, IntegerRaster &total_exposed, std::vector< IntegerRaster > &exposed, std::vector< IntegerRaster > &mortality_tracker, IntegerRaster &died, const std::vector< FloatRaster > &temperatures, const FloatRaster &weather_coefficient, Treatments< IntegerRaster, FloatRaster > &treatments, IntegerRaster &resistant, std::vector< std::tuple< int, int >> &outside_dispersers, SpreadRate< IntegerRaster > &spread_rate, QuarantineEscape< IntegerRaster > &quarantine, const IntegerRaster &quarantine_areas, const std::vector< std::vector< int >> movements, const Network< RasterIndex > &network, std::vector< std::vector< int >> &suitable_cells)
 Run one step of the simulation. More...
 

Protected Member Functions

SwitchDispersalKernel< IntegerRaster, RasterIndex > create_natural_kernel (const IntegerRaster &dispersers, const Network< RasterIndex > &network)
 Create natural kernel. More...
 
SwitchDispersalKernel< IntegerRaster, RasterIndex > create_overpopulation_movement_kernel (const IntegerRaster &dispersers, const Network< RasterIndex > &network)
 Create overpopulation movement kernel. More...
 
SwitchDispersalKernel< IntegerRaster, RasterIndex > create_anthro_kernel (const IntegerRaster &dispersers, const Network< RasterIndex > &network)
 Create anthropogenic kernel. More...
 

Protected Attributes

Config config_
 
DispersalKernelType natural_kernel
 
DispersalKernelType anthro_kernel
 
UniformDispersalKernel uniform_kernel
 
DeterministicNeighborDispersalKernel natural_neighbor_kernel
 
DeterministicNeighborDispersalKernel anthro_neighbor_kernel
 
Simulation< IntegerRaster, FloatRaster, RasterIndex > simulation_
 
unsigned last_index {0}
 

Detailed Description

template<typename IntegerRaster, typename FloatRaster, typename RasterIndex>
class pops::Model< IntegerRaster, FloatRaster, RasterIndex >

Definition at line 40 of file model.hpp.

Constructor & Destructor Documentation

◆ Model()

template<typename IntegerRaster , typename FloatRaster , typename RasterIndex >
pops::Model< IntegerRaster, FloatRaster, RasterIndex >::Model ( const Config config)
inline

Definition at line 180 of file model.hpp.

Member Function Documentation

◆ create_anthro_kernel()

template<typename IntegerRaster , typename FloatRaster , typename RasterIndex >
SwitchDispersalKernel<IntegerRaster, RasterIndex> pops::Model< IntegerRaster, FloatRaster, RasterIndex >::create_anthro_kernel ( const IntegerRaster &  dispersers,
const Network< RasterIndex > &  network 
)
inlineprotected

Create anthropogenic kernel.

Same structure as the natural kernel, but the parameters are for anthropogenic kernel when available.

Parameters
dispersersThe disperser raster (reference, for deterministic kernel)
networkNetwork (initialized or not)
Returns
Created kernel

Definition at line 147 of file model.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ create_natural_kernel()

template<typename IntegerRaster , typename FloatRaster , typename RasterIndex >
SwitchDispersalKernel<IntegerRaster, RasterIndex> pops::Model< IntegerRaster, FloatRaster, RasterIndex >::create_natural_kernel ( const IntegerRaster &  dispersers,
const Network< RasterIndex > &  network 
)
inlineprotected

Create natural kernel.

Kernel parameters are taken from the configuration.

Parameters
dispersersThe disperser raster (reference, for deterministic kernel)
networkNetwork (initialized or not)
Returns
Created kernel

Definition at line 61 of file model.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ create_overpopulation_movement_kernel()

template<typename IntegerRaster , typename FloatRaster , typename RasterIndex >
SwitchDispersalKernel<IntegerRaster, RasterIndex> pops::Model< IntegerRaster, FloatRaster, RasterIndex >::create_overpopulation_movement_kernel ( const IntegerRaster &  dispersers,
const Network< RasterIndex > &  network 
)
inlineprotected

Create overpopulation movement kernel.

Same as the natural kernel. The natural kernel parameters are used, but the scale for radial and deterministic kernel is multiplied by the leaving scale coefficient.

Parameters
dispersersThe disperser raster (reference, for deterministic kernel)
networkNetwork (initialized or not)
Returns
Created kernel

Definition at line 105 of file model.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ run_step()

template<typename IntegerRaster , typename FloatRaster , typename RasterIndex >
void pops::Model< IntegerRaster, FloatRaster, RasterIndex >::run_step ( int  step,
IntegerRaster &  infected,
IntegerRaster &  susceptible,
IntegerRaster &  total_populations,
IntegerRaster &  total_hosts,
IntegerRaster &  dispersers,
IntegerRaster &  total_exposed,
std::vector< IntegerRaster > &  exposed,
std::vector< IntegerRaster > &  mortality_tracker,
IntegerRaster &  died,
const std::vector< FloatRaster > &  temperatures,
const FloatRaster &  weather_coefficient,
Treatments< IntegerRaster, FloatRaster > &  treatments,
IntegerRaster &  resistant,
std::vector< std::tuple< int, int >> &  outside_dispersers,
SpreadRate< IntegerRaster > &  spread_rate,
QuarantineEscape< IntegerRaster > &  quarantine,
const IntegerRaster &  quarantine_areas,
const std::vector< std::vector< int >>  movements,
const Network< RasterIndex > &  network,
std::vector< std::vector< int >> &  suitable_cells 
)
inline

Run one step of the simulation.

The total_populations can be total number of hosts in the basic case or it can be the total size of population of all relevant species both host and non-host if dilution effect should be applied. When movement is applied, total_populations needs to be only the total number of hosts because movement does not support non-host individuals.

No treatment can be applied when movement is active because host movement does not support resistant hosts.

dispersers is for internal use and for tracking dispersers creation. The input values are ignored and the output is not the current existing dispersers, but only the number of dispersers generated (and subsequently used) in this step. There are no dispersers in between simulation steps.

Parameters
stepStep number in the simulation.
[in,out]infectedInfected hosts
[in,out]susceptibleSusceptible hosts
[in,out]total_hostsAll host individuals in the area. Is equal to infected + exposed + susceptible in the cell.
[in,out]total_populationsAll host and non-host individuals in the area
[out]dispersersDispersing individuals (used internally)
exposed[in,out]Exposed hosts (if SEI model is active)
mortality_tracker[in,out]Mortality tracker used to generate died. Expectation is that mortality tracker is of length (1/mortality_rate + mortality_time_lag)
died[out]Infected hosts which died this step based on the mortality schedule
temperatures[in]Vector of temperatures used to evaluate lethal temperature
weather_coefficient[in]Weather coefficient (for the current step)
treatments[in,out]Treatments to be applied (also tracks use of treatments)
resistant[in,out]Resistant hosts (host temporarily removed from susceptible hosts)
outside_dispersers[in,out]Dispersers escaping the rasters (adds to the vector)
spread_rate[in,out]Spread rate tracker
quarantine[in,out]Quarantine escape tracker
quarantine_areas[in]Quarantine areas
movements[in]Table of host movements
networkNetwork (initialized or Network::null_network() if unused)
Note
The parameters roughly correspond to Simulation::disperse() and Simulation::disperse_and_infect() functions, so these can be used for further reference.

Definition at line 248 of file model.hpp.

Here is the call graph for this function:

Member Data Documentation

◆ anthro_kernel

template<typename IntegerRaster , typename FloatRaster , typename RasterIndex >
DispersalKernelType pops::Model< IntegerRaster, FloatRaster, RasterIndex >::anthro_kernel
protected

Definition at line 45 of file model.hpp.

◆ anthro_neighbor_kernel

template<typename IntegerRaster , typename FloatRaster , typename RasterIndex >
DeterministicNeighborDispersalKernel pops::Model< IntegerRaster, FloatRaster, RasterIndex >::anthro_neighbor_kernel
protected

Definition at line 48 of file model.hpp.

◆ config_

template<typename IntegerRaster , typename FloatRaster , typename RasterIndex >
Config pops::Model< IntegerRaster, FloatRaster, RasterIndex >::config_
protected

Definition at line 43 of file model.hpp.

◆ last_index

template<typename IntegerRaster , typename FloatRaster , typename RasterIndex >
unsigned pops::Model< IntegerRaster, FloatRaster, RasterIndex >::last_index {0}
protected

Definition at line 50 of file model.hpp.

◆ natural_kernel

template<typename IntegerRaster , typename FloatRaster , typename RasterIndex >
DispersalKernelType pops::Model< IntegerRaster, FloatRaster, RasterIndex >::natural_kernel
protected

Definition at line 44 of file model.hpp.

◆ natural_neighbor_kernel

template<typename IntegerRaster , typename FloatRaster , typename RasterIndex >
DeterministicNeighborDispersalKernel pops::Model< IntegerRaster, FloatRaster, RasterIndex >::natural_neighbor_kernel
protected

Definition at line 47 of file model.hpp.

◆ simulation_

template<typename IntegerRaster , typename FloatRaster , typename RasterIndex >
Simulation<IntegerRaster, FloatRaster, RasterIndex> pops::Model< IntegerRaster, FloatRaster, RasterIndex >::simulation_
protected

Definition at line 49 of file model.hpp.

◆ uniform_kernel

template<typename IntegerRaster , typename FloatRaster , typename RasterIndex >
UniformDispersalKernel pops::Model< IntegerRaster, FloatRaster, RasterIndex >::uniform_kernel
protected

Definition at line 46 of file model.hpp.


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