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
cb0aac87
Commit
cb0aac87
authored
May 10, 2023
by
Andreas Gattringer
Browse files
Options
Downloads
Patches
Plain Diff
backported hybrid function fixes
parent
5d25236b
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/cats/vital_rates/hybrid_functions.c
+3
-21
3 additions, 21 deletions
src/cats/vital_rates/hybrid_functions.c
with
3 additions
and
21 deletions
src/cats/vital_rates/hybrid_functions.c
+
3
−
21
View file @
cb0aac87
...
...
@@ -78,7 +78,6 @@ sigmoid(const struct cats_vital_rate *rate_info,
assert
(
rate_info
!=
NULL
);
if
(
rate_info
->
environment_set
==
NULL
)
{
log_message
(
LOG_ERROR
,
"%s: environment is NULL"
,
__func__
);
exit_cats
(
EXIT_FAILURE
);
...
...
@@ -92,7 +91,6 @@ sigmoid(const struct cats_vital_rate *rate_info,
const
cats_dt_rates
max_rate
=
rate_info
->
max_rate
;
if
(
max_rate
==
0
.
0
)
{
return
max_rate
;
}
...
...
@@ -100,7 +98,6 @@ sigmoid(const struct cats_vital_rate *rate_info,
cats_dt_rates
scale
=
get_rate_scale_factor
(
rate_info
,
species_parameter
);
const
cats_dt_rates
rate_at_OT
=
max_rate
*
scale
;
assert
(
max_rate
>=
0
);
...
...
@@ -126,15 +123,6 @@ sigmoid(const struct cats_vital_rate *rate_info,
+
expl
(
ds
*
(
OT
-
suitability
))
*
(
max_rate
/
rate_at_OT
-
1
.
0
)
);
/*
if (rate_info->is_carrying_capacity) {
printf("* %Lf scale %Lf, suit %Lf, N %Lf, K %Lf, OT %Lf, ds %Lf\n",rate, scale, suitability, N, K,OT, ds);
}
*/
const
cats_dt_rates
density
=
hybrid_density_multiplier
(
rate_info
,
species_parameter
,
suitability
,
N
,
K
);
...
...
@@ -146,18 +134,15 @@ sigmoid(const struct cats_vital_rate *rate_info,
assert
(
K
>=
0
);
switch
(
rate_info
->
density
)
{
case
DENSITY_DEP_NEGATIVE
:
assert
(
K
>=
0
);
assert
(
N
>=
0
);
if
(
K
==
0
)
return
0
.
0
;
rate
=
min_rates
(
rate
,
rate
*
density
+
((
N
/
K
)
*
rate_at_OT
));
// was: max_rate * scale;
rate
=
min_rates
(
rate
,
rate
*
density
+
((
N
/
K
)
*
rate_at_OT
));
break
;
case
DENSITY_DEP_POSITIVE
:
if
(
K
==
0
)
return
0
.
0
;
rate
=
rate
*
density
+
(
1
.
0
-
(
N
/
K
))
*
rate_at_OT
;
// was: max_rate * scale
;
rate
=
max_rates
(
rate
,
rate
*
density
+
(
1
.
0
-
(
N
/
K
))
*
rate_at_OT
)
;
break
;
case
NO_DENSITY_DEP
:
break
;
...
...
@@ -217,8 +202,5 @@ cats_dt_rates linear_rate(const struct cats_vital_rate *rate_info,
rate
=
min_rates
(
rate
,
rate
*
density
+
((
N
/
K
)
*
rate_at_OT
));
// was: max_rate * scale;
return
rate
;
}
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