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

butterflies: print egg counts after overlay update

parent 49fb96fb
No related branches found
No related tags found
No related merge requests found
......@@ -63,7 +63,22 @@ enum action_status bf_grid_overlay_update(const struct cats_configuration *conf,
}
}
}
int64_t cells_with_eggs = 0;
double total_eggs = 0;
for (cats_dt_coord row = 0; row < rows; row++) {
for (cats_dt_coord col = 0; col < cols; col++) {
float eggs = data->eggs[row][col];
if (eggs > 0) {
cells_with_eggs += 1;
total_eggs += eggs;
}
}
}
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);
return ACTION_RUN;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment