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

butterflies: debug generations update

parent ae319514
No related branches found
No related tags found
No related merge requests found
...@@ -23,19 +23,26 @@ void bf_area_generation_update(struct cats_grid *grid, struct cats_thread_info * ...@@ -23,19 +23,26 @@ void bf_area_generation_update(struct cats_grid *grid, struct cats_thread_info *
const cats_dt_rates ot = grid->param.OT; const cats_dt_rates ot = grid->param.OT;
int64_t cells_with_eggs = 0;
int64_t cells_with_eggs_removed = 0;
for (cats_dt_coord row = start_row; row < end_row; row++) { for (cats_dt_coord row = start_row; row < end_row; row++) {
for (cats_dt_coord col = start_col; col < end_col; col++) { for (cats_dt_coord col = start_col; col < end_col; col++) {
if (get_suitability(grid, row, col) < ot) if (get_suitability(grid, row, col) < ot)
{ {
if (data->eggs[row][col] > 0) cells_with_eggs_removed += 1;
data->eggs[row][col] = 0.0f; data->eggs[row][col] = 0.0f;
data->generations[row][col] = 0.0f; data->generations[row][col] = 0.0f;
set_population_ignore_cc(grid, row, col, 0); set_population_ignore_cc(grid, row, col, 0);
continue; continue;
} }
if (cell_excluded_by_overlay(conf, row, col)) { if (cell_excluded_by_overlay(conf, row, col)) {
if (data->eggs[row][col] > 0) cells_with_eggs_removed += 1;
data->eggs[row][col] = 0.0f; data->eggs[row][col] = 0.0f;
data->generations[row][col] = 0.0f; data->generations[row][col] = 0.0f;
set_population_ignore_cc(grid, row, col, 0); set_population_ignore_cc(grid, row, col, 0);
...@@ -43,6 +50,7 @@ void bf_area_generation_update(struct cats_grid *grid, struct cats_thread_info * ...@@ -43,6 +50,7 @@ void bf_area_generation_update(struct cats_grid *grid, struct cats_thread_info *
} }
if ( ! (data->info_layer[row][col] & BF_CELL_VALID_DISPERSAL_TARGET)){ if ( ! (data->info_layer[row][col] & BF_CELL_VALID_DISPERSAL_TARGET)){
if (data->eggs[row][col] > 0) cells_with_eggs_removed += 1;
data->eggs[row][col] = 0.0f; data->eggs[row][col] = 0.0f;
data->generations[row][col] = 0.0f; data->generations[row][col] = 0.0f;
set_population_ignore_cc(grid, row, col, 0); set_population_ignore_cc(grid, row, col, 0);
...@@ -51,7 +59,10 @@ void bf_area_generation_update(struct cats_grid *grid, struct cats_thread_info * ...@@ -51,7 +59,10 @@ void bf_area_generation_update(struct cats_grid *grid, struct cats_thread_info *
cats_dt_rates gen = calculate_rate(rate, 0, conf->param, grid, row, col, NULL); cats_dt_rates gen = calculate_rate(rate, 0, conf->param, grid, row, col, NULL);
data->generations[row][col] = (float) gen; data->generations[row][col] = (float) gen;
if (data->eggs[row][col] > 0) cells_with_eggs += 1;
} }
} }
log_message(LOG_INFO, "thread %d: %ld cells with eggs removed, %ld cells with eggs left", ts->id, cells_with_eggs_removed, cells_with_eggs);
} }
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment