![Page 1: gamar: an R interface to the GAMA agent-based simulation ...gamar: an R interface to the GAMA agent-based simulation platform Marc Choisy Lucie Contamin Ho Bich Hai Nicolas Marilleau](https://reader034.vdocument.in/reader034/viewer/2022051822/5fec024b5aa70b306a47e2fc/html5/thumbnails/1.jpg)
gamar: an R interface to the GAMA agent-based simulation platform
Marc ChoisyLucie ContaminHo Bich HaiNicolas MarilleauJean-Daniel Zucker
![Page 2: gamar: an R interface to the GAMA agent-based simulation ...gamar: an R interface to the GAMA agent-based simulation platform Marc Choisy Lucie Contamin Ho Bich Hai Nicolas Marilleau](https://reader034.vdocument.in/reader034/viewer/2022051822/5fec024b5aa70b306a47e2fc/html5/thumbnails/2.jpg)
population-based individual-based agent-baseddifferential equations Gillespie algorithms
Increased level of detail
deSolve
adaptivetauGillespieSSAdde
diffeqrPBSddesolve
bvpSolve
Agents are• autonomous • heterogeneous • active • adaptive
Population dynamics modeling
![Page 3: gamar: an R interface to the GAMA agent-based simulation ...gamar: an R interface to the GAMA agent-based simulation platform Marc Choisy Lucie Contamin Ho Bich Hai Nicolas Marilleau](https://reader034.vdocument.in/reader034/viewer/2022051822/5fec024b5aa70b306a47e2fc/html5/thumbnails/3.jpg)
population-based individual-based agent-baseddifferential equations Gillespie algorithms
Increased level of detail
deSolve
adaptivetauGillespieSSAdde
diffeqrPBSddesolve
bvpSolve
Agents are• autonomous • heterogeneous • active • adaptive
Population dynamics modeling
![Page 4: gamar: an R interface to the GAMA agent-based simulation ...gamar: an R interface to the GAMA agent-based simulation platform Marc Choisy Lucie Contamin Ho Bich Hai Nicolas Marilleau](https://reader034.vdocument.in/reader034/viewer/2022051822/5fec024b5aa70b306a47e2fc/html5/thumbnails/4.jpg)
RNetLogorrepastNetLogoR
NetLogo
Performance
Ease of use
GAMA
repast.github.io ccl.northwestern.edu/netlogo gama-platform.github.io
since 2007since 1999 since 2000
Agent-based modeling platforms
![Page 5: gamar: an R interface to the GAMA agent-based simulation ...gamar: an R interface to the GAMA agent-based simulation platform Marc Choisy Lucie Contamin Ho Bich Hai Nicolas Marilleau](https://reader034.vdocument.in/reader034/viewer/2022051822/5fec024b5aa70b306a47e2fc/html5/thumbnails/5.jpg)
RNetLogorrepastNetLogoR
NetLogo
Performance
Ease of use
GAMA
repast.github.io ccl.northwestern.edu/netlogo gama-platform.github.io
since 2007since 1999 since 2000
Agent-based modeling platforms
![Page 6: gamar: an R interface to the GAMA agent-based simulation ...gamar: an R interface to the GAMA agent-based simulation platform Marc Choisy Lucie Contamin Ho Bich Hai Nicolas Marilleau](https://reader034.vdocument.in/reader034/viewer/2022051822/5fec024b5aa70b306a47e2fc/html5/thumbnails/6.jpg)
• a language: GAML
• a user-interface
• a fast and parallelized engine
• integration with GIS data
https://gama-platform.github.io
The GAMA simulation platform
![Page 7: gamar: an R interface to the GAMA agent-based simulation ...gamar: an R interface to the GAMA agent-based simulation platform Marc Choisy Lucie Contamin Ho Bich Hai Nicolas Marilleau](https://reader034.vdocument.in/reader034/viewer/2022051822/5fec024b5aa70b306a47e2fc/html5/thumbnails/7.jpg)
• a language: GAML
• a user-interface
• a fast and parallelized engine
• integration with GIS data
https://gama-platform.github.io
The GAMA simulation platform
![Page 8: gamar: an R interface to the GAMA agent-based simulation ...gamar: an R interface to the GAMA agent-based simulation platform Marc Choisy Lucie Contamin Ho Bich Hai Nicolas Marilleau](https://reader034.vdocument.in/reader034/viewer/2022051822/5fec024b5aa70b306a47e2fc/html5/thumbnails/8.jpg)
.gaml
model
outputs
1. design model
2. load
model
3. design experiment plans
5. analyse simulations
4. run experiment
experiment object
The gamar R package
run_experiment()load_experiment()
fullfact(), repl()
makemovie()
![Page 9: gamar: an R interface to the GAMA agent-based simulation ...gamar: an R interface to the GAMA agent-based simulation platform Marc Choisy Lucie Contamin Ho Bich Hai Nicolas Marilleau](https://reader034.vdocument.in/reader034/viewer/2022051822/5fec024b5aa70b306a47e2fc/html5/thumbnails/9.jpg)
.gaml
model
outputs
1. design model
2. load
model
3. design experiment plans
5. analyse simulations
4. run experiment
experiment object
The gamar R package
run_experiment()load_experiment()
fullfact(), repl()
makemovie()
![Page 10: gamar: an R interface to the GAMA agent-based simulation ...gamar: an R interface to the GAMA agent-based simulation platform Marc Choisy Lucie Contamin Ho Bich Hai Nicolas Marilleau](https://reader034.vdocument.in/reader034/viewer/2022051822/5fec024b5aa70b306a47e2fc/html5/thumbnails/10.jpg)
.gaml
model
outputs
1. design model
2. load
model
3. design experiment plans
5. analyse simulations
4. run experiment
experiment object
The gamar R package
run_experiment()load_experiment()
fullfact(), repl()
makemovie()
![Page 11: gamar: an R interface to the GAMA agent-based simulation ...gamar: an R interface to the GAMA agent-based simulation platform Marc Choisy Lucie Contamin Ho Bich Hai Nicolas Marilleau](https://reader034.vdocument.in/reader034/viewer/2022051822/5fec024b5aa70b306a47e2fc/html5/thumbnails/11.jpg)
several columns for parameters values - always first columns - names start with p_
several columns for monitored variables - just after the parameters columns - names start with r_
one column for simulations durations - always penultimate position - named tmax
one column for seeds values - always penultimate position - named seed
The experiment class
one list-column for simulations outputs - always last position - named output
/Users/gamar/models/sir/sir.gaml/Users/gamar/models/sir/output
outputNANANANANANA...
NANANANANANA
![Page 12: gamar: an R interface to the GAMA agent-based simulation ...gamar: an R interface to the GAMA agent-based simulation platform Marc Choisy Lucie Contamin Ho Bich Hai Nicolas Marilleau](https://reader034.vdocument.in/reader034/viewer/2022051822/5fec024b5aa70b306a47e2fc/html5/thumbnails/12.jpg)
output<data.frame[1000,3]><data.frame[1000,3]><data.frame[1000,3]><data.frame[1000,3]><data.frame[1000,3]><data.frame[1000,3]>
.
.
.<data.frame[1000,3]><data.frame[1000,3]><data.frame[1000,3]><data.frame[1000,3]><data.frame[1000,3]><data.frame[1000,3]>
several columns for parameters values - always first columns - names start with p_
several columns for monitored variables - just after the parameters columns - names start with r_
one column for simulations durations - always penultimate position - named tmax
one column for seeds values - always penultimate position - named seed
The experiment class
one list-column for simulations outputs - always last position - named output
/Users/gamar/models/sir/sir.gaml/Users/gamar/models/sir/output
![Page 13: gamar: an R interface to the GAMA agent-based simulation ...gamar: an R interface to the GAMA agent-based simulation platform Marc Choisy Lucie Contamin Ho Bich Hai Nicolas Marilleau](https://reader034.vdocument.in/reader034/viewer/2022051822/5fec024b5aa70b306a47e2fc/html5/thumbnails/13.jpg)
Visualizing simulation resultswith(sir$output[[1]], plot(Step, r_I, ylab = "nb. infected")
path_to_movie <- make_movie(pp$output[[1]], "r_main_display")