MRC-CSO-SPHSU / LoneParentsModel.jl

An initial implementation of an ABM for social and child care
0 stars 4 forks source link

generic transition interface #87

Closed mhinsch closed 2 years ago

mhinsch commented 2 years ago

All population-wide transitions essentially do the same, so it makes sense to unify their interface. I have implemented that here (in Main.jl, Utilities.jl and socialTransition.jl): A function applyTransitions (for now in Utilities.jl, should maybe be in some sort of Population module) applies a transition function (which operates on Person) and the usual parameters (model, verbose, parameters, etc.) to all elements of an iterable. The specific simulation module (in this case for example socialTransition) also provides a predicate (here selectSocialTransition) to select the agents the transition needs to be applied to.

mhinsch commented 2 years ago

Applied the same for age and work in the repo linked above.

AtiyahElsheikh commented 2 years ago

Looks good