diff --git a/src/cats/threading/threading-helpers.c b/src/cats/threading/threading-helpers.c index d8009004dc0cb11c55d18682252372d393429b9d..cec0929529e3cca009a1f28074d8495538488acc 100644 --- a/src/cats/threading/threading-helpers.c +++ b/src/cats/threading/threading-helpers.c @@ -50,7 +50,7 @@ initialize_thread(struct cats_thread_info *thread, struct cats_grid *grid, struc zero_statistics_stats(&thread->stats[i]); } - thread->temp = 0; + thread->temp_adults_present = 0; thread->temp1 = 0; thread->temp2 = 0; thread->seed = get_random_seed(false); diff --git a/src/cats/threading/threading.h b/src/cats/threading/threading.h index c025c7898cd7740de0c9c67d9d7ce3774b2b6d10..b701601f5b6343f779f28535c970c5144393b7bd 100644 --- a/src/cats/threading/threading.h +++ b/src/cats/threading/threading.h @@ -50,7 +50,7 @@ struct cats_thread_info { struct cats_configuration *conf; gsl_rng *rng; unsigned int rng_seed; - int64_t temp; + int64_t temp_adults_present; int64_t temp1; int64_t temp2; char *rng_state_buffer; diff --git a/src/modules/butterflies/butterflies_actions.c b/src/modules/butterflies/butterflies_actions.c index 795eed9312e185131b4880ffcf8922301ff04e5d..cd3b954c5e7839930e9bc6609df8f961877fa080 100644 --- a/src/modules/butterflies/butterflies_actions.c +++ b/src/modules/butterflies/butterflies_actions.c @@ -97,7 +97,7 @@ void grid_butterflies_maturation(struct cats_grid *grid, struct cats_thread_info const cats_dt_coord start_col = ts->area.start_col; const cats_dt_coord end_col = ts->area.end_col; - ts->temp = 0; + ts->temp_adults_present = 0; for (cats_dt_coord row = start_row; row < end_row; row++) { for (cats_dt_coord col = start_col; col < end_col; col++) { @@ -121,7 +121,7 @@ void butterflies_area_dispersal(struct cats_grid *grid, struct cats_thread_info const cats_dt_coord start_col = ts->area.start_col; const cats_dt_coord end_col = ts->area.end_col; - ts->temp = 0; + ts->temp_adults_present = 0; ts->temp1 = 0; ts->temp2 = 0; @@ -137,7 +137,7 @@ void butterflies_area_dispersal(struct cats_grid *grid, struct cats_thread_info butterflies_cell_dispersal(grid, ts, row, col, false); } } - if (ts->temp) printf("thread %d: %ld random walks (%ld cells) avg %f\n", ts->id, ts->temp, ts->temp1, (float) ts->temp / (float) ts->temp1); + if (ts->temp_adults_present) printf("thread %d: %ld random walks (%ld cells) avg %f\n", ts->id, ts->temp_adults_present, ts->temp1, (float) ts->temp_adults_present / (float) ts->temp1); } diff --git a/src/modules/butterflies/butterflies_dispersal.c b/src/modules/butterflies/butterflies_dispersal.c index 6cd103477c7baac8e1d4542fb1b13f63a8f00bc8..ec65d61d21e9ba193612c0614452d36ab02c83a9 100644 --- a/src/modules/butterflies/butterflies_dispersal.c +++ b/src/modules/butterflies/butterflies_dispersal.c @@ -119,7 +119,7 @@ butterflies_cell_dispersal(struct cats_grid *grid, struct cats_thread_info *ts, // total adults: the number of adults that became adult in this cell, possibly exceeding the carrying capacity (thanks to poisson processes) const cats_dt_population total_adults = get_adult_population(grid, row, col); if (total_adults == 0) return; - ts->temp++; + ts->temp_adults_present++; struct conf_data_butterflies *module_conf = CATS_MODULE_DATA; // total females: how many of the total adults are female, as drawn from a binomial distribution with p = 0.5 // can be safely cast, because gsl_ran_binomial will return a number <= total_adults