;; Allometry functions
;; Maximum speed from boday mass (see Hirt et al. 2017 in Nature Ecol Evol)
;; Equations from SM Table 4 in Hirt et al. 2017 in Nature Ecol Evol (mass in kg, speed in km/h)
to-report get-max-speed [M mvt-mode]
let max-spd 0
if (mvt-mode = "flying") [ set max-spd (142.8 * M ^ 0.24) * (1 - exp(-2.4 * M ^ -0.72)) ]
if (mvt-mode = "running") [ set max-spd (25.5 * M ^ 0.26) * (1 - exp(-22 * M ^ -0.6)) ]
if (mvt-mode = "swimming") [ set max-spd (11.2 * M ^ 0.36) * (1 - exp(-19.5 * M ^ -0.56)) ]
report max-spd
end
; typical movement speed for flying birds from Rayner 1979
to-report get-mean-speed [M mvt-mode]
; returns a list with U_min and U_max (hovering vs. straight line flight)
let mean-spd []
if (mvt-mode = "flying")
[
set mean-spd lput precision (5.7 * M ^ 0.16) 3 mean-spd ;; min
set mean-spd lput precision (10.89 * M ^ 0.19) 3 mean-spd ;; max
] ;; in kg
report mean-spd
end
;; Allometric seed retention times from Yoshikawa et al. 2019 in Oikos
;; Equations from Table 1 (OLS for bird/mammal/fish/reptile; PGLS for bird/mammal; diet for birds (frug vs. herb)
;; Mass in g
to-report get-srt [M taxa model diet]
let srt 0
if taxa = "reptile"
[
set srt 3.429 + 0.181 * log M 10
]
if taxa = "bird"
[
ifelse (diet = "frugivore" or diet = "herbivore" or diet = "carnivore")
[
if model = "OLS"
[
if diet = "carnivore" [set srt 0.900 + (0.458 * log M 10)]
if diet = "frugivore" [set srt 0.900 + (0.458 * log M 10) - 0.201] ;; offset at end is for diet
if diet = "herbivore" [set srt 0.900 + (0.458 * log M 10) + 0.49]
]
if model = "PGLS"
[
if diet = "carnivore" [set srt 0.937 + (0.45 * log M 10)]
if diet = "frugivore" [set srt 0.937 + (0.45 * log M 10) - 0.204 ]
if diet = "herbivore" [set srt 0.937 + (0.45 * log M 10) + 0.467 ]
]
]
[
if model = "PGLS" [set srt 1.125 + 0.394 * log M 10 ]
if model = "OLS" [set srt 0.631 + 0.561 * log M 10 ]
]
]
report srt ;; in log10 minutes
end
;; Allometric equations for home range from body-mass: Tamburello et al. 2015 Am Nat
;; mass in g and home-range in log10 m2
to-report get-home-range [M taxa mvt-mode diet]
let hr 0
if taxa = "reptile"
[
set hr 3.429 + 0.181 * log M 10
]
if taxa = "bird"
[
ifelse mvt-mode = "flying" ;; 3D in Tamburello
[
ifelse diet = "carnivore" ;;l assume herbivore unless explicitly stated
[set hr 2.79702 + (1.50145 * log M 10)]
[set hr 1.6271 + (1.7722 * log M 10)]
]
[ ;; flightless (2D) -> T et al. only present a relationship for herbivorous guild
; if diet = "herbivore" [set hr 2.3119 + (1.1323 * log M 10)]
set hr 2.3119 + (1.1323 * log M 10)
]
]
report hr ;; in log 10 m2
end
;; Expect distance travelled per *day* in m based on *mammals* (see Carbone et al. 2005)
;; Buchmann et al. 2012 multiply this by ten!
to-report get-mammal-dmd [M]
let dmd (10 ^ (-0.092 + 0.30 * log M 10))
report dmd
end
to-report get-bird-dmd [M mvt-mode] ;; M in g
let dmd 0
ifelse mvt-mode = "running"
[
set dmd (10 ^ (1.2693 + 0.5017 * log M 10))
]
[
set dmd (10 ^ (2.642 + 0.446 * log M 10))
]
report dmd
end
to-report get-step-length [m v max-spd distribution]
let sl 0
if distribution = "beta"
[
;; generate a beta distribution with specified mean and variance and apply that to the max. speed
let beta-p get-beta-params m v
let a item 0 beta-p
let b item 1 beta-p
set sl (random-beta a b) * max-spd
]
if distribution = "normal" or distribution = "gaussian"
[
;; generate a Normal distribution with specified mean and variance and apply that to the max. speed
let n -1
while [n < 0] [set n random-normal m (v ^ 2)]
set sl n * max-spd
]
report sl
end
; return list with mean and max dispersal dist as predicted by tsoar et al chapter.
to-report tsoar-allom [M mvt-mode]
let tsoar-pred[]
ifelse mvt-mode = "flying"
[
set tsoar-pred lput (627 * M ^ 0.49) tsoar-pred
set tsoar-pred lput (5687.3 * M ^ 0.62) tsoar-pred
]
[
set tsoar-pred lput (174 * M ^ 0.25) tsoar-pred
set tsoar-pred lput (619.6 * M ^ 0.28) tsoar-pred
]
report tsoar-pred
end