Implementing the Social Force Model from Helbing 1995

Hello,

Regarding the approach of @goerch : This is something I have considered a lot in Agents.jl: whether having agents as immutable types was worth it or not. https://github.com/JuliaDynamics/Agents.jl/issues/421 . The conclusion was that even though there were some measurable performance benefits, the huge downsides in convenience and intuitive rationalizing about code were simply too much to consider it useful in practice.

@jacobusmmsmit for your original question. First of all, I wasn’t even aware that DifferentialEquations.jl can work with vectors of arbitrary types. I think you would still need to define addition between vectors of agents, etc. Are you sure this “works”, or is it as easy as you think?

More importantly now. For your social force model, what you need to consider is the importance of accuracy. Is an Euler stepping approach accurate enough? Then you can go ahead with Agents.jl. If you need better accuracy for time evolution, you can consider DifferentialEquations.jl. No matter the level of accuracy, DiffEq will of course be always faster than Agents.jl. Things you should consider having a look at:

1 Like