FLAMEGPU / FLAMEGPU2

FLAME GPU 2 is a GPU accelerated agent based modelling framework for CUDA C++ and Python
https://flamegpu.com
MIT License
99 stars 19 forks source link

Multiple Time Scales #533

Open mondus opened 3 years ago

mondus commented 3 years ago

It would be nice to consider core support for simulations occurring at different timescales. Currently time is not a concept in FLAMEGPU on simulation ticks. To complement this we would need to allow certain agents/functions to operate at different granularities and then step() would simply iterate the smallest timescale unit within the model. E.g. Within a biological model we may have an example similar to that within Physicell;

  1. Environment agent - updates a PDE type model every 0.1s
  2. A cell agent mechanical model- updates every 1s
  3. Cell cycle model - updates every 10-100s
Robadob commented 3 years ago

This is probably already feasible with submodels.

for cell_cycle: // 10s interval
    do_cell_cycle();
    for mechanical_model/10: //10x per outer loop
        do_mechanical_model();
        for environment_agent/10: //100x per outer loop
            do_environment();

Less clear how we would handle cell-cycle having a variable frequency, if the other layers needed to be continue at a consistent rate, perhaps blocking do_cell_cycle() with some kind of condition, probably more depends on how the variability there actually works.