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

butterflies: combined resource and host overlay update when not all layers are specified

parent 80f454f0
Branches
Tags
No related merge requests found
......@@ -48,16 +48,22 @@ enum action_status bf_grid_overlay_update(const struct cats_configuration *conf,
conf->overlays.habitat_cc->data[row][col] > 0) {
data->info_layer[row][col] |= BF_CELL_HABITAT_OK;
cells_habitat_ok += 1;
} else if (!conf->overlays.overlay[OL_HABITAT_TYPE_CC].enabled) {
data->info_layer[row][col] |= BF_CELL_HABITAT_OK;
cells_habitat_ok += 1;
}
if (conf->overlays.overlay[OL_RESOURCE].enabled &&
conf->overlays.resources->data[row][col] > 0) {
data->info_layer[row][col] |= BF_CELL_RESOURCE_AVAILABLE;
cells_resource_ok += 1;
} else if (!conf->overlays.overlay[OL_RESOURCE].enabled) {
data->info_layer[row][col] |= BF_CELL_RESOURCE_AVAILABLE;
cells_resource_ok += 1;
}
if ((data->info_layer[row][col] & BF_CELL_HABITAT_OK) &&
(data->info_layer[row][col] & BF_CELL_RESOURCE_AVAILABLE)) {
(data->info_layer[row][col] & BF_CELL_RESOURCE_AVAILABLE)) {
data->info_layer[row][col] |= BF_CELL_VALID_DISPERSAL_TARGET;
cells_habitat_and_resource_ok += 1;
......@@ -83,11 +89,13 @@ 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",
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 removed", cells_eggs_removed );
log_message(LOG_INFO, "Overlay update: %ld cells with adults removed", cells_adults_removed );
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