MRC-CSO-SPHSU / UKSEABMLib.jl

MIT License
1 stars 1 forks source link

time should belong to model datastructure #66

Closed AtiyahElsheikh closed 1 year ago

AtiyahElsheikh commented 1 year ago

The data fields of a model (e.g. population, houses, etc.) correspond to an actual time-dependent state which changes as the simulation progresses. However, time is not an explicit data field of the model. It is externally controlled.

It makes sense to introduce time to the model with an accessory function like:

currtime(model)

This would further simplifies the API of simulation functions from

dox!(model) # instead of dox!(model,time,...)

or

x!(person, model) # instead of x!(person,time,model)

This step makes simulation functions directly adoptable by Agents.jl API requirement for agent-based and model-based transition functions. So in this way, a largely trusted agent-based modelling framework is followed.

On the other side, common dynamic models, e.g. ODEs, are evaluated through a function with time given as an argument. It is still quite thinkable to leave things as it is.