JuliaDynamics / Agents.jl

Agent-based modeling framework in Julia
https://juliadynamics.github.io/Agents.jl/stable/
MIT License
725 stars 117 forks source link

execute `run!()` or `paramscan()` multiple times using the same parameters #892

Closed yunhwankim2 closed 11 months ago

yunhwankim2 commented 11 months ago

In many cases, experiments using ABM are executed multiple times using the same parameters and results of their averages and/or confidence intervals are usually reported. Thus, I would like to request a functionality in run!() and paramscan() functions to execute multiple times using the same parameters and record all the data. Many thanks in advance.

Tortar commented 11 months ago

This is a very useful feature! (not sure if it already possible in some way though)

Datseris commented 11 months ago

Yes, it is possible, using paramscan, and making the varied parameter the RNG seed. It is also mentioned in the docstring of paramscan:

image

simply don't change any other parameter besides the seed.

To report confidence intervals this is a standard processing of the resulting data frame and the quantile function.

yunhwankim2 commented 11 months ago

Thank you for the reply. I tried to find the docstring, and it was found in the ensemblerun! (https://juliadynamics.github.io/Agents.jl/stable/api/#Agents.ensemblerun!) rather than paramscan. Is it ensemblerun! that you intended to refer to?

Datseris commented 11 months ago

It doesn't matter. Either can work for you. Either can run many simulations changing parameters. Just make the seed the changing parameter.

yunhwankim2 commented 11 months ago

Okay. I see. Thank you so much.