Skip to content

Commit 60117e3

Browse files
author
Kevin Cazelles
committed
📝 minor edits in the doc
1 parent 49de9f7 commit 60117e3

4 files changed

Lines changed: 18 additions & 13 deletions

File tree

src/basic_omnivory_module.jl

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ using LinearAlgebra: eigvals
33
using ForwardDiff
44
using QuadGK: quadgk
55

6-
# # Omnivory preference functions
6+
# Omnivory preference functions
77
function adapt_pref(u, p, t)
88
return p.ω * u[1] / (p.ω * u[1] + (1 - p.ω) * u[2])
99
end
@@ -16,7 +16,7 @@ end
1616
@with_kw mutable struct ModelPar
1717
# Logistic Parameters
1818
r = 2.0
19-
## `K_base` measures the underyling K outside of any forcing applied
19+
# `K_base` measures the underyling K outside of any forcing applied
2020
K_base = 3
2121
K = 3
2222
# Consumer Parameters
@@ -33,10 +33,13 @@ end
3333
a_RP = 0.2
3434
h_RP = 0.6
3535
e_RP = 0.4
36+
# if Ω = 0 then we have a food chain
3637
Ω = 0.1
3738
# Forcing Function
39+
# 'fixed_pref' for passive omnivory
40+
# 'adapt_pref' for active omnivory
3841
pref::Function = fixed_pref
39-
## Used in the adaptive forcing to bias towards C or R
42+
# Used in the adaptive forcing to bias towards C or R
4043
ω = 0.5
4144
end
4245

src/pipeline.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ printstyled("Done! fig_pulse.jl created\n", color = :green)
1818

1919
# Supplementary Information
2020

21-
# The line below is used to run the SI version of the figure: when the 1st
22-
# argument of 'ARGS' is true, then the parameters used are the one for the SI
23-
# figure. Note that we actually use `ARGS` because this is specifically
21+
# The line below is used to run the SI version of the figures: when the 1st
22+
# argument of 'ARGS' is true, then the model parameters used are the ones for
23+
# the SI figure. Note that we actually use `ARGS` because this is specifically
2424
# the vector that captures external arguments. Thus using it allows us to use
2525
# arguments in the command line. So here, to run the SI version of fig_pulse,
2626
# I'd use `julia fig_pulse.jl true`. To mimic this we simply add "true" to

src/press.jl

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using DifferentialEquations, NLsolve
22

3-
# Full analysis for one press simulation (1 system)
3+
# Entire analysis for one press simulation (1 system)
44
function press_unit(par, p_strength)
55
# Parameters
66
u0 = [1.0, 1.5, 1.5]
@@ -28,8 +28,9 @@ function press_unit(par, p_strength)
2828
if par.pref == adapt_pref
2929
# compute ω
3030
# NB: This may often increases computation time as we may compute
31-
# results for 'fixed' twice but the code is much easier to read.
32-
# Here the time is not a major concern as it takes few minutes to run.
31+
# results for passive omnivory twice but the code is much easier to
32+
# read. Here the time is not a major concern as it takes few minutes to
33+
# run.
3334
par_fix = deepcopy(par)
3435
par_fix.pref = fixed_pref
3536
prob_fix = ODEProblem(model!, u0, t_span, deepcopy(par_fix),
@@ -90,7 +91,7 @@ function press_unit(par, p_strength)
9091
end
9192

9293
# Perform the pulse for the 3 systems:
93-
# - Food chain: "chain";C OP (fixed)
94+
# - Food chain: "chain";
9495
# - Passive omnivory: "passive";
9596
# - Active omnivory: "active";
9697
function press(base_par, Ω, p_strength)

src/pulse.jl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,11 @@ function pulse_unit(par, p_length, p_strength)
3131

3232
# run
3333
if par.pref == adapt_pref
34-
# compute w
34+
# compute ω
3535
# NB: This may often increases computation time as we may compute
36-
# results for 'fixed' twice but the code is much easier to read.
37-
# Here the time is not a major concern as it takes few minutes to run.
36+
# results for passive omnivory twice but the code is much easier to
37+
# read. Here the time is not a major concern as it takes few minutes to
38+
# run.
3839
par_fix = deepcopy(par)
3940
par_fix.pref = fixed_pref
4041
prob_fix = ODEProblem(model!, u0, t_span, deepcopy(par_fix),

0 commit comments

Comments
 (0)