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
Flocking Simulation with Phoenix Channels
Search
Christian Bäuerlein
April 19, 2018
Programming
1
340
Flocking Simulation with Phoenix Channels
Code can be found here:
https://github.com/fabrik42/flocking_elixir
Christian Bäuerlein
April 19, 2018
Tweet
Share
More Decks by Christian Bäuerlein
See All by Christian Bäuerlein
Single File Ruby Programs @ RubyUnconf 2023
fabrik42
0
130
Single File Ruby Programs 2.0
fabrik42
1
190
Single File Ruby Programs
fabrik42
0
200
Agile Software Development for Software Developers
fabrik42
0
42
Phoenix Live View
fabrik42
0
510
Rails API-only considerations
fabrik42
0
320
Org-Mode
fabrik42
0
460
Cleaner, scalable views with object oriented components
fabrik42
0
330
Headless Browser Experiments
fabrik42
0
340
Other Decks in Programming
See All in Programming
14 Years of iOS: Lessons and Key Points
seyfoyun
1
770
命名をリントする
chiroruxx
1
380
103 Early Hints
sugi_0000
1
220
create_tableをしただけなのに〜囚われのuuid編〜
daisukeshinoku
0
240
Semantic Kernelのネイティブプラグインで知識拡張をしてみる
tomokusaba
0
180
rails statsで大解剖 🔍 “B/43流” のRailsの育て方を歴史とともに振り返ります
shoheimitani
2
930
良いユニットテストを書こう
mototakatsu
4
1.5k
선언형 UI에서의 상태관리
l2hyunwoo
0
130
RWC 2024 DICOM & ISO/IEC 2022
m_seki
0
200
The Efficiency Paradox and How to Save Yourself and the World
hollycummins
1
440
Recoilを剥がしている話
kirik
5
6.6k
42 best practices for Symfony, a decade later
tucksaun
1
180
Featured
See All Featured
GitHub's CSS Performance
jonrohan
1030
460k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
28
2.1k
The Cult of Friendly URLs
andyhume
78
6.1k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
6
510
Optimising Largest Contentful Paint
csswizardry
33
3k
Keith and Marios Guide to Fast Websites
keithpitt
410
22k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.3k
Done Done
chrislema
181
16k
Being A Developer After 40
akosma
87
590k
KATA
mclloyd
29
14k
Unsuck your backbone
ammeep
669
57k
Rails Girls Zürich Keynote
gr2m
94
13k
Transcript
Flocking Simulation with Phoenix Channels
Flocking Theory
None
Use case: Cinematic effects
Boid: One member of a flock
* Location
* Location * Perception Radius
* Location * Perception Radius * Velocity * Heading
You Need Three Behaviours
1. Cohesion
1. Cohesion
1. Cohesion
2. Alignment
2. Alignment
2. Alignment
3. Separation
3. Separation
3. Separation ! !
3. Separation ! !
* Cohesion * Alignment * Separation = Next move
Architecture
Phoenix BoidsChannel Receives Updates Changes Settings GenServer WorldStateUpdater Calling itself
30 times per second Simulation Calculates new positions per boid based on world state <canvas> Renderer Renders updated world state Socket Connection Receives Updates Changes Settings
Demo Time!
Read on! http://harry.me/blog/2011/02/17/neat-algorithms-flocking/ http://www.red3d.com/cwr/boids/