Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
KeepRubyWeird 2015: Prepare yourself against Zombie epidemic
Search
Christophe Philemotte
October 26, 2015
Programming
0
130
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
230
Paris.rb 2018: How to onboard junior Developers?
toch
0
270
Enterprise learning can be fun - ConFoo Montréal 2017
toch
0
230
Build a Web API with Hanami (ConFoo Montreal 2017)
toch
1
370
Build a Web API with Hanami
toch
0
5.4k
Build a Cross-Platform Web API CLI in 15 minutes with Mruby-CLI
toch
0
380
Ruby Kaigi 2015: Prepare yourself against Zombie epidemic
toch
0
180
RubyDay 2015: Deep Diving: How to Explore a New Code Base
toch
0
210
RockyMountain 2015: Prepare yourself against Zombie epidemic
toch
0
140
Other Decks in Programming
See All in Programming
Behind VS Code Extensions for JavaScript / TypeScript Linnting and Formatting
unvalley
5
920
Ruby GitHub Packages
bkuhlmann
0
630
Blue/Greenデプロイの導入による 運用フローの改善
kudoas
1
380
try!Swift Tokyo 2024 参加報告 LT
akidon0000
1
220
MicrosoftのPlatform Engineeringガイドを読んで実際になにかやってみた
ymd65536
1
340
障害対応を起点としたもっといい開発と運用のサイクル作りのためにできること / Hatena Enginner Seminar #29
polamjag
0
180
Git Rebase
bkuhlmann
11
1.6k
効率化に挑戦してみたらモバイル開発が少し快適になった話
ryunakayama
0
130
Tailwind CSSを本気でカスタマイズする方法
fsubal
13
5.3k
Let's learn code review
riofujimon
2
410
Elm Form Validation
bkuhlmann
0
510
dbtのドメイン分割による データ基盤の改善とDigdagとの連携
sakama
0
350
Featured
See All Featured
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
125
32k
Fantastic passwords and where to find them - at NoRuKo
philnash
37
2.5k
How GitHub (no longer) Works
holman
304
140k
RailsConf 2023
tenderlove
4
540
No one is an island. Learnings from fostering a developers community.
thoeni
16
2.1k
Thoughts on Productivity
jonyablonski
58
3.8k
Put a Button on it: Removing Barriers to Going Fast.
kastner
58
3.1k
Rails Girls Zürich Keynote
gr2m
91
13k
How GitHub Uses GitHub to Build GitHub
holman
468
290k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
25
2.3k
The Invisible Customer
myddelton
114
12k
Design by the Numbers
sachag
274
18k
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