Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cats
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
BDC
cats
Commits
d02f8233
Commit
d02f8233
authored
Jun 14, 2023
by
Andreas Gattringer
Browse files
Options
Downloads
Patches
Plain Diff
butterflies: use carrying capacity for now
parent
05664285
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/modules/butterflies/butterflies_populations.c
+7
-4
7 additions, 4 deletions
src/modules/butterflies/butterflies_populations.c
with
7 additions
and
4 deletions
src/modules/butterflies/butterflies_populations.c
+
7
−
4
View file @
d02f8233
...
...
@@ -14,6 +14,7 @@
#include
"butterflies_inline.h"
#include
"inline_population.h"
#include
"inline.h"
#include
"populations/population.h"
cats_dt_rates
bf_egg_to_adult_survival_rate
(
cats_dt_rates
adults_per_female
,
cats_dt_rates
max_eggs
)
...
...
@@ -72,7 +73,7 @@ void bf_cell_maturation(struct cats_grid *grid, struct cats_thread_info *ts, cat
assert
(
this_generation_fraction
<=
1
.
0
);
}
cats_dt_population
max_cc
=
(
cats_dt_population
)
grid
->
param
.
carrying_capacity
.
max_rate
;
//
cats_dt_population max_cc = (cats_dt_population) grid->param.carrying_capacity.max_rate;
float
eggs
=
this_generation_fraction
*
data
->
eggs
[
row
][
col
];
if
(
eggs
>
data
->
eggs
[
row
][
col
])
{
...
...
@@ -95,16 +96,18 @@ void bf_cell_maturation(struct cats_grid *grid, struct cats_thread_info *ts, cat
cats_dt_rates
survival
=
bf_egg_to_adult_survival_rate
(
adults_per_female
,
max_eggs
);
cats_dt_population
adults
=
poisson
(
ts
->
rng
,
eggs
*
survival
);
assert
(
adults
>=
0
);
cats_dt_environment
suit
=
get_suitability
(
grid
,
row
,
col
);
//
cats_dt_environment suit = get_suitability(grid, row, col);
//printf("ABCD,%d,%d,%0.3f\n", (int) orig_eggs, adults, suit);
set_population_ignore_cc
(
grid
,
row
,
col
,
adults
);
set_population
(
grid
,
row
,
col
,
adults
);
/*
if (adults > max_cc * 10) {
log_message(LOG_ERROR, "row %d col %d: number of adults %d exceeds %d time smaximum carrying capacity %d (maturation %Lf, eggs %f, max adults per f %Lf), suit %f, OT %Lf, survival %Lf", row, col, adults, 10, max_cc,
survival, eggs, module_conf->adults_per_female.max_rate, suit, grid->param.OT, survival);
exit_cats(EXIT_FAILURE);
}
*/
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment