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
370
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
140
Single File Ruby Programs 2.0
fabrik42
1
200
Single File Ruby Programs
fabrik42
0
250
Agile Software Development for Software Developers
fabrik42
0
47
Phoenix Live View
fabrik42
0
570
Rails API-only considerations
fabrik42
0
350
Org-Mode
fabrik42
0
510
Cleaner, scalable views with object oriented components
fabrik42
0
350
Headless Browser Experiments
fabrik42
0
380
Other Decks in Programming
See All in Programming
AWS CDKの推しポイント 〜CloudFormationと比較してみた〜
akihisaikeda
2
150
つよそうにふるまい、つよい成果を出すのなら、つよいのかもしれない
irof
1
280
業務自動化をJavaとSeleniumとAWS Lambdaで実現した方法
greenflagproject
1
100
Haskell でアルゴリズムを抽象化する / 関数型言語で競技プログラミング
naoya
16
3.9k
FormFlow - Build Stunning Multistep Forms
yceruto
1
150
複数アプリケーションを育てていくための共通化戦略
irof
10
3.8k
実践ArchUnit ~実例による検証パターンの紹介~
ogiwarat
2
250
PT AI без купюр
v0lka
0
230
Zennの運営完全に理解した #完全に理解したTalk
wadayusuke
1
180
Spring gRPC で始める gRPC 入門 / Introduction to gRPC with Spring gRPC
mackey0225
2
480
関数型まつり2025登壇資料「関数プログラミングと再帰」
taisontsukada
2
780
TypeScript LSP の今までとこれから
quramy
1
490
Featured
See All Featured
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
53k
Into the Great Unknown - MozCon
thekraken
39
1.8k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
45
7.3k
Designing for humans not robots
tammielis
253
25k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
657
60k
Code Reviewing Like a Champion
maltzj
524
40k
Facilitating Awesome Meetings
lara
54
6.4k
Build The Right Thing And Hit Your Dates
maggiecrowley
36
2.7k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
281
13k
We Have a Design System, Now What?
morganepeng
52
7.6k
Testing 201, or: Great Expectations
jmmastey
42
7.5k
Raft: Consensus for Rubyists
vanstee
139
7k
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/