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
210
Agile Software Development for Software Developers
fabrik42
0
42
Phoenix Live View
fabrik42
0
520
Rails API-only considerations
fabrik42
0
330
Org-Mode
fabrik42
0
470
Cleaner, scalable views with object oriented components
fabrik42
0
330
Headless Browser Experiments
fabrik42
0
350
Other Decks in Programming
See All in Programming
DevinとCursorから学ぶAIエージェントメモリーの設計とMoatの考え方
itarutomy
0
140
functionalなアプローチで動的要素を排除する
ryopeko
1
200
盆栽転じて家具となる / Bonsai and Furnitures
aereal
0
1.8k
ISUCON14感想戦で85万点まで頑張ってみた
ponyo877
1
590
DevFest - Serverless 101 with Google Cloud Functions
tunmise
0
140
生成AIでGitHubソースコード取得して仕様書を作成
shukob
0
630
Jaspr Dart Web Framework 박제창 @Devfest 2024
itsmedreamwalker
0
150
令和7年版 あなたが使ってよいフロントエンド機能とは
mugi_uno
10
5.2k
ErdMap: Thinking about a map for Rails applications
makicamel
1
630
Итераторы в Go 1.23: зачем они нужны, как использовать, и насколько они быстрые?
lamodatech
0
1.4k
chibiccをCILに移植した結果 (NGK2025S版)
kekyo
PRO
0
130
毎日13時間もかかるバッチ処理をたった3日で60%短縮するためにやったこと
sho_ssk_
1
550
Featured
See All Featured
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
The Cult of Friendly URLs
andyhume
78
6.1k
How STYLIGHT went responsive
nonsquared
96
5.3k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Building a Scalable Design System with Sketch
lauravandoore
460
33k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
7k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
8
1.2k
BBQ
matthewcrist
85
9.4k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.4k
KATA
mclloyd
29
14k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
28
2.2k
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/