Upgrade to Pro — share decks privately, control downloads, hide ads and more …

RockyMountain 2015: Prepare yourself against Zo...

RockyMountain 2015: Prepare yourself against Zombie epidemic

The news is everywhere: some weird disease makes the dead walking. We do not know yet if it is highly contagious. What should we do? What we do everyday: writing code. We can develop an agent based model, simulate the disease, and hopefully find the best strategy to survive. We can code, we'll be prepared ... or not.

code: https://github.com/toch/zombie_epidemic

Christophe Philemotte

September 24, 2015
Tweet

More Decks by Christophe Philemotte

Other Decks in Programming

Transcript

  1. stm = StateTransitionMachine.new # create states: # - susceptible #

    - infected # - zombie # - dead # create transitions # set default initial state
  2. steps = 100 agents = create_the_agents steps.times do agents.each do

    |agent| agent.act; agent.age end agents.each { |agent| agent.commit } remove_the_deads(agents) end
  3. steps = 100 agents = create_the_agents steps.times do agents.each do

    |agent| agent.act; agent.age end agents.each { |agent| agent.commit } remove_the_deads(agents) end
  4. steps = 100 agents = create_the_agents steps.times do agents.each do

    |agent| agent.act; agent.age end agents.each { |agent| agent.commit } remove_the_deads(agents) end
  5. steps = 100 agents = create_the_agents steps.times do agents.each do

    |agent| agent.act; agent.age end agents.each { |agent| agent.commit } remove_the_deads(agents) end
  6. steps = 100 agents = create_the_agents steps.times do agents.each do

    |agent| agent.act; agent.age end agents.each { |agent| agent.commit } remove_the_deads(agents) end
  7. steps = 100 agents = create_the_agents steps.times do agents.each do

    |agent| agent.act; agent.age end agents.each { |agent| agent.commit } remove_the_deads(agents) end
  8. steps = 100 agents = create_the_agents steps.times do agents.each do

    |agent| agent.act; agent.age end agents.each { |agent| agent.commit } remove_the_deads(agents) end
  9. steps = 100 agents = create_the_agents steps.times do agents.each do

    |agent| agent.act; agent.age end agents.each { |agent| agent.commit } remove_the_deads(agents) end
  10. steps = 100 agents = create_the_agents steps.times do agents.each do

    |agent| agent.act; agent.age end agents.each { |agent| agent.commit } remove_the_deads(agents) end
  11. # validation == integration test # # check: # -

    obvious case # - against theoretical model # - against real data
  12. # not everything known # so calibration: # # varying

    a few parameters # to get what you want