I ran into this really weird problem that nothing spreads and it is related to the size (or rather aspect ratio) of the region. The spores seems to be generated in function generate but then in variable dispersers there are only zeros. In test_simulation.cpp you can use these lines
Raster<int> infected = {{0, 0, 0, 5, 5}, {0, 0, 0, 5, 5}, {0, 0, 0, 0, 0}};
Raster<int> mortality_tracker = {{0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}};
Raster<int> susceptible = {{10, 6, 8, 8, 8}, {14, 15, 12, 12, 12}, {14, 15, 12, 12, 12}};
Raster<int> total_plants = {{15, 6, 10, 10, 10}, {14, 15, 14, 14, 10}, {14, 15, 14, 14, 10}};
Raster<double> temperature = {{5, 0, 5, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}};
Raster<double> weather_coefficient = {{0.6, 0.8, 0.7, 0.7, 0.7}, {0.2, 0.8, 0.8, 0.8, 0.8},{0.6, 0.8, 0.7, 0.7, 0.7}};
and basically when infection is X below, it doesn't run.
void generate(const IntegerRaster& infected,
bool weather, const FloatRaster& weather_coefficient,
double reproductive_rate)
{
std::cout << "generate" << std::endl;
double lambda = reproductive_rate;
for (unsigned i = 0; i < height; i++) {
for (unsigned j = 0; j < width; j++) {
if (infected(i, j) > 0) {
if (weather)
lambda = reproductive_rate * weather_coefficient(i, j); // calculate
int dispersers_from_cell = 0;
std::poisson_distribution<int> distribution(lambda);
for (int k = 0; k < infected(i, j); k++) {
dispersers_from_cell += distribution(generator);
}
dispersers(i, j) = dispersers_from_cell;
std::cout << "save " << dispersers(i, j) << " " << i << " " << j << std::endl;
}
else {
dispersers(i, j) = 0;
}
}
}
for (unsigned i = 0; i < height; i++) {
for (unsigned j = 0; j < width; j++) {
if (dispersers(i, j) > 0) {std::cout << "read "<< i << " " << j << std::endl;}
}
}
std::cout << "generate end" << std::endl;
}