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

butterflies: more info on overlay update

parent f41c9060
No related branches found
No related tags found
No related merge requests found
......@@ -25,6 +25,8 @@ enum action_status bf_grid_overlay_update(const struct cats_configuration *conf,
int64_t cells_excluded = 0;
int64_t cells_resource_ok = 0;
int64_t cells_habitat_and_resource_ok = 0;
int64_t cells_eggs_removed = 0;
int64_t cells_adults_removed = 0;
for (cats_dt_coord row = 0; row < rows; row++) {
for (cats_dt_coord col = 0; col < cols; col++) {
......@@ -33,6 +35,8 @@ enum action_status bf_grid_overlay_update(const struct cats_configuration *conf,
if (cell_excluded_by_overlay(conf, row, col)) {
data->info_layer[row][col] |= BF_CELL_EXCLUDED;
if (data->eggs[row][col]) cells_eggs_removed += 1;
if (get_adult_population(grid, row, col)) cells_adults_removed += 1;
data->eggs[row][col] = 0;
set_population_ignore_cc(grid, row, col, 0);
cells_excluded += 1;
......@@ -58,6 +62,8 @@ enum action_status bf_grid_overlay_update(const struct cats_configuration *conf,
cells_habitat_and_resource_ok += 1;
} else {
if (data->eggs[row][col]) cells_eggs_removed += 1;
if (get_adult_population(grid, row, col)) cells_adults_removed += 1;
data->eggs[row][col] = 0;
set_population_ignore_cc(grid, row, col, 0);
}
......@@ -79,6 +85,9 @@ enum action_status bf_grid_overlay_update(const struct cats_configuration *conf,
log_message(LOG_INFO, "Overlay update: %ld excluded, %ld habitat ok, %ld resource ok, %ld habitat + resource ok",
cells_excluded, cells_habitat_ok, cells_resource_ok, cells_habitat_and_resource_ok);
log_message(LOG_INFO, "Overlay update %ld cells with eggs, total %f eggs, average %f eggs per cell", cells_with_eggs, total_eggs, total_eggs/(float) cells_with_eggs);
log_message(LOG_INFO, "Overlay update: %ld cells with eggs, total %f eggs, average %f eggs per cell", cells_with_eggs, total_eggs, total_eggs/(float) cells_with_eggs);
log_message(LOG_INFO, "Overlay update: %ld cells with eggs removed", cells_eggs_removed );
log_message(LOG_INFO, "Overlay update: %ld cells with adults removed", cells_adults_removed );
return ACTION_RUN;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment