BecksLab / EcologicalNetworksDynamics.jl

A simulator for ecological dynamics written in Julia.
GNU Affero General Public License v3.0
18 stars 3 forks source link

Refactor model API in terms of "Components". #131

Closed iago-lito closed 7 months ago

iago-lito commented 1 year ago

This is a big shot attempting to address #114, #122, #84, #73, #74, #54 and #126 at once, while not refactoring the package internals yet so we can settle on a stable API and release the library/paper sooner.

I expect this is a good opportunity to design/stabilize the eventual API we want without bothering yet with any refactoring of the Internals. To push this PR forward, just focus on how we would like the package to be used :)

Example fresh, configurable basic pipeline with the "components" approach:

m = Model()
m += Foodweb([:a => :b, :b => :c])
m += BodyMass(1)
m += MetabolicClass(:all_invertebrates)
m += BioenergeticResponse(; w = :homogeneous, half_saturation_density = 0.5)
m += LogisticGrowth(; r = 1, K = 1)
m += Metabolism(:Miele2019)
m += Mortality(0)
B0 = 0.5
sol = simulate(m, B0)

other examples here