15
gamar: an R interface to the GAMA agent-based simulation platform Marc Choisy Lucie Contamin Ho Bich Hai Nicolas Marilleau Jean-Daniel Zucker

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

  • Upload
    others

  • View
    0

  • Download
    0

Embed Size (px)

Citation preview

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

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

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

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

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

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

• 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

• 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

.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

.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

.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

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

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

Visualizing simulation resultswith(sir$output[[1]], plot(Step, r_I, ylab = "nb. infected")

path_to_movie <- make_movie(pp$output[[1]], "r_main_display")

Page 14: 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://r-and-gama.github.io/gamar

Page 15: 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://r-and-gama.github.io/gamar