Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Dynamic Vehicle Routing のシミュレーションを Streamlitで作ってみた
Search
NearMeの技術発表資料です
PRO
March 15, 2024
Technology
260
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Dynamic Vehicle Routing のシミュレーションを Streamlitで作ってみた
NearMeの技術発表資料です
PRO
March 15, 2024
More Decks by NearMeの技術発表資料です
See All by NearMeの技術発表資料です
Claude Code × git worktree で並列開発 (続き) -差分のサービスだけを併設する-
nearme_tech
PRO
1
52
Claude Code × git worktree で並列開発 — サブモジュール構成のリポジトリで成立させる —
nearme_tech
PRO
0
55
LLM + 強化学習
nearme_tech
PRO
0
32
PosthogのA/Bテスト機能の紹介
nearme_tech
PRO
1
49
AIフレンドリーなプロダクトに向けて
nearme_tech
PRO
2
65
初めてのLean言語
nearme_tech
PRO
0
100
Apache Airflow Workflow orchestration without turning cron into spaghetti
nearme_tech
PRO
2
37
実務で役立つ幾何学 ボロノイ図の基礎から グラフ・ネットワーク応用まで
nearme_tech
PRO
1
76
SQL/ID抽出タスクから考える 実践的なハルシネーション対策
nearme_tech
PRO
1
88
Other Decks in Technology
See All in Technology
Tab5をRubyで動くパソコンにする
kishima
2
280
synctest時代のhttptest Go 1.27で変わるHTTPサーバテストの裏側 / go conference2026 synctest and httptest
budougumi0617
1
660
The Agent Builder Loop from Daily Work to OSS
minorun365
PRO
3
120
AI活用の現在地、 ちゃんと見えてますか?/XPfest-2026
visional_engineering_and_design
0
170
Sigmaユーザーのための有用リソース一挙公開 & Sigmaで使えるMCP #sigma_ucj /useful-resources-for-sigma-computing-users-and-mcps-with-sigma
shinyaa31
0
170
Oracle Cloud Infrastructure IaaS 新機能アップデート 2026/6 - 2026/8
oracle4engineer
PRO
0
130
AIで仕事のやり方を変える
matsu7874
3
1k
TinyGo 開発サイクルを高速化する:Go で作るエミュレータ入門
zozotech
PRO
1
380
KPIだけでは評価できないプロダクトが考えるべき Evalsという第二の評価系 / Beyond KPIs: Evals as a Second Evaluation Framework for Products #PdEConf
aki_iinuma
4
3.8k
2026-09-04 SRE Tech Talk #15 怠惰なTerraform / Lazy Terraform
masasuzu
0
230
Amazon S3 Tablesに全部任せてみた結果——コンパクション/スナップショット管理は本当に手放せるか
shigeruoda
1
450
[DroidKaigi 2026] Making UI specifications visible: Android UI development in the AI agent era supported by Compose Screenshot Testing and galleries
syarihu
0
610
Featured
See All Featured
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
510
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
520
ラッコキーワード サービス紹介資料
rakko
1
4.8M
Speed Design
sergeychernyshev
33
2.1k
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
1
2.1k
Leo the Paperboy
mayatellez
8
2.2k
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
270
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
1
270
From π to Pie charts
rasagy
0
360
Rebuilding a faster, lazier Slack
samanthasiow
85
9.6k
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
490
Bash Introduction
62gerente
615
220k
Transcript
0 Dynamic Vehicle Routing のシミュレーションを Streamlitで作ってみた 2024-03-15 第82回NearMe技術勉強会 Kenji Hosoda
1 • ⾃動運転キャッチアップしたいな ◦ 「Autoware :⾃動運転ソフトウェア⼊⾨」を読む ◦ 要素技術多すぎて、勉強会ネタとしてはまとめきれない。。 • 要素技術の⼀つであるROSにフォーカスするか
• ROSで複数⾞両のルーティングのシミュレーションやってるのないかな ◦ あった ▪ https://github.com/shineyruan/vehicle-routing-ros2?tab=readme-ov-file ◦ 元のPython実装もあった ▪ https://github.com/lb-robotics/python-vehicle-routing ◦ 元の論⽂もあった ▪ “Dynamic Vehicle Routing for Robotic Systems”(Bullo et al., 2011) ▪ https://stanfordasl.github.io/wp-content/papercite-data/pdf/Bullo.Fraz zoli.ea.IEEEProc11.pdf • ⾯⽩いのでやっぱりDynamic Vehicle Routingにフォーカス • こういうシミュレーション基盤も作りたかったな ◦ Streamlitでマルチスレッド処理できるかな? ◦ https://zenn.dev/ohtaman/articles/streamlit_start_stop ◦ いけそうなので作ってみるか (勉強会ネタのチョイスの紆余曲折)
2 Dynamic Vehicle Routingについて • 動的に変わる環境 ◦ 確率的に出現する注⽂/タスク • 複数⾞両/ロボットによるアサイン
◦ ⾃律的な最適化 ◦ 協調的なコントロール • ポリシーの違いによってパフォーマンスは⼤きく異なる • 協調的なコントロールは必須 • 注⽂の確率分布に応じて⾞両をバランスよく配置するこ とも重要 • 注⽂数/⾞両数のバランスの違いによってもパフォーマン スは異なる ◦ 注⽂数が多い時は、TSPが有効 https://github.com/lb-robotics/python-vehicle-routing
3 シミュレータ作ってみた こちらからダウンロードして実⾏ https://gist.github.com/kenji4569/8da401b4d1bbfe2b0b6be41ac6d3d1a2 以下のコマンドを実行 pip install streamlit numpy scipy
pandas altair readerwriterlock streamlit run app.py (wandb利用の場合は以下も実行 ) wandb login pip install wandb ブラウザでStreamlitアプリが立ち上がったら “Start”ボタンを押下
4 マルチスレッドについて class Vehicle(threading.Thread): def __init__(self, events: Events, location: Location,
**kwargs): super().__init__(**kwargs) self.done = threading.Event() ... def run(self): while not self.done.wait(0): time.sleep(TIME_STEP) self._move() class Timer(threading.Thread): def __init__(self, events: Events, **kwargs): super().__init__(**kwargs) self.done = threading.Event() ... def run(self): while not self.done.wait(0): time.sleep(TIME_STEP) self.elapsed_time += TIME_STEP • Timerのスレッド • Vehicle x nのスレッド 各スレッドが並列動く (Streamlitではグローバルにキャッシュでスレッドのオブジェクトを保持する必要あり) @st.cache_resource def get_root_manager(): return RootManager()
5 マルチスレッドの注意点 • ロック処理をしないとどうなるか def _move(self): diff = self.target_location -
self.location diff_norm = np.linalg.norm(diff) if diff_norm < self.pickup_threshold: self.location = self.target_location self._pickup_demand() else: movement = diff * (self.speed / diff_norm) self.location = self.location + TIME_STEP * movement def _pickup_demand(self): if not self.target_demand: return target_demand = self.target_demand with self.lock.gen_wlock(): if not target_demand.picked_up: target_demand.picked_up = True self.events.append( Event( "pickup_demand", {"demand_uid": target_demand.uid, "vehicle_uid": self.uid}, ) ) ここでロック ロックしないとこの値が 書き変わる可能性がある ピックアップイベントが 複数回記録される可能性がある 距離が近くなったら ピックアップ
6 イベントの記録 • グローバルなイベントを記録 ◦ (ROSのrosbagに倣った) • イベントを集計 • 時系列のメトリクスを算出
◦ Streamlitで表⽰ • WandBに連携 ◦ strategy毎の⽐較がしやすい ◦ 右図が⼀例
7 Thank you