diff --git a/use_cases/tritrophic-biomass-vs-temperature.jl b/use_cases/tritrophic-biomass-vs-temperature.jl index 251af6780..c091304ce 100644 --- a/use_cases/tritrophic-biomass-vs-temperature.jl +++ b/use_cases/tritrophic-biomass-vs-temperature.jl @@ -3,7 +3,6 @@ import ColorSchemes: tol_light using CairoMakie using DataFrames using EcologicalNetworksDynamics -import EcologicalNetworksDynamics: ExtinctionCallback # Temperature gradient from 0 to 40°C, converted to Kelvin, with increments of 1°. T0 = 273.15 # 0°C in Kelvin. @@ -14,7 +13,6 @@ df = DataFrame(; T = Float64[], trophic_level = Int64[], Beq = Float64[]) tmax = 315_360_000_000 # From Binzer et al., 2012. verbose = false # Do not show '@info' messages during simulation run. trophic_lvl = [1, 2, 3] -callback_function(m) = ExtinctionCallback(1e-12, m._value, verbose) # Run simulations for each temperature across gradient. @info "Start simulations..." @@ -22,7 +20,7 @@ for T in T_values m = default_model(Foodweb([3 => 2, 2 => 1]), Temperature(T)) m.h = 1 # Set hill exponent to 1. B0 = m.K[1] / 8 # Inital biomass. - callback = callback_function(m) + callback = extinction_callback(m, 1e-12) solution = simulate(m, B0; tmax, callback) Beq_vec = solution[end] for (Beq, tlvl) in zip(Beq_vec, trophic_lvl)