You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A population object should recursively consist of:
a list S of population objects
a list V of variables
a list P of parameters
a list E of expressions (equations) describing interactions among variables V in terms of parameters P.
The most basic population object consists of:
S = [self]
V = [self.variable]
P = []
E = []
A population object should provide functionality to assign parameters and expressions to self. Convenience functions should be provided to implement common functionality.
The text was updated successfully, but these errors were encountered:
GJHSimmons
changed the title
[FEATURE] Modular population structure
Modular population structure
Oct 20, 2023
Population objects have been implemented as described, along with some convenience functions.
For example, the function add_growth_rate(r) creates a parameter growth_rate with value r, and an expression corresponding to the ODE dx/dt = rx. It assigns these to the lists P and E, respectively.
Another convenience function is link_populations. At base, given two populations Pop_1 and Pop_2 with variables x and y, Pop_1 is assigned a parameter flow with value k, and an expression corresponding to the ODE dx/dt = -kx. Pop_2 is also assigned the flow parameter with value k, and an expression corresponding to the ODE dy/dt = kx. The function link_populations takes a subset T of S and a list R of rates, and sequentially links the populations in T with the rates in R according to the above process.
When a population object Pop_1 is added to another population object Pop_2, the lists V,P,E of Pop_2 are updated with the lists V,P,E of Pop_1. Therefore both Pop_1 and Pop_2 describe the full behaviour of Pop_1, however, Pop_2 can obtain additional information, such as interactions of elements of Pop_1 with elements of Pop_2 \ Pop_1.
Description
A population object should recursively consist of:
The most basic population object consists of:
A population object should provide functionality to assign parameters and expressions to self. Convenience functions should be provided to implement common functionality.
The text was updated successfully, but these errors were encountered: