Skip to content
Snippets Groups Projects
Commit 3d10f961 authored by Andreas Gattringer's avatar Andreas Gattringer
Browse files

butterflies: rename variable

parent 892dd52f
No related branches found
No related tags found
No related merge requests found
......@@ -150,6 +150,7 @@ int64_t butterflies_prune_invalid_cells(struct cats_grid *grid)
struct grid_data_butterflies *data = grid->grid_modules[module_id].module_data;
cats_dt_coord rows = grid->dimension.rows;
cats_dt_coord cols = grid->dimension.cols;
for (cats_dt_coord row = 0; row < rows; row++) {
for (cats_dt_coord col = 0; col < cols; col++) {
if (!(data->info_layer[row][col] & BF_CELL_VALID_DISPERSAL_TARGET)) {
......@@ -164,11 +165,11 @@ int64_t butterflies_prune_invalid_cells(struct cats_grid *grid)
void initial_population_adjustment(struct cats_configuration *conf, struct cats_grid *grid)
{
int64_t init_populated_cells = count_populated_cells(grid);
int64_t invalid_habitat = butterflies_prune_invalid_cells(grid);
int64_t invalid_resources = butterflies_prune_invalid_cells(grid);
log_message(LOG_IMPORTANT, "Loaded initial populations: %ld cells occupied before adjustment", init_populated_cells);
if (grid->param.initial_population.set_to_cc == true) {
#define DEBUG_INITIAL_POPULATIONS
#define DEBUG_INITIAL_POPULATIONS 1
#ifdef DEBUG_INITIAL_POPULATIONS
const int32_t max_i = 10;
struct cats_vital_rate *cc_rate = &grid->param.carrying_capacity;
......@@ -187,6 +188,7 @@ void initial_population_adjustment(struct cats_configuration *conf, struct cats_
for (cats_dt_coord row = 0; row < rows; row++) {
for (cats_dt_coord col = 0; col < cols; col++) {
if (get_adult_population(grid, row, col) == 0) continue;
start += 1;
cats_dt_rates multiplier = 1.0;
......@@ -222,7 +224,7 @@ void initial_population_adjustment(struct cats_configuration *conf, struct cats_
int64_t after_populated_cells = count_populated_cells(grid);
log_message(LOG_IMPORTANT, "Pruned initial populations from %ld cells to %ld, (%ld wrong habitat)",
init_populated_cells, after_populated_cells, invalid_habitat);
init_populated_cells, after_populated_cells, invalid_resources);
grid->param.initial_population.adjusted = true;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment