diff --git a/src/modules/butterflies/butterflies_populations.c b/src/modules/butterflies/butterflies_populations.c index 8357aadd3827f8a0d7eb0e863d134599c810a9e0..a5e9755ab68bc5e3c7118bc115dfebabdea9e049 100644 --- a/src/modules/butterflies/butterflies_populations.c +++ b/src/modules/butterflies/butterflies_populations.c @@ -14,6 +14,7 @@ #include "butterflies_inline.h" #include "inline_population.h" #include "inline.h" +#include "populations/population.h" cats_dt_rates bf_egg_to_adult_survival_rate(cats_dt_rates adults_per_female, cats_dt_rates max_eggs) @@ -47,7 +48,7 @@ void bf_cell_maturation(struct cats_grid *grid, struct cats_thread_info *ts, cat } //int orig_eggs = data->eggs[row][col]; - + // the number of generations per cell is usually not an integer value // the non-integer part of the number of generations is used in the generation which is // one greater than the integer part of the number of generations @@ -72,7 +73,7 @@ void bf_cell_maturation(struct cats_grid *grid, struct cats_thread_info *ts, cat assert(this_generation_fraction <= 1.0); } - cats_dt_population max_cc = (cats_dt_population) grid->param.carrying_capacity.max_rate; + //cats_dt_population max_cc = (cats_dt_population) grid->param.carrying_capacity.max_rate; float eggs = this_generation_fraction * data->eggs[row][col]; if (eggs > data->eggs[row][col]) { @@ -95,16 +96,18 @@ void bf_cell_maturation(struct cats_grid *grid, struct cats_thread_info *ts, cat cats_dt_rates survival = bf_egg_to_adult_survival_rate(adults_per_female, max_eggs); cats_dt_population adults = poisson(ts->rng, eggs * survival); assert(adults >= 0); - cats_dt_environment suit = get_suitability(grid, row, col); + //cats_dt_environment suit = get_suitability(grid, row, col); //printf("ABCD,%d,%d,%0.3f\n", (int) orig_eggs, adults, suit); - set_population_ignore_cc(grid, row, col, adults); + set_population(grid, row, col, adults); +/* if (adults > max_cc * 10) { log_message(LOG_ERROR, "row %d col %d: number of adults %d exceeds %d time smaximum carrying capacity %d (maturation %Lf, eggs %f, max adults per f %Lf), suit %f, OT %Lf, survival %Lf", row, col, adults, 10, max_cc, survival, eggs, module_conf->adults_per_female.max_rate, suit, grid->param.OT, survival); exit_cats(EXIT_FAILURE); } + */ }