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
380
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
160
Single File Ruby Programs 2.0
fabrik42
1
210
Single File Ruby Programs
fabrik42
0
270
Agile Software Development for Software Developers
fabrik42
0
48
Phoenix Live View
fabrik42
0
590
Rails API-only considerations
fabrik42
0
360
Org-Mode
fabrik42
0
530
Cleaner, scalable views with object oriented components
fabrik42
0
360
Headless Browser Experiments
fabrik42
0
400
Other Decks in Programming
See All in Programming
Django Ninja による API 開発効率化とリプレースの実践
kashewnuts
0
980
overlayPreferenceValue で実現する ピュア SwiftUI な AdMob ネイティブ広告
uhucream
0
110
GraphQL×Railsアプリのデータベース負荷分散 - 月間3,000万人利用サービスを無停止で
koxya
1
1.2k
After go func(): Goroutines Through a Beginner’s Eye
97vaibhav
0
230
CSC305 Lecture 01
javiergs
PRO
1
400
明日から始めるリファクタリング
ryounasso
0
120
GitHub Actions × AWS OIDC連携の仕組みと経緯を理解する
ota1022
0
240
開発者への寄付をアプリ内課金として実装する時の気の使いどころ
ski
0
350
SpecKitでどこまでできる? コストはどれくらい?
leveragestech
0
550
非同期jobをtransaction内で 呼ぶなよ!絶対に呼ぶなよ!
alstrocrack
0
540
Pull-Requestの内容を1クリックで動作確認可能にするワークフロー
natmark
2
460
AIで開発生産性を上げる個人とチームの取り組み
taniigo
0
130
Featured
See All Featured
A designer walks into a library…
pauljervisheath
209
24k
Done Done
chrislema
185
16k
Keith and Marios Guide to Fast Websites
keithpitt
411
22k
Become a Pro
speakerdeck
PRO
29
5.5k
Build The Right Thing And Hit Your Dates
maggiecrowley
37
2.9k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4k
Mobile First: as difficult as doing things right
swwweet
224
10k
Optimizing for Happiness
mojombo
379
70k
It's Worth the Effort
3n
187
28k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
252
21k
We Have a Design System, Now What?
morganepeng
53
7.8k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
358
30k
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/