Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • development
  • main
  • refactor-libraries
  • 1.0.0
  • 1.0.1
  • 1.0.2
  • 1.0.3
  • 1.1.0
8 results

Target

Select target project
  • bdc/cats
1 result
Select Git revision
Show changes
Showing
with 83 additions and 103 deletions
......@@ -40,50 +40,42 @@ void destroy_plant_cell(struct cats_grid *grid, const cats_dt_coord row, const c
assert(col >= 0 && col < grid->dimension.cols);
destroy_juveniles(grid, row, col);
destroy_seed_structure(grid, row, col);
grid->dispersed_seeds[row][col] = 0.0f;
grid->seeds_produced[row][col] = 0.0f;
set_dispersed_seeds(grid, row, col, 0.0f);
set_produced_seeds(grid, row, col, 0.0f);
set_population_ignore_cc(grid, row, col, 0);
}
void create_seed_structure(const struct cats_grid *grid, const cats_dt_coord row, const cats_dt_coord col)
{
assert(grid != NULL);
if (grid->seed_bank[row][col] != NULL) return;
assert(valid_seed_bank_grid(grid, row));
if (seed_bank_exists(grid, row, col) == true) return;
const int32_t seed_persistence = get_vital_age(grid, VA_SEED_PERSISTENCE);
const int32_t size = seed_persistence - 0; // - 1);
const int32_t size = seed_persistence;
if (size <= 0) return; // no seed persistence
assert(grid->seed_bank != NULL);
assert(row >= 0 && row < grid->dimension.rows);
assert(col >= 0 && col < grid->dimension.cols);
assert(grid->seed_bank[row][col] == NULL);
grid->seed_bank[row][col] = calloc_or_die(size, sizeof(cats_dt_seeds));
grid->seed_bank[row][col] = calloc_or_die(size, sizeof(cats_dt_seeds)); // initialisation [create_seed_structure]
}
void destroy_seed_structure(const struct cats_grid *grid, const cats_dt_coord row, const cats_dt_coord col)
{
assert(grid != NULL);
assert(grid->seed_bank != NULL);
assert(row >= 0 && row < grid->dimension.rows);
assert(col >= 0 && col < grid->dimension.cols);
const int32_t seed_persistence = get_vital_age(grid, VA_SEED_PERSISTENCE);
const int size = (seed_persistence - 0); // -1
const int size = (seed_persistence - 0);
// do we actually have seeds in the ground?
if (size <= 0 || grid->seed_bank[row][col] == NULL) return;
if (size <= 0 || seed_bank_exists(grid, row, col) == false) return;
for (uint32_t i = 0; i < size; i++) {
grid->seed_bank[row][col][i] = 0.0f;
for (int32_t i = 0; i < size; i++) {
set_seed_bank_seeds(grid, row, col, i, 0.0f); // clean-up [destroy_seed_structure]
}
free(grid->seed_bank[row][col]);
grid->seed_bank[row][col] = NULL;
free(grid->seed_bank[row][col]); // clean-up [destroy_seed_structure]
grid->seed_bank[row][col] = NULL; // clean-up [destroy_seed_structure]
}
......@@ -93,19 +85,18 @@ inline
void
create_juvenile_structure_if_needed(struct cats_grid *grid, const cats_dt_coord row, const cats_dt_coord col)
{
if (grid->juveniles[row][col]) return;
if (juveniles_exist(grid, row, col)) return;
const int32_t max_age_of_maturity = get_vital_age(grid, VA_AGE_OF_MATURITY_MAX);
grid->juveniles[row][col] = create_juvenile_structure(max_age_of_maturity);
grid->juveniles[row][col] = create_juvenile_structure(max_age_of_maturity); // initialisation [create_juvenile_structure_if_needed]
}
void destroy_juveniles(const struct cats_grid *grid, const cats_dt_coord row, const cats_dt_coord col)
{
assert(grid != NULL);
assert(row >= 0 && row < grid->dimension.rows);
assert(col >= 0 && col < grid->dimension.cols);
assert(grid != NULL); // clean-up [destroy_juveniles]
assert(row >= 0 && row < grid->dimension.rows); // clean-up [destroy_juveniles]
assert(col >= 0 && col < grid->dimension.cols); // clean-up [destroy_juveniles]
assert(grid->juveniles != NULL);
......@@ -114,10 +105,10 @@ void destroy_juveniles(const struct cats_grid *grid, const cats_dt_coord row, co
const int32_t stages = max_age_of_maturity + 1;
assert(stages >= 0);
if (grid->juveniles[row] && grid->juveniles[row][col]) {
memset(grid->juveniles[row][col], 0, stages * sizeof(cats_dt_population));
free(grid->juveniles[row][col]);
grid->juveniles[row][col] = NULL;
if (grid->juveniles[row] && grid->juveniles[row][col]) { // clean-up [destroy_juveniles]
memset(grid->juveniles[row][col], 0, stages * sizeof(cats_dt_population)); // clean-up [destroy_juveniles]
free(grid->juveniles[row][col]); // clean-up [destroy_juveniles]
grid->juveniles[row][col] = NULL; // clean-up [destroy_juveniles]
}
}
......
......@@ -87,9 +87,8 @@ void cell_seed_production(struct cats_grid *grid, cats_dt_coord row, cats_dt_coo
assert(grid->seeds_produced != NULL);
// ensure that no seeds are left-over in the cell
assert(grid->seeds_produced[row][col] == 0.0);
grid->seeds_produced[row][col] = 0.0f;
assert(get_produced_seeds(grid, row, col) == 0.0f);
set_produced_seeds(grid, row, col, 0.0f);
// no population -> no seeds
cats_dt_rates N = get_adult_population(grid, row, col);
......@@ -124,10 +123,11 @@ void cell_seed_production(struct cats_grid *grid, cats_dt_coord row, cats_dt_coo
const cats_dt_rates total_seeds = N * flowering_frequency * seed_yield * pollination_rate;
assert(total_seeds >= 0.0);
cats_dt_seeds seeds = poisson_seeds(ts->rng, total_seeds); // we don't cap
set_produced_seeds(grid, row, col, seeds);
grid->seeds_produced[row][col] = poisson_seeds(ts->rng, total_seeds); // we don't cap
if (grid->seeds_produced[row][col] > 0) ts->stats[grid->id].stats[CS_SEEDS_PRODUCED] += 1;
if (seeds > 0) ts->stats[grid->id].stats[CS_SEEDS_PRODUCED] += 1;
cats_dt_rates hapaxanth = grid->param.hapaxanthy;
......@@ -167,17 +167,19 @@ germinate_seeds_in_ground(struct cats_thread_info *ts, struct cats_grid *grid, c
for (int32_t k = 0; k < max_k; k++) {
cats_dt_population germinated = poisson(ts->rng, grid->seed_bank[row][col][k] * germination_rate);
cats_dt_seeds seeds_k = get_seed_bank_seeds(grid, row, col, k);
cats_dt_population germinated = poisson(ts->rng, seeds_k * germination_rate);
if (germinated <= 0) continue;
add_germinated(ts, grid, row, col, germinated, K_class);
grid->seed_bank[row][col][k] = max_float(grid->seed_bank[row][col][k] - (float) germinated, 0.0f);
seeds_k = max_float(seeds_k - (float) germinated, 0.0f);
set_seed_bank_seeds(grid, row, col, k, seeds_k);
}
}
/*
// no longer used
static inline void
germinate_seeds0(struct cats_grid *grid, const cats_dt_coord row, const cats_dt_coord col, struct cats_thread_info *ts,
const cats_dt_rates germination_rate)
......@@ -197,16 +199,16 @@ germinate_seeds0(struct cats_grid *grid, const cats_dt_coord row, const cats_dt_
grid->dispersed_seeds[row][col] = max_float(grid->dispersed_seeds[row][col] - (float) germinated,
0.0f); // fixme max_seeds
}
*/
inline static bool
have_seeds_in_cell(const struct cats_grid *grid, const struct cats_configuration *conf, cats_dt_coord row,
cats_dt_coord col, const struct cats_thread_info *ts)
{
assert(grid->dispersed_seeds != NULL);
assert(grid->dispersed_seeds[row][col] >= 0);
return (grid->seed_bank[row][col] != NULL || grid->dispersed_seeds[row][col] > 0.5);
cats_dt_seeds d_seeds = get_dispersed_seeds(grid, row, col);
assert(d_seeds >= 0);
return (seed_bank_exists(grid, row, col) || d_seeds > 0.5);
}
......@@ -242,21 +244,22 @@ cell_post_process_seeds(struct cats_grid *grid, struct cats_configuration *conf,
struct cats_thread_info *ts)
{
assert(grid != NULL);
assert(grid->dispersed_seeds != NULL);
assert(grid->dispersed_seeds[row][col] >= 0);
assert(valid_dispersed_seeds_grid(grid, row));
cats_dt_seeds disp_seeds = get_dispersed_seeds(grid, row, col);
assert(disp_seeds >= 0);
if (disp_seeds == 0.0f) return;
if (cell_excluded_by_overlay(conf, row, col)) {
grid->dispersed_seeds[row][col] = 0;
set_dispersed_seeds(grid, row, col, 0.0f);
return;
}
if (grid->dispersed_seeds[row][col] == 0.0) return;
const int32_t id = grid->id;
ts->stats[id].stats[CS_SEEDS_BEFORE_POISSON] += 1;
cats_dt_seeds seeds_after_poisson = poisson_seeds(ts->rng,
grid->dispersed_seeds[row][col]); /* IMPORTANT stochasticity required */
grid->dispersed_seeds[row][col] = seeds_after_poisson;
disp_seeds); /* IMPORTANT stochasticity required */
set_dispersed_seeds(grid, row, col, seeds_after_poisson);
if (seeds_after_poisson > 0) ts->stats[id].stats[CS_SEEDS_AFTER_POISSON] += 1;
}
......@@ -51,7 +51,7 @@ get_carrying_capacity_all_classes(struct cats_grid **grids, cats_dt_coord row, c
cats_dt_population
get_carrying_capacity(const struct cats_grid *grid, cats_dt_coord row, cats_dt_coord col)
{
assert(grid->conf != NULL);
assert(grid != NULL && grid->conf != NULL);
const struct cats_configuration *conf = grid->conf;
......@@ -63,7 +63,6 @@ get_carrying_capacity(const struct cats_grid *grid, cats_dt_coord row, cats_dt_c
cats_dt_rates cc;
const struct cats_vital_rate *link = &grid->param.carrying_capacity;
cc = calculate_rate(link, NAN, &grid->param, grid, row, col, NULL);
......@@ -89,7 +88,7 @@ cell_apply_carrying_capacity(struct cats_grid *grid, struct cats_thread_info *ts
if (grid->param.default_demographics) {
cats_dt_population N = get_adult_population(grid, row, col);
if (N == 0 && grid->juveniles[row][col] == NULL) return;
if (N == 0 && juveniles_exist(grid, row, col) == false) return;
if (N > 0) ts->stats[grid_id].stats[CS_POPULATED_BEFORE_CC] += 1;
cats_dt_population K_A = get_adult_carrying_capacity_from_cc(grid, K_tot);
......
......@@ -87,12 +87,12 @@ scale_down_juveniles2(struct cats_grid *grid, cats_dt_coord row, cats_dt_coord c
assert(grid != NULL && grid->juveniles != NULL);
assert(row >= 0 && row < grid->dimension.rows);
assert(col >= 0 && col < grid->dimension.cols);
assert(grid->juveniles[row] != NULL);
assert(juveniles_exist(grid, row, col));
assert(juvenile_cc > 0);
if (grid->juveniles[row][col] == NULL || weighted_juvenile_sum == 0) return;
if (juveniles_exist(grid, row, col) == false || weighted_juvenile_sum == 0) return;
if (weighted_juvenile_sum < juvenile_cc) return;
const int32_t mat_max = get_vital_age(grid, VA_AGE_OF_MATURITY_MAX); // grid->param.max_age_of_maturity;
const int32_t mat_max = get_vital_age(grid, VA_AGE_OF_MATURITY_MAX);
cats_dt_rates factor = 1.0;
for (int32_t i = 0; i < mat_max + 1; i++) {
......@@ -121,8 +121,8 @@ scale_down_juveniles2(struct cats_grid *grid, cats_dt_coord row, cats_dt_coord c
log_message(LOG_ERROR, "%s: weighted juvenile sum > juvenile CC", __func__);
log_message(LOG_RAW, "sum: %"PRId64", cc %"PRId64"\n", weighted_juvenile_sum, juvenile_cc);
log_message(LOG_RAW, "factor %f\n", (double) factor);
for (int32_t i = 0; i < mat_max + 1 - 1; i++) {
log_message(LOG_RAW, "juvenile stage %d: %d - multiplier %f\n", i,
for (int32_t i = 0; i < mat_max + 1; i++) {
log_message(LOG_RAW, "juvenile stage %d: %d - multiplier %f\n", i,
grid->juveniles[row][col][i],
(double) juvenile_cc_multiplier(&grid->param, i));
}
......@@ -137,7 +137,7 @@ void cell_apply_juvenile_cc(struct cats_grid *g, cats_dt_coord row,
cats_dt_coord col, cats_dt_population K_tot, cats_dt_population N)
{
if (g->juveniles == NULL) return;
if (g->juveniles[row][col] == NULL) return;
if (juveniles_exist(g, row, col) == false) return;
cats_dt_population K_J = K_tot - N;
......
......@@ -56,14 +56,15 @@ void adjust_juvenile_populations(struct cats_configuration *conf, struct cats_gr
//cats_dt_rates w = juvenile_cc_multiplier(&grid->param, i);
cats_dt_rates w = grid->param.juvenile_cc_weights[i];
cats_dt_rates juv_pop = (cats_dt_rates) N * multi / w;
if (juv_pop > CATS_MAX_POPULATION) {
juv_pop = CATS_MAX_POPULATION / 2.0;
}
grid->juveniles[r][c][i] = round_population_safe(juv_pop);
set_juveniles(grid, r, c, i, round_population_safe(juv_pop));
}
}
}
}
......@@ -153,7 +154,8 @@ void prune_initial_population_under_threshold(struct cats_configuration *conf, s
}
}
log_message(LOG_INFO, "Species '%s': pruned %"PRId64" of %"PRId64" initial populations (suitability < threshold), %"PRId64" remaining",
log_message(LOG_INFO,
"Species '%s': pruned %"PRId64" of %"PRId64" initial populations (suitability < threshold), %"PRId64" remaining",
grid->param.species_name, destroyed, populated, populated - destroyed);
}
......
......@@ -50,9 +50,6 @@ initialize_thread(struct cats_thread_info *thread, struct cats_grid *grid, struc
zero_statistics_stats(&thread->stats[i]);
}
thread->rw_debug_cells_with_adults = 0;
thread->rw_debug_random_walks = 0;
thread->rw_debug_deposits = 0;
thread->seed = get_random_seed(false);
for (int i = 0; i < 4; i++) {
......
......@@ -50,9 +50,6 @@ struct cats_thread_info {
struct cats_configuration *conf;
gsl_rng *rng;
unsigned int rng_seed;
int64_t rw_debug_cells_with_adults;
int64_t rw_debug_random_walks;
int64_t rw_debug_deposits;
char *rng_state_buffer;
int32_t rng_buf_size;
struct random_data *rng_state;
......
......@@ -112,7 +112,6 @@ 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->rw_debug_cells_with_adults = 0;
for (cats_dt_coord row = start_row; row < end_row; row++) {
for (cats_dt_coord col = start_col; col < end_col; col++) {
......@@ -174,11 +173,6 @@ 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->rw_debug_cells_with_adults = 0;
ts->rw_debug_random_walks = 0;
ts->rw_debug_deposits = 0;
for (cats_dt_coord row = start_row; row < end_row; row++) {
for (cats_dt_coord col = start_col; col < end_col; col++) {
if (cell_excluded_by_overlay(conf, row, col)
......@@ -256,12 +250,11 @@ enum action_status bf_action_dispersal(struct cats_grid *grid, struct cats_confi
threaded_action(&butterflies_area_dispersal, grid, conf, TS_DISPERSAL);
struct conf_data_butterflies *module_conf = CATS_MODULE_DATA;
for (enum butterfly_stats which = BF_POPULATED_AT_DISPERSAL; which < BF_STAT_MAX; which++) {
for (enum butterfly_stats which = BF_RANDOM_WALK_DEPOSIT_COUNT; which < BF_STAT_MAX; which++) {
int64_t stat_id = module_conf->stat_ids[which];
log_message(LOG_INFO, "STAT %s: %ld", bf_get_stats_field_name(which), grid->stats.stats[stat_id]);
}
return ACTION_RUN;
}
......@@ -319,15 +312,14 @@ enum action_status bf_action_overlay_update(struct cats_grid *grid, struct cats_
}
enum action_status bf_action_generation_finish(struct cats_grid *grid, struct cats_configuration *conf)
{
const int module_id = CATS_MODULE_ID;
struct grid_data_butterflies *data = grid->grid_modules[module_id].module_data;
threaded_action(&bf_area_kill_adults, grid, conf, TS_DEFAULT);
data->generation_current--;
assert(data->generation_current >= 0);
// struct conf_data_butterflies *data = CATS_MODULE_DATA;
......
......@@ -72,7 +72,8 @@ void bf_add_actions(struct cats_configuration *conf)
bf_add_generation_action(conf, bf_action_stats_gather, "gather stats", generation);
bf_add_generation_action(conf, bf_action_dispersal, "dispersal", generation);
bf_add_generation_action(conf, bf_action_save_eggs_grid, "output eggs", generation);
bf_add_generation_action(conf, bf_action_generation_finish, "finish generation", generation);
bf_add_generation_action(conf, bf_action_stats_write, "write stats", generation);
bf_add_generation_action(conf, bf_action_generation_finish, "finish generation", generation);
}
}
\ No newline at end of file
......@@ -42,7 +42,7 @@ static void inline single_random_walk(struct cats_thread_info *ts, struct cats_g
struct grid_data_butterflies *data = grid->grid_modules[module_id].module_data;
const struct conf_data_butterflies *module_conf = CATS_MODULE_DATA;
const bool debug_rw = module_conf->debug_rw;
const int64_t stat_id_deposits = module_conf->stat_ids[BF_RANDOM_WALK_DEPOSIT_COUNT];
int32_t eggs_left = eggs;
const cats_dt_coord max_steps = module_conf->animal_dispersal_max_radius;
......@@ -96,8 +96,8 @@ static void inline single_random_walk(struct cats_thread_info *ts, struct cats_g
eggs_left -= eggs_to_deposit;
butterflies_add_eggs(data, row, col, (float) eggs_to_deposit);
increase_custom_stat(ts->stats, stat_id_deposits, 1);
ts->rw_debug_deposits++;
if (debug_rw) {
fprintf(module_conf->debug_rw_file, "%d,%d,%d,%d,%d,%d,%d\n", rw_num, row, col, step + 1,
module_conf->animal_dispersal_max_radius - step - 1, eggs_to_deposit, eggs_left);
......@@ -130,7 +130,6 @@ butterflies_cell_dispersal(struct cats_grid *grid, struct cats_thread_info *ts,
const cats_dt_population total_adults = get_adult_population(grid, row, col);
if (total_adults == 0) return;
ts->rw_debug_cells_with_adults++;
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
......@@ -167,7 +166,7 @@ butterflies_cell_dispersal(struct cats_grid *grid, struct cats_thread_info *ts,
assert(stationary_females >= 0);
assert(wandering_females >= 0);
const int64_t stat_id_rw = module_conf->stat_ids[BF_RANDOM_WALK_COUNT];
const int module_id = CATS_MODULE_ID;
struct grid_data_butterflies *data = grid->grid_modules[module_id].module_data;
const bool debug_rw = module_conf->debug_rw;
......@@ -221,7 +220,8 @@ butterflies_cell_dispersal(struct cats_grid *grid, struct cats_thread_info *ts,
single_random_walk(ts, grid, row, col, eggs_to_disperse_per_female, egg_fraction_step, rw_number);
ts->rw_debug_random_walks++;
increase_custom_stat(ts->stats, stat_id_rw, 1);
}
if (debug_rw) {
fflush(module_conf->debug_rw_file);
......
......@@ -24,7 +24,7 @@ void bf_area_generation_update(struct cats_grid *grid, struct cats_thread_info *
const cats_dt_coord end_col = ts->area.end_col;
struct statistics *stats = &ts->stats[grid->id];
const cats_dt_rates ot = grid->param.OT;
const cats_dt_rates suit_ts = module_conf->butterfly_generations.suitability_cutoff;
const int64_t egg_cells_id = module_conf->stat_ids[BF_CELLS_WITH_EGGS];
const int64_t egg_cells_removed_id = module_conf->stat_ids[BF_CELLS_WITH_EGGS];
......@@ -35,13 +35,13 @@ void bf_area_generation_update(struct cats_grid *grid, struct cats_thread_info *
for (cats_dt_coord col = start_col; col < end_col; col++) {
float eggs = butterflies_get_eggs(data, row, col);
if (get_suitability(grid, row, col) < ot)
if (get_suitability(grid, row, col) < suit_ts)
{
if (eggs > 0) cells_with_eggs_removed += 1;
butterflies_set_eggs(data, row, col, 0.0f);
butterflies_set_generations(data, row, col, 0.0f);
set_population_ignore_cc(grid, row, col, 0);
continue;
}
......
......@@ -61,9 +61,6 @@ void bf_initial_population_adjustment(struct cats_configuration *conf, struct ca
printf("DEBUG::row %d col %d, suit %Lf, cc multi %Lf, cc raw %Lf, cc %d\n", row, col, suit, multiplier, cc_raw, cc);
}
}
#endif
increase_initial_population_to_cc(grid, conf);
......
......@@ -109,6 +109,8 @@ void bf_cell_maturation(struct cats_grid *grid, struct cats_thread_info *ts, cat
const int module_id = CATS_MODULE_ID;
struct grid_data_butterflies *data = grid->grid_modules[module_id].module_data;
const float all_eggs = butterflies_get_eggs(data, row, col);
if (all_eggs == 0) return;
if (all_eggs < 0) {
......@@ -158,8 +160,9 @@ void bf_cell_maturation(struct cats_grid *grid, struct cats_thread_info *ts, cat
cats_dt_environment suit = get_suitability(grid, row, col);
cats_dt_rates reproduction_rate = calculate_rate(&module_conf->reproduction_rate, NAN, &grid->param,
grid, row, col, NULL);
if (suit < grid->param.OT && reproduction_rate > 0) {
log_message(LOG_ERROR, "Suitability %f under OT %Lf, but adults per female = %Lf", suit, grid->param.OT,
cats_dt_rates suit_ts = module_conf->reproduction_rate.suitability_cutoff;
if (suit_ts < suit_ts && reproduction_rate > 0) {
log_message(LOG_ERROR, "Suitability %f under threshold %Lf, but adults per female = %Lf", suit, suit_ts,
reproduction_rate);
exit_cats(EXIT_FAILURE);
}
......
......@@ -12,6 +12,7 @@
#include "temporal/phase_names.h"
#include "temporal/years.h"
const char *bf_get_stats_field_name(enum butterfly_stats which)
{
switch (which) {
......@@ -25,11 +26,9 @@ const char *bf_get_stats_field_name(enum butterfly_stats which)
return "unpopulated_unfit";
case BF_STAT_EXCLUDED:
return "excluded";
case BF_STAT_GENERATION_ACTIVE:
return "generation_active";
case BF_POPULATED_AT_DISPERSAL:
return "populated_at_dispersal";
case BF_RANDOM_WALK_DEPOSIT_COUNT:
return "random_walk_deposit_count";
case BF_RANDOM_WALK_COUNT:
return "random_walk_count";
......@@ -37,7 +36,6 @@ const char *bf_get_stats_field_name(enum butterfly_stats which)
return "random_walk_step_count";
case BF_OUTPUT_STAT_MAX:
return "<guard value>";
case BF_STAT_MAX:
break;
case BF_CELLS_WITH_EGGS:
......@@ -51,6 +49,7 @@ const char *bf_get_stats_field_name(enum butterfly_stats which)
exit_cats(EXIT_FAILURE);
}
struct string_array *bf_assemble_stats(struct cats_configuration *conf, struct cats_grid *grid, bool header)
{
struct conf_data_butterflies *module_conf = CATS_MODULE_DATA;
......@@ -125,6 +124,7 @@ void bf_stats_write(struct cats_configuration *conf, struct cats_grid *grid)
free_string_array(&data);
}
void bf_area_stats_gather(struct cats_grid *grid, struct cats_thread_info *ts)
{
struct conf_data_butterflies *module_conf = CATS_MODULE_DATA;
......@@ -138,7 +138,6 @@ void bf_area_stats_gather(struct cats_grid *grid, struct cats_thread_info *ts)
const int64_t id_unpop_unfit = module_conf->stat_ids[BF_STAT_UNPOPULATED_UNFIT];
const int32_t grid_id = grid->id;
//const cats_dt_rates zt = grid->param.ZT;
const cats_dt_rates ot = grid->param.OT;
struct statistics *stats = &ts->stats[grid_id];
......
......@@ -13,13 +13,12 @@ enum butterfly_stats {
BF_STAT_UNPOPULATED_FIT,
BF_STAT_UNPOPULATED_UNFIT,
BF_STAT_EXCLUDED,
BF_STAT_GENERATION_ACTIVE,
BF_OUTPUT_STAT_MAX,
BF_POPULATED_AT_DISPERSAL,
BF_RANDOM_WALK_DEPOSIT_COUNT,
BF_RANDOM_WALK_COUNT,
BF_RANDOM_WALK_STEP_COUNT,
BF_CELLS_WITH_EGGS,
BF_CELLS_WITH_EGGS_REMOVED,
BF_OUTPUT_STAT_MAX,
BF_STAT_MAX
};
......