Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up for free
KeepRubyWeird 2015: Prepare yourself against Zombie epidemic
Christophe Philemotte
October 26, 2015
Programming
0
61
KeepRubyWeird 2015: Prepare yourself against Zombie epidemic
Christophe Philemotte
October 26, 2015
Tweet
Share
More Decks by Christophe Philemotte
See All by Christophe Philemotte
SF Kafka Summit 2019: Cross the Streams Thanks to Kafka and Flink
toch
0
94
Paris.rb 2018: How to onboard junior Developers?
toch
0
190
Enterprise learning can be fun - ConFoo Montréal 2017
toch
0
91
Build a Web API with Hanami (ConFoo Montreal 2017)
toch
1
240
Build a Web API with Hanami
toch
0
4.8k
Build a Cross-Platform Web API CLI in 15 minutes with Mruby-CLI
toch
0
290
Ruby Kaigi 2015: Prepare yourself against Zombie epidemic
toch
0
99
RubyDay 2015: Deep Diving: How to Explore a New Code Base
toch
0
120
RockyMountain 2015: Prepare yourself against Zombie epidemic
toch
0
69
Other Decks in Programming
See All in Programming
近況PHP / PHP in now a days
uzulla
4
1.7k
microCMS × imgixを活用して品質とレスポンスを両立したポートフォリオサイトを作成した話
takehitogoto
0
410
Blazor WebAssembly – Dynamische Formulare und Inhalte in Aktion
patrickjahr
0
160
Kotlin 最新動向2022 #tfcon #techfeed
ntaro
1
1k
ゴーファーくんと学ぶGo言語の世界/golang-world-with-gopher
iwasiman
1
150
CIでAndroidUIテストの様子を録画してみた
mkeeda
0
170
C言語でメモリ管理を考えた話
hkawai
0
190
mrubyを1300円のボードで動かそう
yuuu
0
180
Microsoft Teams の 会議アプリ開発のはじめかた / How to start Microsoft Teams app development
karamem0
0
1.6k
【Qiita Night】新卒エンジニアによるSwift6与太予想
eiji127
0
180
Node.js 最新動向 TFCon 2022
yosuke_furukawa
PRO
6
2.8k
iOSアプリの技術選択2022
tattn
6
2.4k
Featured
See All Featured
Docker and Python
trallard
27
1.5k
Writing Fast Ruby
sferik
612
57k
Fontdeck: Realign not Redesign
paulrobertlloyd
73
4.1k
A Philosophy of Restraint
colly
192
14k
Statistics for Hackers
jakevdp
781
210k
In The Pink: A Labor of Love
frogandcode
130
21k
WebSockets: Embracing the real-time Web
robhawkes
57
5k
Scaling GitHub
holman
451
140k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
37
3.2k
YesSQL, Process and Tooling at Scale
rocio
157
12k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
3
430
The Invisible Customer
myddelton
110
11k
Transcript
Benjamin Lehman, ©2011
Benjamin Lehman, ©2011 Prepare yourself against Zombie epidemic
Agent Based Model
None
None
None
None
None
Agent Based Model
Map National Geographics, ©2011
map = Map.new(4, 4)
point = Point.new point_north = Point.new point.neighborhood[:north] = point_north point_north.neighborhood[:south]
= point # ...
John DellAngelo, ©2013 Agent
agent = Agent.new(age, start_point, stm)
agent.perceive # => {}
agent.act # => :walk agent.walk(:east)
None
agent.age # => 1
agent.commit # => #<ZombieEpidemic::State:... # @name=:susceptible, ...
State
state = State.new(:susceptible) state.define_possible_actions( ->(agent) { [:walk, :stay, :fight].sample }
)
state.decide_action_for(agent) # => :walk
infected = State.new(:susceptible) state.add_transition( infected, ->(state, agent) { true }
)
state.trigger_transition(agent) # => #<ZombieEpidemic::State:... # @name=:infected, ...
None
State Transition Machine
stm = StateTransitionMachine.new # create states: # - susceptible #
- infected # - zombie # - dead # create transitions # set default initial state
Simulation Loop
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
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
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
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
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
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
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
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
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
None
None
Validation & Calibration
# validation # == # functional test
None
None
# Calibration # f(x, y, z, ?) = a
Simulate & Prepare yourself
Live Demo
None
Outro
? toch _toch toch/zombie_epidemic