mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-11-28 03:35:51 +03:00
deploy: ba5ea18101
This commit is contained in:
parent
8ba200a5e4
commit
7777db089f
@ -197,9 +197,9 @@ the event and immediately apply the transition. <a href="#method.panel_changed">
|
||||
</div><h4 id="method.draw-4" class="method hidden"><code>fn <a href="#method.draw" class="fnname">draw</a>(&self, _: &mut GfxCtx<'_>, _: &<a class="struct" href="../../game/app/struct.App.html" title="struct game::app::App">App</a>)</code><a class="srclink" href="../../src/game/common/warp.rs.html#67" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Draw</p>
|
||||
</div><h4 id="method.draw_baselayer-3" class="method hidden"><code>fn <a href="#method.draw_baselayer" class="fnname">draw_baselayer</a>(&self) -> DrawBaselayer</code></h4><div class='docblock hidden'><p>Specifies what to draw before draw()</p>
|
||||
</div><h4 id="method.on_destroy-3" class="method hidden"><code>fn <a href="#method.on_destroy" class="fnname">on_destroy</a>(&mut self, &mut EventCtx<'_>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>A)</code></h4><div class='docblock hidden'><p>Before this state is popped or replaced, call this.</p>
|
||||
</div></div><h3 id="impl-State%3CApp%3E-30" class="impl"><code class="in-band">impl State<<a class="struct" href="../../game/app/struct.App.html" title="struct game::app::App">App</a>> for <a class="struct" href="../../game/layer/struct.PickLayer.html" title="struct game::layer::PickLayer">PickLayer</a></code><a href="#impl-State%3CApp%3E-30" class="anchor"></a><a class="srclink" href="../../src/game/layer/mod.rs.html#158-260" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.event-30" class="method hidden"><code>fn <a href="#method.event" class="fnname">event</a>(&mut self, ctx: &mut EventCtx<'_>, app: &mut <a class="struct" href="../../game/app/struct.App.html" title="struct game::app::App">App</a>) -> Transition<<a class="struct" href="../../game/app/struct.App.html" title="struct game::app::App">App</a>></code><a class="srclink" href="../../src/game/layer/mod.rs.html#159-250" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Respond to a UI event, such as input or time passing.</p>
|
||||
</div><h4 id="method.draw_baselayer-30" class="method hidden"><code>fn <a href="#method.draw_baselayer" class="fnname">draw_baselayer</a>(&self) -> DrawBaselayer</code><a class="srclink" href="../../src/game/layer/mod.rs.html#252-254" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Specifies what to draw before draw()</p>
|
||||
</div><h4 id="method.draw-31" class="method hidden"><code>fn <a href="#method.draw" class="fnname">draw</a>(&self, g: &mut GfxCtx<'_>, app: &<a class="struct" href="../../game/app/struct.App.html" title="struct game::app::App">App</a>)</code><a class="srclink" href="../../src/game/layer/mod.rs.html#256-259" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Draw</p>
|
||||
</div></div><h3 id="impl-State%3CApp%3E-30" class="impl"><code class="in-band">impl State<<a class="struct" href="../../game/app/struct.App.html" title="struct game::app::App">App</a>> for <a class="struct" href="../../game/layer/struct.PickLayer.html" title="struct game::layer::PickLayer">PickLayer</a></code><a href="#impl-State%3CApp%3E-30" class="anchor"></a><a class="srclink" href="../../src/game/layer/mod.rs.html#159-265" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.event-30" class="method hidden"><code>fn <a href="#method.event" class="fnname">event</a>(&mut self, ctx: &mut EventCtx<'_>, app: &mut <a class="struct" href="../../game/app/struct.App.html" title="struct game::app::App">App</a>) -> Transition<<a class="struct" href="../../game/app/struct.App.html" title="struct game::app::App">App</a>></code><a class="srclink" href="../../src/game/layer/mod.rs.html#160-255" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Respond to a UI event, such as input or time passing.</p>
|
||||
</div><h4 id="method.draw_baselayer-30" class="method hidden"><code>fn <a href="#method.draw_baselayer" class="fnname">draw_baselayer</a>(&self) -> DrawBaselayer</code><a class="srclink" href="../../src/game/layer/mod.rs.html#257-259" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Specifies what to draw before draw()</p>
|
||||
</div><h4 id="method.draw-31" class="method hidden"><code>fn <a href="#method.draw" class="fnname">draw</a>(&self, g: &mut GfxCtx<'_>, app: &<a class="struct" href="../../game/app/struct.App.html" title="struct game::app::App">App</a>)</code><a class="srclink" href="../../src/game/layer/mod.rs.html#261-264" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Draw</p>
|
||||
</div><h4 id="method.on_destroy-30" class="method hidden"><code>fn <a href="#method.on_destroy" class="fnname">on_destroy</a>(&mut self, &mut EventCtx<'_>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>A)</code></h4><div class='docblock hidden'><p>Before this state is popped or replaced, call this.</p>
|
||||
</div></div><h3 id="impl-State%3CApp%3E-31" class="impl"><code class="in-band">impl State<<a class="struct" href="../../game/app/struct.App.html" title="struct game::app::App">App</a>> for <a class="struct" href="../../game/pregame/struct.TitleScreen.html" title="struct game::pregame::TitleScreen">TitleScreen</a></code><a href="#impl-State%3CApp%3E-31" class="anchor"></a><a class="srclink" href="../../src/game/pregame.rs.html#65-86" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.event-31" class="method hidden"><code>fn <a href="#method.event" class="fnname">event</a>(&mut self, ctx: &mut EventCtx<'_>, app: &mut <a class="struct" href="../../game/app/struct.App.html" title="struct game::app::App">App</a>) -> Transition<<a class="struct" href="../../game/app/struct.App.html" title="struct game::app::App">App</a>></code><a class="srclink" href="../../src/game/pregame.rs.html#66-81" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Respond to a UI event, such as input or time passing.</p>
|
||||
</div><h4 id="method.draw-32" class="method hidden"><code>fn <a href="#method.draw" class="fnname">draw</a>(&self, g: &mut GfxCtx<'_>, _: &<a class="struct" href="../../game/app/struct.App.html" title="struct game::app::App">App</a>)</code><a class="srclink" href="../../src/game/pregame.rs.html#83-85" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Draw</p>
|
||||
|
@ -1,7 +1,7 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `LayerOutcome` enum in crate `game`."><meta name="keywords" content="rust, rustlang, rust-lang, LayerOutcome"><title>game::layer::LayerOutcome - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
|
||||
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
|
||||
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc enum"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../game/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><p class="location">Enum LayerOutcome</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#variants">Variants</a><div class="sidebar-links"><a href="#variant.Close">Close</a><a href="#variant.Replace">Replace</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">!RefUnwindSafe</a><a href="#impl-Send">!Send</a><a href="#impl-Sync">!Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">!UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-Downcast">Downcast</a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-Same%3CT%3E">Same<T></a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class="location"><a href="../index.html">game</a>::<wbr><a href="index.html">layer</a></p><script>window.sidebarCurrent = {name: "LayerOutcome", ty: "enum", relpath: ""};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><span class="help-button">?</span>
|
||||
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../../src/game/layer/mod.rs.html#50-53" title="goto source code">[src]</a></span><span class="in-band">Enum <a href="../index.html">game</a>::<wbr><a href="index.html">layer</a>::<wbr><a class="enum" href="">LayerOutcome</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust enum">pub enum LayerOutcome {
|
||||
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../../src/game/layer/mod.rs.html#51-54" title="goto source code">[src]</a></span><span class="in-band">Enum <a href="../index.html">game</a>::<wbr><a href="index.html">layer</a>::<wbr><a class="enum" href="">LayerOutcome</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust enum">pub enum LayerOutcome {
|
||||
Close,
|
||||
Replace(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><dyn <a class="trait" href="../../game/layer/trait.Layer.html" title="trait game::layer::Layer">Layer</a>>),
|
||||
}</pre></div><h2 id="variants" class="variants small-section-header">
|
||||
|
@ -1,5 +1,5 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `header` fn in crate `game`."><meta name="keywords" content="rust, rustlang, rust-lang, header"><title>game::layer::header - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
|
||||
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
|
||||
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc fn"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../game/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class="location"><a href="../index.html">game</a>::<wbr><a href="index.html">layer</a></p><script>window.sidebarCurrent = {name: "header", ty: "fn", relpath: ""};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><span class="help-button">?</span>
|
||||
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../../src/game/layer/mod.rs.html#263-269" title="goto source code">[src]</a></span><span class="in-band">Function <a href="../index.html">game</a>::<wbr><a href="index.html">layer</a>::<wbr><a class="fn" href="">header</a></span></h1><pre class="rust fn">pub fn header(ctx: &mut EventCtx<'_>, name: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -> Widget</pre><div class="docblock"><p>Creates the top row for any layer panel.</p>
|
||||
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../../src/game/layer/mod.rs.html#268-274" title="goto source code">[src]</a></span><span class="in-band">Function <a href="../index.html">game</a>::<wbr><a href="index.html">layer</a>::<wbr><a class="fn" href="">header</a></span></h1><pre class="rust fn">pub fn header(ctx: &mut EventCtx<'_>, name: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -> Widget</pre><div class="docblock"><p>Creates the top row for any layer panel.</p>
|
||||
</div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "game";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
|
@ -1,7 +1,7 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `layer` mod in crate `game`."><meta name="keywords" content="rust, rustlang, rust-lang, layer"><title>game::layer - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
|
||||
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
|
||||
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../game/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><p class="location">Module layer</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#modules">Modules</a></li><li><a href="#structs">Structs</a></li><li><a href="#enums">Enums</a></li><li><a href="#traits">Traits</a></li><li><a href="#functions">Functions</a></li></ul></div><p class="location"><a href="../index.html">game</a></p><script>window.sidebarCurrent = {name: "layer", ty: "mod", relpath: "../"};</script><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><span class="help-button">?</span>
|
||||
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../../src/game/layer/mod.rs.html#1-269" title="goto source code">[src]</a></span><span class="in-band">Module <a href="../index.html">game</a>::<wbr><a class="mod" href="">layer</a></span></h1><h2 id="modules" class="section-header"><a href="#modules">Modules</a></h2>
|
||||
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../../src/game/layer/mod.rs.html#1-274" title="goto source code">[src]</a></span><span class="in-band">Module <a href="../index.html">game</a>::<wbr><a class="mod" href="">layer</a></span></h1><h2 id="modules" class="section-header"><a href="#modules">Modules</a></h2>
|
||||
<table><tr class="module-item"><td><a class="mod" href="elevation/index.html" title="game::layer::elevation mod">elevation</a></td><td class="docblock-short"></td></tr><tr class="module-item"><td><a class="mod" href="favorites/index.html" title="game::layer::favorites mod">favorites</a></td><td class="docblock-short"></td></tr><tr class="module-item"><td><a class="mod" href="map/index.html" title="game::layer::map mod">map</a></td><td class="docblock-short"></td></tr><tr class="module-item"><td><a class="mod" href="pandemic/index.html" title="game::layer::pandemic mod">pandemic</a></td><td class="docblock-short"></td></tr><tr class="module-item"><td><a class="mod" href="parking/index.html" title="game::layer::parking mod">parking</a></td><td class="docblock-short"></td></tr><tr class="module-item"><td><a class="mod" href="population/index.html" title="game::layer::population mod">population</a></td><td class="docblock-short"></td></tr><tr class="module-item"><td><a class="mod" href="traffic/index.html" title="game::layer::traffic mod">traffic</a></td><td class="docblock-short"></td></tr><tr class="module-item"><td><a class="mod" href="transit/index.html" title="game::layer::transit mod">transit</a></td><td class="docblock-short"></td></tr></table><h2 id="structs" class="section-header"><a href="#structs">Structs</a></h2>
|
||||
<table><tr class="module-item"><td><a class="struct" href="struct.PickLayer.html" title="game::layer::PickLayer struct">PickLayer</a></td><td class="docblock-short"></td></tr></table><h2 id="enums" class="section-header"><a href="#enums">Enums</a></h2>
|
||||
<table><tr class="module-item"><td><a class="enum" href="enum.LayerOutcome.html" title="game::layer::LayerOutcome enum">LayerOutcome</a></td><td class="docblock-short"></td></tr></table><h2 id="traits" class="section-header"><a href="#traits">Traits</a></h2>
|
||||
|
@ -1,12 +1,12 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `PickLayer` struct in crate `game`."><meta name="keywords" content="rust, rustlang, rust-lang, PickLayer"><title>game::layer::PickLayer - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
|
||||
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
|
||||
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../game/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><p class="location">Struct PickLayer</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#fields">Fields</a><div class="sidebar-links"><a href="#structfield.panel">panel</a></div><a class="sidebar-title" href="#implementations">Methods</a><div class="sidebar-links"><a href="#method.pick">pick</a><a href="#method.update">update</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-State%3CApp%3E">State<App></a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">!RefUnwindSafe</a><a href="#impl-Send">!Send</a><a href="#impl-Sync">!Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">!UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-Downcast">Downcast</a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-Same%3CT%3E">Same<T></a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class="location"><a href="../index.html">game</a>::<wbr><a href="index.html">layer</a></p><script>window.sidebarCurrent = {name: "PickLayer", ty: "struct", relpath: ""};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><span class="help-button">?</span>
|
||||
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../../src/game/layer/mod.rs.html#56-58" title="goto source code">[src]</a></span><span class="in-band">Struct <a href="../index.html">game</a>::<wbr><a href="index.html">layer</a>::<wbr><a class="struct" href="">PickLayer</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust struct">pub struct PickLayer {
|
||||
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../../src/game/layer/mod.rs.html#57-59" title="goto source code">[src]</a></span><span class="in-band">Struct <a href="../index.html">game</a>::<wbr><a href="index.html">layer</a>::<wbr><a class="struct" href="">PickLayer</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust struct">pub struct PickLayer {
|
||||
panel: Panel,
|
||||
}</pre></div><h2 id="fields" class="fields small-section-header">
|
||||
Fields<a href="#fields" class="anchor"></a></h2><span id="structfield.panel" class="structfield small-section-header"><a href="#structfield.panel" class="anchor field"></a><code>panel: Panel</code></span><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><h3 id="impl" class="impl"><code class="in-band">impl <a class="struct" href="../../game/layer/struct.PickLayer.html" title="struct game::layer::PickLayer">PickLayer</a></code><a href="#impl" class="anchor"></a><a class="srclink" href="../../src/game/layer/mod.rs.html#60-156" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.update" class="method"><code>pub fn <a href="#method.update" class="fnname">update</a>(<br> ctx: &mut EventCtx<'_>, <br> app: &mut <a class="struct" href="../../game/app/struct.App.html" title="struct game::app::App">App</a>, <br> minimap: &Panel<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Transition<<a class="struct" href="../../game/app/struct.App.html" title="struct game::app::App">App</a>>></code><a class="srclink" href="../../src/game/layer/mod.rs.html#61-82" title="goto source code">[src]</a></h4><h4 id="method.pick" class="method"><code>pub fn <a href="#method.pick" class="fnname">pick</a>(ctx: &mut EventCtx<'_>, app: &<a class="struct" href="../../game/app/struct.App.html" title="struct game::app::App">App</a>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><dyn State<<a class="struct" href="../../game/app/struct.App.html" title="struct game::app::App">App</a>>></code><a class="srclink" href="../../src/game/layer/mod.rs.html#84-155" title="goto source code">[src]</a></h4></div><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><h3 id="impl-State%3CApp%3E" class="impl"><code class="in-band">impl State<<a class="struct" href="../../game/app/struct.App.html" title="struct game::app::App">App</a>> for <a class="struct" href="../../game/layer/struct.PickLayer.html" title="struct game::layer::PickLayer">PickLayer</a></code><a href="#impl-State%3CApp%3E" class="anchor"></a><a class="srclink" href="../../src/game/layer/mod.rs.html#158-260" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.event" class="method hidden"><code>fn <a href="#method.event" class="fnname">event</a>(&mut self, ctx: &mut EventCtx<'_>, app: &mut <a class="struct" href="../../game/app/struct.App.html" title="struct game::app::App">App</a>) -> Transition<<a class="struct" href="../../game/app/struct.App.html" title="struct game::app::App">App</a>></code><a class="srclink" href="../../src/game/layer/mod.rs.html#159-250" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Respond to a UI event, such as input or time passing.</p>
|
||||
</div><h4 id="method.draw_baselayer" class="method hidden"><code>fn <a href="#method.draw_baselayer" class="fnname">draw_baselayer</a>(&self) -> DrawBaselayer</code><a class="srclink" href="../../src/game/layer/mod.rs.html#252-254" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Specifies what to draw before draw()</p>
|
||||
</div><h4 id="method.draw" class="method hidden"><code>fn <a href="#method.draw" class="fnname">draw</a>(&self, g: &mut GfxCtx<'_>, app: &<a class="struct" href="../../game/app/struct.App.html" title="struct game::app::App">App</a>)</code><a class="srclink" href="../../src/game/layer/mod.rs.html#256-259" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Draw</p>
|
||||
Fields<a href="#fields" class="anchor"></a></h2><span id="structfield.panel" class="structfield small-section-header"><a href="#structfield.panel" class="anchor field"></a><code>panel: Panel</code></span><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><h3 id="impl" class="impl"><code class="in-band">impl <a class="struct" href="../../game/layer/struct.PickLayer.html" title="struct game::layer::PickLayer">PickLayer</a></code><a href="#impl" class="anchor"></a><a class="srclink" href="../../src/game/layer/mod.rs.html#61-157" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.update" class="method"><code>pub fn <a href="#method.update" class="fnname">update</a>(<br> ctx: &mut EventCtx<'_>, <br> app: &mut <a class="struct" href="../../game/app/struct.App.html" title="struct game::app::App">App</a>, <br> minimap: &Panel<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Transition<<a class="struct" href="../../game/app/struct.App.html" title="struct game::app::App">App</a>>></code><a class="srclink" href="../../src/game/layer/mod.rs.html#62-83" title="goto source code">[src]</a></h4><h4 id="method.pick" class="method"><code>pub fn <a href="#method.pick" class="fnname">pick</a>(ctx: &mut EventCtx<'_>, app: &<a class="struct" href="../../game/app/struct.App.html" title="struct game::app::App">App</a>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><dyn State<<a class="struct" href="../../game/app/struct.App.html" title="struct game::app::App">App</a>>></code><a class="srclink" href="../../src/game/layer/mod.rs.html#85-156" title="goto source code">[src]</a></h4></div><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><h3 id="impl-State%3CApp%3E" class="impl"><code class="in-band">impl State<<a class="struct" href="../../game/app/struct.App.html" title="struct game::app::App">App</a>> for <a class="struct" href="../../game/layer/struct.PickLayer.html" title="struct game::layer::PickLayer">PickLayer</a></code><a href="#impl-State%3CApp%3E" class="anchor"></a><a class="srclink" href="../../src/game/layer/mod.rs.html#159-265" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.event" class="method hidden"><code>fn <a href="#method.event" class="fnname">event</a>(&mut self, ctx: &mut EventCtx<'_>, app: &mut <a class="struct" href="../../game/app/struct.App.html" title="struct game::app::App">App</a>) -> Transition<<a class="struct" href="../../game/app/struct.App.html" title="struct game::app::App">App</a>></code><a class="srclink" href="../../src/game/layer/mod.rs.html#160-255" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Respond to a UI event, such as input or time passing.</p>
|
||||
</div><h4 id="method.draw_baselayer" class="method hidden"><code>fn <a href="#method.draw_baselayer" class="fnname">draw_baselayer</a>(&self) -> DrawBaselayer</code><a class="srclink" href="../../src/game/layer/mod.rs.html#257-259" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Specifies what to draw before draw()</p>
|
||||
</div><h4 id="method.draw" class="method hidden"><code>fn <a href="#method.draw" class="fnname">draw</a>(&self, g: &mut GfxCtx<'_>, app: &<a class="struct" href="../../game/app/struct.App.html" title="struct game::app::App">App</a>)</code><a class="srclink" href="../../src/game/layer/mod.rs.html#261-264" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Draw</p>
|
||||
</div><h4 id="method.on_destroy" class="method hidden"><code>fn <a href="#method.on_destroy" class="fnname">on_destroy</a>(&mut self, &mut EventCtx<'_>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>A)</code></h4><div class='docblock hidden'><p>Before this state is popped or replaced, call this.</p>
|
||||
</div></div></div><h2 id="synthetic-implementations" class="small-section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor"></a></h2><div id="synthetic-implementations-list"><h3 id="impl-RefUnwindSafe" class="impl"><code class="in-band">impl !<a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../../game/layer/struct.PickLayer.html" title="struct game::layer::PickLayer">PickLayer</a></code><a href="#impl-RefUnwindSafe" class="anchor"></a></h3><div class="impl-items"></div><h3 id="impl-Send" class="impl"><code class="in-band">impl !<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../../game/layer/struct.PickLayer.html" title="struct game::layer::PickLayer">PickLayer</a></code><a href="#impl-Send" class="anchor"></a></h3><div class="impl-items"></div><h3 id="impl-Sync" class="impl"><code class="in-band">impl !<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../../game/layer/struct.PickLayer.html" title="struct game::layer::PickLayer">PickLayer</a></code><a href="#impl-Sync" class="anchor"></a></h3><div class="impl-items"></div><h3 id="impl-Unpin" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../../game/layer/struct.PickLayer.html" title="struct game::layer::PickLayer">PickLayer</a></code><a href="#impl-Unpin" class="anchor"></a></h3><div class="impl-items"></div><h3 id="impl-UnwindSafe" class="impl"><code class="in-band">impl !<a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../../game/layer/struct.PickLayer.html" title="struct game::layer::PickLayer">PickLayer</a></code><a href="#impl-UnwindSafe" class="anchor"></a></h3><div class="impl-items"></div></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><h3 id="impl-Any" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href="#impl-Any" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.type_id" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id" class="fnname">type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
|
||||
</div></div><h3 id="impl-Borrow%3CT%3E" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href="#impl-Borrow%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow" class="fnname">borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#211-213" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
|
||||
|
@ -1,4 +1,4 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `cluster_jams` fn in crate `game`."><meta name="keywords" content="rust, rustlang, rust-lang, cluster_jams"><title>game::layer::traffic::cluster_jams - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
|
||||
<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
|
||||
<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc fn"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../game/index.html'><div class='logo-container rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class="location"><a href="../../index.html">game</a>::<wbr><a href="../index.html">layer</a>::<wbr><a href="index.html">traffic</a></p><script>window.sidebarCurrent = {name: "cluster_jams", ty: "fn", relpath: ""};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><span class="help-button">?</span>
|
||||
<a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../../../src/game/layer/traffic.rs.html#436-459" title="goto source code">[src]</a></span><span class="in-band">Function <a href="../../index.html">game</a>::<wbr><a href="../index.html">layer</a>::<wbr><a href="index.html">traffic</a>::<wbr><a class="fn" href="">cluster_jams</a></span></h1><pre class="rust fn">fn cluster_jams(<br> map: &<a class="struct" href="../../../map_model/struct.Map.html" title="struct map_model::Map">Map</a>, <br> problems: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="struct" href="../../../map_model/objects/intersection/struct.IntersectionID.html" title="struct map_model::objects::intersection::IntersectionID">IntersectionID</a>, <a class="struct" href="../../../geom/time/struct.Time.html" title="struct geom::time::Time">Time</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>><br>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="struct" href="../../../geom/polygon/struct.Polygon.html" title="struct geom::polygon::Polygon">Polygon</a>, <a class="struct" href="../../../geom/polygon/struct.Polygon.html" title="struct geom::polygon::Polygon">Polygon</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>></pre></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "game";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
|
||||
<a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../../../src/game/layer/traffic.rs.html#479-502" title="goto source code">[src]</a></span><span class="in-band">Function <a href="../../index.html">game</a>::<wbr><a href="../index.html">layer</a>::<wbr><a href="index.html">traffic</a>::<wbr><a class="fn" href="">cluster_jams</a></span></h1><pre class="rust fn">fn cluster_jams(<br> map: &<a class="struct" href="../../../map_model/struct.Map.html" title="struct map_model::Map">Map</a>, <br> problems: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="struct" href="../../../map_model/objects/intersection/struct.IntersectionID.html" title="struct map_model::objects::intersection::IntersectionID">IntersectionID</a>, <a class="struct" href="../../../geom/time/struct.Time.html" title="struct geom::time::Time">Time</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>><br>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="struct" href="../../../geom/polygon/struct.Polygon.html" title="struct geom::polygon::Polygon">Polygon</a>, <a class="struct" href="../../../geom/polygon/struct.Polygon.html" title="struct geom::polygon::Polygon">Polygon</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>></pre></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "game";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
|
@ -1,6 +1,6 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `traffic` mod in crate `game`."><meta name="keywords" content="rust, rustlang, rust-lang, traffic"><title>game::layer::traffic - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
|
||||
<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
|
||||
<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../game/index.html'><div class='logo-container rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a><p class="location">Module traffic</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li><li><a href="#functions">Functions</a></li></ul></div><p class="location"><a href="../../index.html">game</a>::<wbr><a href="../index.html">layer</a></p><script>window.sidebarCurrent = {name: "traffic", ty: "mod", relpath: "../"};</script><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><span class="help-button">?</span>
|
||||
<a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../../../src/game/layer/traffic.rs.html#1-565" title="goto source code">[src]</a></span><span class="in-band">Module <a href="../../index.html">game</a>::<wbr><a href="../index.html">layer</a>::<wbr><a class="mod" href="">traffic</a></span></h1><h2 id="structs" class="section-header"><a href="#structs">Structs</a></h2>
|
||||
<a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../../../src/game/layer/traffic.rs.html#1-608" title="goto source code">[src]</a></span><span class="in-band">Module <a href="../../index.html">game</a>::<wbr><a href="../index.html">layer</a>::<wbr><a class="mod" href="">traffic</a></span></h1><h2 id="structs" class="section-header"><a href="#structs">Structs</a></h2>
|
||||
<table><tr class="module-item"><td><a class="struct" href="struct.Backpressure.html" title="game::layer::traffic::Backpressure struct">Backpressure</a></td><td class="docblock-short"></td></tr><tr class="module-item"><td><a class="struct" href="struct.CompareThroughput.html" title="game::layer::traffic::CompareThroughput struct">CompareThroughput</a></td><td class="docblock-short"></td></tr><tr class="module-item"><td><a class="struct" href="struct.Delay.html" title="game::layer::traffic::Delay struct">Delay</a></td><td class="docblock-short"></td></tr><tr class="module-item"><td><a class="struct" href="struct.Jam.html" title="game::layer::traffic::Jam struct">Jam</a></td><td class="docblock-short"></td></tr><tr class="module-item"><td><a class="struct" href="struct.Throughput.html" title="game::layer::traffic::Throughput struct">Throughput</a></td><td class="docblock-short"></td></tr><tr class="module-item"><td><a class="struct" href="struct.TrafficJams.html" title="game::layer::traffic::TrafficJams struct">TrafficJams</a></td><td class="docblock-short"></td></tr></table><h2 id="functions" class="section-header"><a href="#functions">Functions</a></h2>
|
||||
<table><tr class="module-item"><td><a class="fn" href="fn.cluster_jams.html" title="game::layer::traffic::cluster_jams fn">cluster_jams</a></td><td class="docblock-short"></td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "game";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,5 +1,5 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `BUILT_TIME_UTC` constant in crate `game`."><meta name="keywords" content="rust, rustlang, rust-lang, BUILT_TIME_UTC"><title>game::pregame::built_info::BUILT_TIME_UTC - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
|
||||
<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
|
||||
<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc constant"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../game/index.html'><div class='logo-container rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class="location"><a href="../../index.html">game</a>::<wbr><a href="../index.html">pregame</a>::<wbr><a href="index.html">built_info</a></p><script>window.sidebarCurrent = {name: "BUILT_TIME_UTC", ty: "constant", relpath: ""};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><span class="help-button">?</span>
|
||||
<a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../../../src/game/home/runner/work/abstreet/abstreet/target/debug/build/game-b5501e76eef510ad/out/built.rs.html#53" title="goto source code">[src]</a></span><span class="in-band">Constant <a href="../../index.html">game</a>::<wbr><a href="../index.html">pregame</a>::<wbr><a href="index.html">built_info</a>::<wbr><a class="constant" href="">BUILT_TIME_UTC</a></span></h1><pre class="rust const">pub const BUILT_TIME_UTC: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a> = "Mon, 01 Feb 2021 18:44:06 +0000";</pre><div class="docblock"><p>The built-time in RFC2822, UTC</p>
|
||||
<a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../../../src/game/home/runner/work/abstreet/abstreet/target/debug/build/game-b5501e76eef510ad/out/built.rs.html#53" title="goto source code">[src]</a></span><span class="in-band">Constant <a href="../../index.html">game</a>::<wbr><a href="../index.html">pregame</a>::<wbr><a href="index.html">built_info</a>::<wbr><a class="constant" href="">BUILT_TIME_UTC</a></span></h1><pre class="rust const">pub const BUILT_TIME_UTC: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a> = "Mon, 01 Feb 2021 19:11:11 +0000";</pre><div class="docblock"><p>The built-time in RFC2822, UTC</p>
|
||||
</div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "game";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
|
File diff suppressed because one or more lines are too long
@ -1,7 +1,7 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `analytics` mod in crate `sim`."><meta name="keywords" content="rust, rustlang, rust-lang, analytics"><title>sim::analytics - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
|
||||
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
|
||||
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../sim/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><p class="location">Module analytics</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li></ul></div><p class="location"><a href="../index.html">sim</a></p><script>window.sidebarCurrent = {name: "analytics", ty: "mod", relpath: "../"};</script><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><span class="help-button">?</span>
|
||||
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../../src/sim/analytics.rs.html#1-650" title="goto source code">[src]</a></span><span class="in-band">Module <a href="../index.html">sim</a>::<wbr><a class="mod" href="">analytics</a></span></h1><h2 id="structs" class="section-header"><a href="#structs">Structs</a></h2>
|
||||
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../../src/sim/analytics.rs.html#1-656" title="goto source code">[src]</a></span><span class="in-band">Module <a href="../index.html">sim</a>::<wbr><a class="mod" href="">analytics</a></span></h1><h2 id="structs" class="section-header"><a href="#structs">Structs</a></h2>
|
||||
<table><tr class="module-item"><td><a class="struct" href="struct.Analytics.html" title="sim::analytics::Analytics struct">Analytics</a></td><td class="docblock-short"><p>As a simulation runs, different pieces emit Events. The Analytics object listens to these,
|
||||
organizing and storing some information from them. The UI queries Analytics to draw time-series
|
||||
and display statistics.</p>
|
||||
|
File diff suppressed because one or more lines are too long
@ -1,12 +1,12 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `Window` struct in crate `sim`."><meta name="keywords" content="rust, rustlang, rust-lang, Window"><title>sim::analytics::Window - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
|
||||
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
|
||||
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../sim/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><p class="location">Struct Window</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#fields">Fields</a><div class="sidebar-links"><a href="#structfield.times">times</a><a href="#structfield.window_size">window_size</a></div><a class="sidebar-title" href="#implementations">Methods</a><div class="sidebar-links"><a href="#method.add">add</a><a href="#method.count">count</a><a href="#method.new">new</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-Downcast">Downcast</a><a href="#impl-DowncastSync">DowncastSync</a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-Same%3CT%3E">Same<T></a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class="location"><a href="../index.html">sim</a>::<wbr><a href="index.html">analytics</a></p><script>window.sidebarCurrent = {name: "Window", ty: "struct", relpath: ""};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><span class="help-button">?</span>
|
||||
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../../src/sim/analytics.rs.html#624-627" title="goto source code">[src]</a></span><span class="in-band">Struct <a href="../index.html">sim</a>::<wbr><a href="index.html">analytics</a>::<wbr><a class="struct" href="">Window</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust struct">pub struct Window {
|
||||
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../../src/sim/analytics.rs.html#630-633" title="goto source code">[src]</a></span><span class="in-band">Struct <a href="../index.html">sim</a>::<wbr><a href="index.html">analytics</a>::<wbr><a class="struct" href="">Window</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust struct">pub struct Window {
|
||||
times: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/collections/vec_deque/struct.VecDeque.html" title="struct alloc::collections::vec_deque::VecDeque">VecDeque</a><<a class="struct" href="../../geom/time/struct.Time.html" title="struct geom::time::Time">Time</a>>,
|
||||
window_size: <a class="struct" href="../../geom/duration/struct.Duration.html" title="struct geom::duration::Duration">Duration</a>,
|
||||
}</pre></div><h2 id="fields" class="fields small-section-header">
|
||||
Fields<a href="#fields" class="anchor"></a></h2><span id="structfield.times" class="structfield small-section-header"><a href="#structfield.times" class="anchor field"></a><code>times: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/collections/vec_deque/struct.VecDeque.html" title="struct alloc::collections::vec_deque::VecDeque">VecDeque</a><<a class="struct" href="../../geom/time/struct.Time.html" title="struct geom::time::Time">Time</a>></code></span><span id="structfield.window_size" class="structfield small-section-header"><a href="#structfield.window_size" class="anchor field"></a><code>window_size: <a class="struct" href="../../geom/duration/struct.Duration.html" title="struct geom::duration::Duration">Duration</a></code></span><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><h3 id="impl" class="impl"><code class="in-band">impl <a class="struct" href="../../sim/analytics/struct.Window.html" title="struct sim::analytics::Window">Window</a></code><a href="#impl" class="anchor"></a><a class="srclink" href="../../src/sim/analytics.rs.html#629-650" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.new" class="method"><code>pub fn <a href="#method.new" class="fnname">new</a>(window_size: <a class="struct" href="../../geom/duration/struct.Duration.html" title="struct geom::duration::Duration">Duration</a>) -> <a class="struct" href="../../sim/analytics/struct.Window.html" title="struct sim::analytics::Window">Window</a></code><a class="srclink" href="../../src/sim/analytics.rs.html#630-635" title="goto source code">[src]</a></h4><h4 id="method.add" class="method"><code>pub fn <a href="#method.add" class="fnname">add</a>(&mut self, time: <a class="struct" href="../../geom/time/struct.Time.html" title="struct geom::time::Time">Time</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code><a class="srclink" href="../../src/sim/analytics.rs.html#638-641" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns the count at time</p>
|
||||
</div><h4 id="method.count" class="method"><code>pub fn <a href="#method.count" class="fnname">count</a>(&mut self, end: <a class="struct" href="../../geom/time/struct.Time.html" title="struct geom::time::Time">Time</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code><a class="srclink" href="../../src/sim/analytics.rs.html#644-649" title="goto source code">[src]</a></h4><div class="docblock"><p>Grab the count at this time, but don't add a new time</p>
|
||||
Fields<a href="#fields" class="anchor"></a></h2><span id="structfield.times" class="structfield small-section-header"><a href="#structfield.times" class="anchor field"></a><code>times: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/collections/vec_deque/struct.VecDeque.html" title="struct alloc::collections::vec_deque::VecDeque">VecDeque</a><<a class="struct" href="../../geom/time/struct.Time.html" title="struct geom::time::Time">Time</a>></code></span><span id="structfield.window_size" class="structfield small-section-header"><a href="#structfield.window_size" class="anchor field"></a><code>window_size: <a class="struct" href="../../geom/duration/struct.Duration.html" title="struct geom::duration::Duration">Duration</a></code></span><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><h3 id="impl" class="impl"><code class="in-band">impl <a class="struct" href="../../sim/analytics/struct.Window.html" title="struct sim::analytics::Window">Window</a></code><a href="#impl" class="anchor"></a><a class="srclink" href="../../src/sim/analytics.rs.html#635-656" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.new" class="method"><code>pub fn <a href="#method.new" class="fnname">new</a>(window_size: <a class="struct" href="../../geom/duration/struct.Duration.html" title="struct geom::duration::Duration">Duration</a>) -> <a class="struct" href="../../sim/analytics/struct.Window.html" title="struct sim::analytics::Window">Window</a></code><a class="srclink" href="../../src/sim/analytics.rs.html#636-641" title="goto source code">[src]</a></h4><h4 id="method.add" class="method"><code>pub fn <a href="#method.add" class="fnname">add</a>(&mut self, time: <a class="struct" href="../../geom/time/struct.Time.html" title="struct geom::time::Time">Time</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code><a class="srclink" href="../../src/sim/analytics.rs.html#644-647" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns the count at time</p>
|
||||
</div><h4 id="method.count" class="method"><code>pub fn <a href="#method.count" class="fnname">count</a>(&mut self, end: <a class="struct" href="../../geom/time/struct.Time.html" title="struct geom::time::Time">Time</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code><a class="srclink" href="../../src/sim/analytics.rs.html#650-655" title="goto source code">[src]</a></h4><div class="docblock"><p>Grab the count at this time, but don't add a new time</p>
|
||||
</div></div><h2 id="synthetic-implementations" class="small-section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor"></a></h2><div id="synthetic-implementations-list"><h3 id="impl-RefUnwindSafe" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../../sim/analytics/struct.Window.html" title="struct sim::analytics::Window">Window</a></code><a href="#impl-RefUnwindSafe" class="anchor"></a></h3><div class="impl-items"></div><h3 id="impl-Send" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../../sim/analytics/struct.Window.html" title="struct sim::analytics::Window">Window</a></code><a href="#impl-Send" class="anchor"></a></h3><div class="impl-items"></div><h3 id="impl-Sync" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../../sim/analytics/struct.Window.html" title="struct sim::analytics::Window">Window</a></code><a href="#impl-Sync" class="anchor"></a></h3><div class="impl-items"></div><h3 id="impl-Unpin" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../../sim/analytics/struct.Window.html" title="struct sim::analytics::Window">Window</a></code><a href="#impl-Unpin" class="anchor"></a></h3><div class="impl-items"></div><h3 id="impl-UnwindSafe" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../../sim/analytics/struct.Window.html" title="struct sim::analytics::Window">Window</a></code><a href="#impl-UnwindSafe" class="anchor"></a></h3><div class="impl-items"></div></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><h3 id="impl-Any" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href="#impl-Any" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.type_id" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id" class="fnname">type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
|
||||
</div></div><h3 id="impl-Borrow%3CT%3E" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href="#impl-Borrow%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow" class="fnname">borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#211-213" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
|
||||
</div></div><h3 id="impl-BorrowMut%3CT%3E" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href="#impl-BorrowMut%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#217-221" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fnname">borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218-220" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
|
||||
|
@ -122,7 +122,7 @@
|
||||
<span class="doccomment">/// The output of `rustdoc -V`</span>
|
||||
<span class="kw">pub</span> <span class="kw">const</span> <span class="ident">RUSTDOC_VERSION</span>: <span class="kw-2">&</span><span class="ident">str</span> <span class="op">=</span> <span class="string">"rustdoc 1.49.0 (e1884a8e3 2020-12-29)"</span>;
|
||||
<span class="doccomment">/// The built-time in RFC2822, UTC</span>
|
||||
<span class="kw">pub</span> <span class="kw">const</span> <span class="ident">BUILT_TIME_UTC</span>: <span class="kw-2">&</span><span class="ident">str</span> <span class="op">=</span> <span class="string">"Mon, 01 Feb 2021 18:44:06 +0000"</span>;
|
||||
<span class="kw">pub</span> <span class="kw">const</span> <span class="ident">BUILT_TIME_UTC</span>: <span class="kw-2">&</span><span class="ident">str</span> <span class="op">=</span> <span class="string">"Mon, 01 Feb 2021 19:11:11 +0000"</span>;
|
||||
<span class="doccomment">/// The target architecture, given by `cfg!(target_arch)`.</span>
|
||||
<span class="kw">pub</span> <span class="kw">const</span> <span class="ident">CFG_TARGET_ARCH</span>: <span class="kw-2">&</span><span class="ident">str</span> <span class="op">=</span> <span class="string">"x86_64"</span>;
|
||||
<span class="doccomment">/// The endianness, given by `cfg!(target_endian)`.</span>
|
||||
|
@ -270,8 +270,14 @@
|
||||
<span id="267">267</span>
|
||||
<span id="268">268</span>
|
||||
<span id="269">269</span>
|
||||
<span id="270">270</span>
|
||||
<span id="271">271</span>
|
||||
<span id="272">272</span>
|
||||
<span id="273">273</span>
|
||||
<span id="274">274</span>
|
||||
</pre><div class="example-wrap"><pre class="rust ">
|
||||
<span class="kw">use</span> <span class="ident">map_gui</span>::<span class="ident">tools</span>::{<span class="ident">grey_out_map</span>, <span class="ident">HeatmapOptions</span>};
|
||||
<span class="kw">use</span> <span class="ident">sim</span>::<span class="ident">AgentType</span>;
|
||||
<span class="kw">use</span> <span class="ident">widgetry</span>::{
|
||||
<span class="ident">DrawBaselayer</span>, <span class="ident">EventCtx</span>, <span class="ident">GfxCtx</span>, <span class="ident">Key</span>, <span class="ident">Line</span>, <span class="ident">Outcome</span>, <span class="ident">Panel</span>, <span class="ident">State</span>, <span class="ident">StyledButtons</span>, <span class="ident">TextExt</span>,
|
||||
<span class="ident">Widget</span>,
|
||||
@ -494,7 +500,11 @@
|
||||
)));
|
||||
}
|
||||
<span class="string">"throughput"</span> <span class="op">=</span><span class="op">></span> {
|
||||
<span class="ident">app</span>.<span class="ident">primary</span>.<span class="ident">layer</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="ident">Box</span>::<span class="ident">new</span>(<span class="ident">traffic</span>::<span class="ident">Throughput</span>::<span class="ident">new</span>(<span class="ident">ctx</span>, <span class="ident">app</span>)));
|
||||
<span class="ident">app</span>.<span class="ident">primary</span>.<span class="ident">layer</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="ident">Box</span>::<span class="ident">new</span>(<span class="ident">traffic</span>::<span class="ident">Throughput</span>::<span class="ident">new</span>(
|
||||
<span class="ident">ctx</span>,
|
||||
<span class="ident">app</span>,
|
||||
<span class="ident">AgentType</span>::<span class="ident">all</span>().<span class="ident">into_iter</span>().<span class="ident">collect</span>(),
|
||||
)));
|
||||
}
|
||||
<span class="string">"traffic jams"</span> <span class="op">=</span><span class="op">></span> {
|
||||
<span class="ident">app</span>.<span class="ident">primary</span>.<span class="ident">layer</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="ident">Box</span>::<span class="ident">new</span>(<span class="ident">traffic</span>::<span class="ident">TrafficJams</span>::<span class="ident">new</span>(<span class="ident">ctx</span>, <span class="ident">app</span>)));
|
||||
|
@ -566,18 +566,61 @@
|
||||
<span id="563">563</span>
|
||||
<span id="564">564</span>
|
||||
<span id="565">565</span>
|
||||
<span id="566">566</span>
|
||||
<span id="567">567</span>
|
||||
<span id="568">568</span>
|
||||
<span id="569">569</span>
|
||||
<span id="570">570</span>
|
||||
<span id="571">571</span>
|
||||
<span id="572">572</span>
|
||||
<span id="573">573</span>
|
||||
<span id="574">574</span>
|
||||
<span id="575">575</span>
|
||||
<span id="576">576</span>
|
||||
<span id="577">577</span>
|
||||
<span id="578">578</span>
|
||||
<span id="579">579</span>
|
||||
<span id="580">580</span>
|
||||
<span id="581">581</span>
|
||||
<span id="582">582</span>
|
||||
<span id="583">583</span>
|
||||
<span id="584">584</span>
|
||||
<span id="585">585</span>
|
||||
<span id="586">586</span>
|
||||
<span id="587">587</span>
|
||||
<span id="588">588</span>
|
||||
<span id="589">589</span>
|
||||
<span id="590">590</span>
|
||||
<span id="591">591</span>
|
||||
<span id="592">592</span>
|
||||
<span id="593">593</span>
|
||||
<span id="594">594</span>
|
||||
<span id="595">595</span>
|
||||
<span id="596">596</span>
|
||||
<span id="597">597</span>
|
||||
<span id="598">598</span>
|
||||
<span id="599">599</span>
|
||||
<span id="600">600</span>
|
||||
<span id="601">601</span>
|
||||
<span id="602">602</span>
|
||||
<span id="603">603</span>
|
||||
<span id="604">604</span>
|
||||
<span id="605">605</span>
|
||||
<span id="606">606</span>
|
||||
<span id="607">607</span>
|
||||
<span id="608">608</span>
|
||||
</pre><div class="example-wrap"><pre class="rust ">
|
||||
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">collections</span>::<span class="ident">BTreeSet</span>;
|
||||
|
||||
<span class="kw">use</span> <span class="ident">maplit</span>::<span class="ident">btreeset</span>;
|
||||
|
||||
<span class="kw">use</span> <span class="ident">abstutil</span>::{<span class="ident">prettyprint_usize</span>, <span class="ident">Counter</span>};
|
||||
<span class="kw">use</span> <span class="ident">geom</span>::{<span class="ident">Circle</span>, <span class="ident">Distance</span>, <span class="ident">Duration</span>, <span class="ident">Polygon</span>, <span class="ident">Pt2D</span>, <span class="ident">Time</span>};
|
||||
<span class="kw">use</span> <span class="ident">geom</span>::{<span class="ident">Circle</span>, <span class="ident">Distance</span>, <span class="ident">Duration</span>, <span class="ident">Percent</span>, <span class="ident">Polygon</span>, <span class="ident">Pt2D</span>, <span class="ident">Time</span>};
|
||||
<span class="kw">use</span> <span class="ident">map_gui</span>::<span class="ident">render</span>::<span class="ident">unzoomed_agent_radius</span>;
|
||||
<span class="kw">use</span> <span class="ident">map_gui</span>::<span class="ident">tools</span>::{<span class="ident">ColorLegend</span>, <span class="ident">ColorNetwork</span>, <span class="ident">DivergingScale</span>};
|
||||
<span class="kw">use</span> <span class="ident">map_gui</span>::<span class="ident">ID</span>;
|
||||
<span class="kw">use</span> <span class="ident">map_model</span>::{<span class="ident">IntersectionID</span>, <span class="ident">Map</span>, <span class="ident">Traversable</span>};
|
||||
<span class="kw">use</span> <span class="ident">sim</span>::<span class="ident">VehicleType</span>;
|
||||
<span class="kw">use</span> <span class="ident">sim</span>::{<span class="ident">AgentType</span>, <span class="ident">VehicleType</span>};
|
||||
<span class="kw">use</span> <span class="ident">widgetry</span>::{
|
||||
<span class="ident">Checkbox</span>, <span class="ident">Color</span>, <span class="ident">Drawable</span>, <span class="ident">EventCtx</span>, <span class="ident">GeomBatch</span>, <span class="ident">GfxCtx</span>, <span class="ident">HorizontalAlignment</span>, <span class="ident">Line</span>, <span class="ident">Outcome</span>,
|
||||
<span class="ident">Panel</span>, <span class="ident">Text</span>, <span class="ident">TextExt</span>, <span class="ident">VerticalAlignment</span>, <span class="ident">Widget</span>,
|
||||
@ -670,9 +713,9 @@
|
||||
}
|
||||
}
|
||||
|
||||
<span class="comment">// TODO Filter by mode</span>
|
||||
<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">Throughput</span> {
|
||||
<span class="ident">time</span>: <span class="ident">Time</span>,
|
||||
<span class="ident">agent_types</span>: <span class="ident">BTreeSet</span><span class="op"><</span><span class="ident">AgentType</span><span class="op">></span>,
|
||||
<span class="ident">tooltip</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Text</span><span class="op">></span>,
|
||||
<span class="ident">unzoomed</span>: <span class="ident">Drawable</span>,
|
||||
<span class="ident">zoomed</span>: <span class="ident">Drawable</span>,
|
||||
@ -691,7 +734,7 @@
|
||||
) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">LayerOutcome</span><span class="op">></span> {
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">recalc_tooltip</span> <span class="op">=</span> <span class="bool-val">false</span>;
|
||||
<span class="kw">if</span> <span class="ident">app</span>.<span class="ident">primary</span>.<span class="ident">sim</span>.<span class="ident">time</span>() <span class="op">!</span><span class="op">=</span> <span class="self">self</span>.<span class="ident">time</span> {
|
||||
<span class="kw-2">*</span><span class="self">self</span> <span class="op">=</span> <span class="ident">Throughput</span>::<span class="ident">new</span>(<span class="ident">ctx</span>, <span class="ident">app</span>);
|
||||
<span class="kw-2">*</span><span class="self">self</span> <span class="op">=</span> <span class="ident">Throughput</span>::<span class="ident">new</span>(<span class="ident">ctx</span>, <span class="ident">app</span>, <span class="self">self</span>.<span class="ident">agent_types</span>.<span class="ident">clone</span>());
|
||||
<span class="ident">recalc_tooltip</span> <span class="op">=</span> <span class="bool-val">true</span>;
|
||||
}
|
||||
|
||||
@ -701,7 +744,12 @@
|
||||
<span class="self">self</span>.<span class="ident">tooltip</span> <span class="op">=</span> <span class="prelude-val">None</span>;
|
||||
<span class="kw">match</span> <span class="ident">app</span>.<span class="ident">mouseover_unzoomed_roads_and_intersections</span>(<span class="ident">ctx</span>) {
|
||||
<span class="prelude-val">Some</span>(<span class="ident">ID</span>::<span class="ident">Road</span>(<span class="ident">r</span>)) <span class="op">=</span><span class="op">></span> {
|
||||
<span class="kw">let</span> <span class="ident">cnt</span> <span class="op">=</span> <span class="ident">app</span>.<span class="ident">primary</span>.<span class="ident">sim</span>.<span class="ident">get_analytics</span>().<span class="ident">road_thruput</span>.<span class="ident">total_for</span>(<span class="ident">r</span>);
|
||||
<span class="kw">let</span> <span class="ident">cnt</span> <span class="op">=</span> <span class="ident">app</span>
|
||||
.<span class="ident">primary</span>
|
||||
.<span class="ident">sim</span>
|
||||
.<span class="ident">get_analytics</span>()
|
||||
.<span class="ident">road_thruput</span>
|
||||
.<span class="ident">total_for_with_agent_types</span>(<span class="ident">r</span>, <span class="self">self</span>.<span class="ident">agent_types</span>.<span class="ident">clone</span>());
|
||||
<span class="kw">if</span> <span class="ident">cnt</span> <span class="op">></span> <span class="number">0</span> {
|
||||
<span class="self">self</span>.<span class="ident">tooltip</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="ident">Text</span>::<span class="ident">from</span>(<span class="ident">Line</span>(<span class="ident">prettyprint_usize</span>(<span class="ident">cnt</span>))));
|
||||
}
|
||||
@ -712,7 +760,7 @@
|
||||
.<span class="ident">sim</span>
|
||||
.<span class="ident">get_analytics</span>()
|
||||
.<span class="ident">intersection_thruput</span>
|
||||
.<span class="ident">total_for</span>(<span class="ident">i</span>);
|
||||
.<span class="ident">total_for_with_agent_types</span>(<span class="ident">i</span>, <span class="self">self</span>.<span class="ident">agent_types</span>.<span class="ident">clone</span>());
|
||||
<span class="kw">if</span> <span class="ident">cnt</span> <span class="op">></span> <span class="number">0</span> {
|
||||
<span class="self">self</span>.<span class="ident">tooltip</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="ident">Text</span>::<span class="ident">from</span>(<span class="ident">Line</span>(<span class="ident">prettyprint_usize</span>(<span class="ident">cnt</span>))));
|
||||
}
|
||||
@ -733,8 +781,27 @@
|
||||
<span class="kw">_</span> <span class="op">=</span><span class="op">></span> <span class="macro">unreachable</span><span class="macro">!</span>(),
|
||||
},
|
||||
<span class="ident">Outcome</span>::<span class="ident">Changed</span> <span class="op">=</span><span class="op">></span> {
|
||||
<span class="kw">return</span> <span class="prelude-val">Some</span>(<span class="ident">LayerOutcome</span>::<span class="ident">Replace</span>(<span class="ident">Box</span>::<span class="ident">new</span>(<span class="ident">CompareThroughput</span>::<span class="ident">new</span>(
|
||||
<span class="ident">ctx</span>, <span class="ident">app</span>,
|
||||
<span class="kw">if</span> <span class="self">self</span>
|
||||
.<span class="ident">panel</span>
|
||||
.<span class="ident">maybe_is_checked</span>(<span class="string">"Compare before proposal"</span>)
|
||||
.<span class="ident">unwrap_or</span>(<span class="bool-val">false</span>)
|
||||
{
|
||||
<span class="kw">return</span> <span class="prelude-val">Some</span>(<span class="ident">LayerOutcome</span>::<span class="ident">Replace</span>(<span class="ident">Box</span>::<span class="ident">new</span>(<span class="ident">CompareThroughput</span>::<span class="ident">new</span>(
|
||||
<span class="ident">ctx</span>, <span class="ident">app</span>,
|
||||
))));
|
||||
}
|
||||
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">agent_types</span> <span class="op">=</span> <span class="ident">BTreeSet</span>::<span class="ident">new</span>();
|
||||
<span class="kw">for</span> <span class="ident">agent_type</span> <span class="kw">in</span> <span class="ident">AgentType</span>::<span class="ident">all</span>() {
|
||||
<span class="kw">if</span> <span class="self">self</span>.<span class="ident">panel</span>.<span class="ident">is_checked</span>(<span class="ident">agent_type</span>.<span class="ident">noun</span>()) {
|
||||
<span class="ident">agent_types</span>.<span class="ident">insert</span>(<span class="ident">agent_type</span>);
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">return</span> <span class="prelude-val">Some</span>(<span class="ident">LayerOutcome</span>::<span class="ident">Replace</span>(<span class="ident">Box</span>::<span class="ident">new</span>(<span class="ident">Throughput</span>::<span class="ident">new</span>(
|
||||
<span class="ident">ctx</span>,
|
||||
<span class="ident">app</span>,
|
||||
<span class="ident">agent_types</span>,
|
||||
))));
|
||||
}
|
||||
<span class="kw">_</span> <span class="op">=</span><span class="op">></span> {}
|
||||
@ -758,10 +825,10 @@
|
||||
}
|
||||
|
||||
<span class="kw">impl</span> <span class="ident">Throughput</span> {
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">new</span>(<span class="ident">ctx</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">EventCtx</span>, <span class="ident">app</span>: <span class="kw-2">&</span><span class="ident">App</span>) <span class="op">-</span><span class="op">></span> <span class="ident">Throughput</span> {
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">new</span>(<span class="ident">ctx</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">EventCtx</span>, <span class="ident">app</span>: <span class="kw-2">&</span><span class="ident">App</span>, <span class="ident">agent_types</span>: <span class="ident">BTreeSet</span><span class="op"><</span><span class="ident">AgentType</span><span class="op">></span>) <span class="op">-</span><span class="op">></span> <span class="ident">Throughput</span> {
|
||||
<span class="kw">let</span> <span class="ident">stats</span> <span class="op">=</span> <span class="kw-2">&</span><span class="ident">app</span>.<span class="ident">primary</span>.<span class="ident">sim</span>.<span class="ident">get_analytics</span>();
|
||||
<span class="kw">let</span> <span class="ident">road_counter</span> <span class="op">=</span> <span class="ident">stats</span>.<span class="ident">road_thruput</span>.<span class="ident">all_total_counts</span>();
|
||||
<span class="kw">let</span> <span class="ident">intersection_counter</span> <span class="op">=</span> <span class="ident">stats</span>.<span class="ident">intersection_thruput</span>.<span class="ident">all_total_counts</span>();
|
||||
<span class="kw">let</span> <span class="ident">road_counter</span> <span class="op">=</span> <span class="ident">stats</span>.<span class="ident">road_thruput</span>.<span class="ident">all_total_counts</span>(<span class="kw-2">&</span><span class="ident">agent_types</span>);
|
||||
<span class="kw">let</span> <span class="ident">intersection_counter</span> <span class="op">=</span> <span class="ident">stats</span>.<span class="ident">intersection_thruput</span>.<span class="ident">all_total_counts</span>(<span class="kw-2">&</span><span class="ident">agent_types</span>);
|
||||
<span class="kw">let</span> <span class="ident">panel</span> <span class="op">=</span> <span class="ident">Panel</span>::<span class="ident">new</span>(<span class="ident">Widget</span>::<span class="ident">col</span>(<span class="macro">vec</span><span class="macro">!</span>[
|
||||
<span class="ident">header</span>(<span class="ident">ctx</span>, <span class="string">"Throughput"</span>),
|
||||
<span class="ident">Text</span>::<span class="ident">from</span>(<span class="ident">Line</span>(<span class="string">"This counts all people crossing since midnight"</span>).<span class="ident">secondary</span>())
|
||||
@ -772,6 +839,20 @@
|
||||
} <span class="kw">else</span> {
|
||||
<span class="ident">Widget</span>::<span class="ident">nothing</span>()
|
||||
},
|
||||
<span class="ident">Widget</span>::<span class="ident">custom_row</span>(
|
||||
<span class="ident">AgentType</span>::<span class="ident">all</span>()
|
||||
.<span class="ident">into_iter</span>()
|
||||
.<span class="ident">map</span>(<span class="op">|</span><span class="ident">agent_type</span><span class="op">|</span> {
|
||||
<span class="ident">Checkbox</span>::<span class="ident">checkbox</span>(
|
||||
<span class="ident">ctx</span>,
|
||||
<span class="ident">agent_type</span>.<span class="ident">noun</span>(),
|
||||
<span class="prelude-val">None</span>,
|
||||
<span class="ident">agent_types</span>.<span class="ident">contains</span>(<span class="kw-2">&</span><span class="ident">agent_type</span>),
|
||||
)
|
||||
})
|
||||
.<span class="ident">collect</span>(),
|
||||
)
|
||||
.<span class="ident">flex_wrap</span>(<span class="ident">ctx</span>, <span class="ident">Percent</span>::<span class="ident">int</span>(<span class="number">20</span>)),
|
||||
<span class="ident">ColorLegend</span>::<span class="ident">gradient</span>(<span class="ident">ctx</span>, <span class="kw-2">&</span><span class="ident">app</span>.<span class="ident">cs</span>.<span class="ident">good_to_bad_red</span>, <span class="macro">vec</span><span class="macro">!</span>[<span class="string">"0"</span>, <span class="string">"highest"</span>]),
|
||||
]))
|
||||
.<span class="ident">aligned</span>(<span class="ident">HorizontalAlignment</span>::<span class="ident">Right</span>, <span class="ident">VerticalAlignment</span>::<span class="ident">Center</span>)
|
||||
@ -784,6 +865,7 @@
|
||||
|
||||
<span class="ident">Throughput</span> {
|
||||
<span class="ident">time</span>: <span class="ident">app</span>.<span class="ident">primary</span>.<span class="ident">sim</span>.<span class="ident">time</span>(),
|
||||
<span class="ident">agent_types</span>,
|
||||
<span class="ident">tooltip</span>: <span class="prelude-val">None</span>,
|
||||
<span class="ident">unzoomed</span>,
|
||||
<span class="ident">zoomed</span>,
|
||||
@ -822,7 +904,11 @@
|
||||
<span class="kw">_</span> <span class="op">=</span><span class="op">></span> <span class="macro">unreachable</span><span class="macro">!</span>(),
|
||||
},
|
||||
<span class="ident">Outcome</span>::<span class="ident">Changed</span> <span class="op">=</span><span class="op">></span> {
|
||||
<span class="kw">return</span> <span class="prelude-val">Some</span>(<span class="ident">LayerOutcome</span>::<span class="ident">Replace</span>(<span class="ident">Box</span>::<span class="ident">new</span>(<span class="ident">Throughput</span>::<span class="ident">new</span>(<span class="ident">ctx</span>, <span class="ident">app</span>))));
|
||||
<span class="kw">return</span> <span class="prelude-val">Some</span>(<span class="ident">LayerOutcome</span>::<span class="ident">Replace</span>(<span class="ident">Box</span>::<span class="ident">new</span>(<span class="ident">Throughput</span>::<span class="ident">new</span>(
|
||||
<span class="ident">ctx</span>,
|
||||
<span class="ident">app</span>,
|
||||
<span class="ident">AgentType</span>::<span class="ident">all</span>().<span class="ident">into_iter</span>().<span class="ident">collect</span>(),
|
||||
))));
|
||||
}
|
||||
<span class="kw">_</span> <span class="op">=</span><span class="op">></span> {}
|
||||
}
|
||||
|
@ -651,8 +651,14 @@
|
||||
<span id="648">648</span>
|
||||
<span id="649">649</span>
|
||||
<span id="650">650</span>
|
||||
<span id="651">651</span>
|
||||
<span id="652">652</span>
|
||||
<span id="653">653</span>
|
||||
<span id="654">654</span>
|
||||
<span id="655">655</span>
|
||||
<span id="656">656</span>
|
||||
</pre><div class="example-wrap"><pre class="rust ">
|
||||
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">collections</span>::{<span class="ident">BTreeMap</span>, <span class="ident">VecDeque</span>};
|
||||
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">collections</span>::{<span class="ident">BTreeMap</span>, <span class="ident">BTreeSet</span>, <span class="ident">VecDeque</span>};
|
||||
|
||||
<span class="kw">use</span> <span class="ident">serde</span>::{<span class="ident">Deserialize</span>, <span class="ident">Serialize</span>};
|
||||
|
||||
@ -1194,8 +1200,12 @@
|
||||
}
|
||||
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">total_for</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">id</span>: <span class="ident">X</span>) <span class="op">-</span><span class="op">></span> <span class="ident">usize</span> {
|
||||
<span class="self">self</span>.<span class="ident">total_for_with_agent_types</span>(<span class="ident">id</span>, <span class="ident">AgentType</span>::<span class="ident">all</span>().<span class="ident">into_iter</span>().<span class="ident">collect</span>())
|
||||
}
|
||||
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">total_for_with_agent_types</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">id</span>: <span class="ident">X</span>, <span class="ident">agent_types</span>: <span class="ident">BTreeSet</span><span class="op"><</span><span class="ident">AgentType</span><span class="op">></span>) <span class="op">-</span><span class="op">></span> <span class="ident">usize</span> {
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">cnt</span> <span class="op">=</span> <span class="number">0</span>;
|
||||
<span class="kw">for</span> <span class="ident">agent_type</span> <span class="kw">in</span> <span class="ident">AgentType</span>::<span class="ident">all</span>() {
|
||||
<span class="kw">for</span> <span class="ident">agent_type</span> <span class="kw">in</span> <span class="ident">agent_types</span> {
|
||||
<span class="comment">// TODO Hmm</span>
|
||||
<span class="kw">for</span> <span class="ident">hour</span> <span class="kw">in</span> <span class="number">0</span>..<span class="number">24</span> {
|
||||
<span class="ident">cnt</span> <span class="op">+</span><span class="op">=</span> <span class="self">self</span>
|
||||
@ -1208,10 +1218,12 @@
|
||||
<span class="ident">cnt</span>
|
||||
}
|
||||
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">all_total_counts</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="ident">Counter</span><span class="op"><</span><span class="ident">X</span><span class="op">></span> {
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">all_total_counts</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">agent_types</span>: <span class="kw-2">&</span><span class="ident">BTreeSet</span><span class="op"><</span><span class="ident">AgentType</span><span class="op">></span>) <span class="op">-</span><span class="op">></span> <span class="ident">Counter</span><span class="op"><</span><span class="ident">X</span><span class="op">></span> {
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">cnt</span> <span class="op">=</span> <span class="ident">Counter</span>::<span class="ident">new</span>();
|
||||
<span class="kw">for</span> ((<span class="ident">id</span>, <span class="kw">_</span>, <span class="kw">_</span>), <span class="ident">value</span>) <span class="kw">in</span> <span class="kw-2">&</span><span class="self">self</span>.<span class="ident">counts</span> {
|
||||
<span class="ident">cnt</span>.<span class="ident">add</span>(<span class="ident">id</span>.<span class="ident">clone</span>(), <span class="kw-2">*</span><span class="ident">value</span>);
|
||||
<span class="kw">for</span> ((<span class="ident">id</span>, <span class="ident">agent_type</span>, <span class="kw">_</span>), <span class="ident">value</span>) <span class="kw">in</span> <span class="kw-2">&</span><span class="self">self</span>.<span class="ident">counts</span> {
|
||||
<span class="kw">if</span> <span class="ident">agent_types</span>.<span class="ident">contains</span>(<span class="kw-2">&</span><span class="ident">agent_type</span>) {
|
||||
<span class="ident">cnt</span>.<span class="ident">add</span>(<span class="ident">id</span>.<span class="ident">clone</span>(), <span class="kw-2">*</span><span class="ident">value</span>);
|
||||
}
|
||||
}
|
||||
<span class="ident">cnt</span>
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user