Giter Club home page Giter Club logo

Comments (3)

astaaudzi avatar astaaudzi commented on August 23, 2024

Great! Looking forward to it and it will provide a great framework to extend and adapt mizer to various needs. Will need to provide some examples on how to prepare an extension into a package :)

from mizer.

gustavdelius avatar gustavdelius commented on August 23, 2024

@astaaudzi , the first example I will provide is an extension implementing unstructured resources, i.e., I will take the code implementing those out of mizer again and put them into a separate package.

One bit of my proposal I already want to discuss with you now: I propose to supplement the @n and @n_pp slots by an @vars slot that shall be a list holding all the new dynamical variables that extensions may want to add to mizer.

Of course it would be most natural to also include n_pp in that list, so that the plankton resource would not play a special role compared to the other resource spectra that other extensions may want to introduce. And it would be even more elegant if also n was a member of that list. However then everyone would need to update their old scripts that may have accessed the @n slot directly to accessing @vars$n instead. Am I right that backwards compatibility is more important to us than elegance? Are we therefore happy to have slots @n, @n_pp and @vars?

from mizer.

gustavdelius avatar gustavdelius commented on August 23, 2024

Just an update: In pull request #141 I have added

  • a slot @n_other to hold the list of abundances of other dynamic ecosystem components,
  • a slot @other_dynamics to hold the list of functions to be called in side the project() loop to update the abundances of the other components,
  • a slot @other_params to hold the list of parameters for the other components,
  • a slot @other_encounter to hold the list of functions that calculate the contributions by the other components to the encounter rate,
  • a slot @other_pred_mort to hold the list of functions to calculate the contribution by the other components to the predation mortality rate. That will not be relevant for resources, but for example for unstructured consumers (mammals, sea birds).
  • a slot @rates_func to hold the function that calculates the rates needed by project().

The first 4 slots have allowed me to move my code for unstructured resource components into its own R package, see https://gustavdelius.github.io/mizerUR/. These slots will also allow @astaaudzi to put her code for multiple size-structured resources into an R package.

The slot @rates_func will be needed by @reumj for his size-dependent interaction matrix and by @pwoodworth-jefcoats and others for time-dependent temperature.

Over the weekend I intend to write a vignette explaining the current extension mechanism with examples.

from mizer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.