MRC-CSO-SPHSU / LoneParentsModel.jl

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

get rid of population.properties #15

Closed mhinsch closed 2 years ago

mhinsch commented 2 years ago

Having a universal type ABM sounds attractive, but I think in practice there is little it can buy. On the other hand the same efficiency argument applies as with parameters. As with parameters using dot syntax to access global simulation properties within the simulation code doesn't hurt but has the potential to allow for a much more efficient implementation.

AtiyahElsheikh commented 2 years ago

Yes indeed, at the moment it looks unnecessary.

Here is a use-case that I had in my mind when I thought about it (still not realized).

At the moment there is a classification:

At the moment (V0.1) both structures have different fields and therefore they are distinguished. But it is thinkable to merge these structure together to allow a kind of recursive compositions, e.g. a MABM is itself an ABM. This would allow e.g. an MABM to be composed out of various MABMs and ABMs. It is also even thinkable to have only one single type of ABM, that it-self contains a list of ABMs. I feel that this would be more restrictive (may be reducible with some hacks) but still thinkable. The translation is not in an advanced phase to figure out the most relevant way to do it.

At the moment it is possible to get rid of the abstract type. But sooner or later such ideas will start to be appealing?

AtiyahElsheikh commented 2 years ago

p.s.: You may want to directly insert / discuss issues in MultiAgents.jl

mhinsch commented 2 years ago

I think it's perfectly sensible to have ABM and ABM.properties in the context of the MultiAgents package. But for the core simulation it's unnecessary (see issue #19).

AtiyahElsheikh commented 2 years ago

Closing unless there is still a related issue?

mhinsch commented 2 years ago

Reopening this since whatever the reasons for abstract and/or general simulation types I still don't see why global model variables (such as the current time step) need to be stored in a Dict. If ABM et al need to be generic they can easily take a type parameter for a structure that contains population properties.

AtiyahElsheikh commented 2 years ago

Proposal: Population.jl to be an MA-dependent module. There is not actually too much to do. The few included functionalities exist in the repository, e.g. agestep! within person.jl

AtiyahElsheikh commented 2 years ago

ABM within MultiAgents.jl has parameters field. Field properties is kept for conformance issues with MultiAgents.jl.