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
420
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Flocking Simulation with Phoenix Channels
Code can be found here:
https://github.com/fabrik42/flocking_elixir
Christian Bäuerlein
April 19, 2018
More Decks by Christian Bäuerlein
See All by Christian Bäuerlein
Single File Ruby Programs @ RubyUnconf 2023
fabrik42
0
190
Single File Ruby Programs 2.0
fabrik42
1
230
Single File Ruby Programs
fabrik42
0
330
Agile Software Development for Software Developers
fabrik42
0
63
Phoenix Live View
fabrik42
0
650
Rails API-only considerations
fabrik42
0
400
Org-Mode
fabrik42
0
570
Cleaner, scalable views with object oriented components
fabrik42
0
390
Headless Browser Experiments
fabrik42
0
430
Other Decks in Programming
See All in Programming
型も通る、synthも通る、それでも危ない 〜AIのCDKの権限とコストを機械で検証する〜 / It Passes Type Checks, It Passes Synth Checks, but It’s Still Risky — Automatically Verifying Permissions and Costs in AI’s CDK —
seike460
PRO
1
550
そこに3びきプロダクトがいるじゃろう——生成AI時代における“価値が届かない理由”の構造
kosuket
0
480
Apache Hive: Toward a Cloud Native Lakehouse
okumin
0
190
PHP Application における Kubernetes 内 gRPC 通信
ganchiku
0
590
Google Apps Script で Ruby を動かす
kawahara
0
220
為什麼你並不需要ViewModel / No, you don't need a ViewModel
lovee
1
490
ルールを書いて終わらせないハーネスエンジニアリング
yug1224
4
1.9k
プロポーザルを書いてもらう
pvcresin
0
500
【QA Test Talk Vol.8】AI-DLC による Whole Team Approach の加速
pkshadeck
PRO
0
180
FDEが実現するAI駆動経営の現在地
gonta
2
280
メールのエイリアス機能を履き違えない
isshinfunada
0
240
自動化したのに回らないテスト運用の壁ーAI時代の品質責任と生産性
mfunaki
0
130
Featured
See All Featured
SEO for Brand Visibility & Recognition
aleyda
0
4.7k
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
620
Building Flexible Design Systems
yeseniaperezcruz
330
40k
Designing Experiences People Love
moore
143
24k
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
520
Chasing Engaging Ingredients in Design
codingconduct
0
270
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
66
57k
Site-Speed That Sticks
csswizardry
13
1.4k
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
Into the Great Unknown - MozCon
thekraken
41
2.7k
YesSQL, Process and Tooling at Scale
rocio
174
15k
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
270
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/