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 Zo...
Search
Christophe Philemotte
October 26, 2015
Programming
0
200
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
320
Paris.rb 2018: How to onboard junior Developers?
toch
0
350
Enterprise learning can be fun - ConFoo Montréal 2017
toch
0
310
Build a Web API with Hanami (ConFoo Montreal 2017)
toch
1
430
Build a Web API with Hanami
toch
0
5.7k
Build a Cross-Platform Web API CLI in 15 minutes with Mruby-CLI
toch
0
510
Ruby Kaigi 2015: Prepare yourself against Zombie epidemic
toch
0
270
RubyDay 2015: Deep Diving: How to Explore a New Code Base
toch
0
390
RockyMountain 2015: Prepare yourself against Zombie epidemic
toch
0
210
Other Decks in Programming
See All in Programming
gen_statem - OTP's Unsung Hero
whatyouhide
1
200
Being an ethical software engineer
xgouchet
PRO
0
210
Bedrock×MCPで社内ブログ執筆文化を育てたい!
har1101
6
940
Ruby's Line Breaks
yui_knk
2
520
海外のアプリで見かけたかっこいいTransitionを真似てみる
shogotakasaki
1
160
これだけは知っておきたいクラス設計の基礎知識 version 2
masuda220
PRO
24
6.2k
Qiita Bash
mercury_dev0517
1
190
SQL Server ベクトル検索
odashinsuke
0
170
ミリしらMCP勉強会
watany
4
740
AIコーディングワークフローの試行 〜AIエージェント×ワークフローでの自動化を目指して〜
rkaga
2
3.5k
小田原でみんなで一句詠みたいな #phpcon_odawara
stefafafan
0
320
技術選定を未来に繋いで活用していく
sakito
3
110
Featured
See All Featured
Typedesign – Prime Four
hannesfritz
41
2.6k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.4k
Reflections from 52 weeks, 52 projects
jeffersonlam
349
20k
The Invisible Side of Design
smashingmag
299
50k
Gamification - CAS2011
davidbonilla
81
5.2k
Done Done
chrislema
183
16k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
160
15k
Building a Modern Day E-commerce SEO Strategy
aleyda
40
7.2k
Producing Creativity
orderedlist
PRO
344
40k
GraphQLとの向き合い方2022年版
quramy
46
14k
Making the Leap to Tech Lead
cromwellryan
133
9.2k
Optimizing for Happiness
mojombo
377
70k
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