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
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
BDC
cats
Commits
44114cfd
Commit
44114cfd
authored
1 year ago
by
Andreas Gattringer
Browse files
Options
Downloads
Patches
Plain Diff
butterflies: more debug info at start
parent
3ff8279c
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/modules/butterflies/butterflies_actions.c
+42
-0
42 additions, 0 deletions
src/modules/butterflies/butterflies_actions.c
with
42 additions
and
0 deletions
src/modules/butterflies/butterflies_actions.c
+
42
−
0
View file @
44114cfd
...
...
@@ -15,10 +15,52 @@
#include
"butterflies_overlays.h"
#include
"butterflies_filenames.h"
#include
"inline.h"
#include
"lambda/leslie_matrix.h"
enum
action_status
bf_action_stats_reset
(
struct
cats_grid
*
grid
,
struct
cats_configuration
*
conf
)
{
// FIXME MOVE
if
(
conf
->
time
.
year_current
==
conf
->
time
.
year_start
)
{
log_message
(
LOG_INFO
,
"SUMMARY: Scale factor: %Lf"
,
grid
->
param
.
scale_factor
);
struct
lambda_parameters
l_param
=
{
0
};
l_param
.
calculate_scale
=
true
;
l_param
.
suitability
=
grid
->
param
.
OT
;
l_param
.
N
=
0
;
l_param
.
K
=
(
cats_dt_population
)
(
get_vital_rate_maximum
(
&
conf
->
param
[
grid
->
id
].
carrying_capacity
)
*
conf
->
param
->
max_adult_cc_fraction
);
l_param
.
grid
=
0
;
l_param
.
row
=
0
;
l_param
.
col
=
0
;
l_param
.
param
=
&
conf
->
param
[
grid
->
id
];
l_param
.
species_id
=
grid
->
id
;
bool
print_rate
=
false
;
struct
conf_data_butterflies
*
module_conf
=
CATS_MODULE_DATA
;
cats_dt_rates
female_fraction
=
module_conf
->
female_fraction
;
cats_dt_rates
stationary
=
module_conf
->
probability_to_stay
;
cats_dt_rates
mobile
=
1
.
0
-
stationary
;
cats_dt_rates
egg_fraction_source
=
module_conf
->
egg_fraction_source
;
cats_dt_rates
eggs_per_female
=
calculate_rate_for_matrix
(
&
module_conf
->
eggs_per_female
,
&
l_param
,
print_rate
);
cats_dt_rates
reproduction_rate
=
calculate_rate_for_matrix
(
&
module_conf
->
reproduction_rate
,
&
l_param
,
print_rate
);
cats_dt_rates
local_eggs
=
(
stationary
+
mobile
*
egg_fraction_source
)
*
eggs_per_female
;
// female -> female
// to achieve the target reproduction rate, the number of eggs per female laid in the cell
// that survive and become adult has to be the reproduction rate divided by the female fraction divided by the number of eggs
cats_dt_rates
eggs_to_adults_rate
=
bf_egg_to_adult_survival_rate
(
reproduction_rate
,
local_eggs
,
female_fraction
);
cats_dt_rates
result
=
local_eggs
*
eggs_to_adults_rate
*
female_fraction
;
log_message
(
LOG_INFO
,
"SUMMARY: reproduction rate at OT: %Lf"
,
reproduction_rate
);
log_message
(
LOG_INFO
,
"SUMMARY: eggs per female at OT: %Lf"
,
eggs_per_female
);
log_message
(
LOG_INFO
,
"SUMMARY: local eggs at OT: %Lf"
,
local_eggs
);
log_message
(
LOG_INFO
,
"SUMMARY: stationary females at OT: %Lf"
,
stationary
);
log_message
(
LOG_INFO
,
"SUMMARY: eggs to adult rate at OT: %Lf"
,
eggs_to_adults_rate
);
log_message
(
LOG_INFO
,
"SUMMARY: egg fraction source at OT: %Lf"
,
egg_fraction_source
);
log_message
(
LOG_INFO
,
"SUMMARY: carrying capacity at OT: %d"
,
l_param
.
K
);
log_message
(
LOG_INFO
,
"SUMMARY: effective female to female rate at OT: %Lf
\n
"
,
result
);
}
return
action_grid_stats_reset
(
grid
,
conf
);
}
...
...
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