mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-11-25 11:44:25 +03:00
deploy: 50c9c3236d
This commit is contained in:
parent
cd054d1a12
commit
f7dd005a8e
@ -1,3 +1,3 @@
|
||||
<!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 src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><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!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></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-e788b46a21eaee2a/out/built.rs.html#49' 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> = "Fri, 23 Oct 2020 01:43:24 +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-e788b46a21eaee2a/out/built.rs.html#49' 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> = "Fri, 23 Oct 2020 03:17:32 +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>
|
@ -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 `sim` mod in crate `sim`."><meta name="keywords" content="rust, rustlang, rust-lang, sim"><title>sim::sim - 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 src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><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 sim</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#reexports">Re-exports</a></li><li><a href="#modules">Modules</a></li><li><a href="#structs">Structs</a></li><li><a href="#enums">Enums</a></li><li><a href="#constants">Constants</a></li><li><a href="#traits">Traits</a></li></ul></div><p class='location'><a href='../index.html'>sim</a></p><script>window.sidebarCurrent = {name: 'sim', 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!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></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/sim/mod.rs.html#3-1042' title='goto source code'>[src]</a></span><span class='in-band'>Module <a href='../index.html'>sim</a>::<wbr><a class="mod" href=''>sim</a></span></h1><h2 id='reexports' class='section-header'><a href="#reexports">Re-exports</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/sim/mod.rs.html#3-1077' title='goto source code'>[src]</a></span><span class='in-band'>Module <a href='../index.html'>sim</a>::<wbr><a class="mod" href=''>sim</a></span></h1><h2 id='reexports' class='section-header'><a href="#reexports">Re-exports</a></h2>
|
||||
<table><tr><td><code>pub use self::queries::<a class="struct" href="../../sim/struct.AgentProperties.html" title="struct sim::AgentProperties">AgentProperties</a>;</code></td></tr></table><h2 id='modules' class='section-header'><a href="#modules">Modules</a></h2>
|
||||
<table><tr class='module-item'><td><a class="mod" href="queries/index.html" title='sim::sim::queries mod'>queries</a></td><td class='docblock-short'><p>All sorts of read-only queries about a simulation</p>
|
||||
</td></tr></table><h2 id='structs' class='section-header'><a href="#structs">Structs</a></h2>
|
||||
|
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 `SimCallback` trait in crate `sim`."><meta name="keywords" content="rust, rustlang, rust-lang, SimCallback"><title>sim::sim::SimCallback - 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 src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc trait"><!--[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'>Trait SimCallback</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#required-methods">Required Methods</a><div class="sidebar-links"><a href="#tymethod.run">run</a></div><a class="sidebar-title" href="#implementations">Methods</a><div class="sidebar-links"><a href="#method.downcast">downcast</a><a href="#method.downcast_mut">downcast_mut</a><a href="#method.downcast_rc">downcast_rc</a><a href="#method.downcast_ref">downcast_ref</a><a href="#method.is">is</a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class='location'><a href='../index.html'>sim</a>::<wbr><a href='index.html'>sim</a></p><script>window.sidebarCurrent = {name: 'SimCallback', ty: 'trait', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></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/sim/mod.rs.html#1024-1027' title='goto source code'>[src]</a></span><span class='in-band'>Trait <a href='../index.html'>sim</a>::<wbr><a href='index.html'>sim</a>::<wbr><a class="trait" href=''>SimCallback</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust trait'>pub trait SimCallback: Downcast {
|
||||
<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/sim/mod.rs.html#1059-1062' title='goto source code'>[src]</a></span><span class='in-band'>Trait <a href='../index.html'>sim</a>::<wbr><a href='index.html'>sim</a>::<wbr><a class="trait" href=''>SimCallback</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust trait'>pub trait SimCallback: Downcast {
|
||||
fn <a href='#tymethod.run' class='fnname'>run</a>(&mut self, sim: &<a class="struct" href="../../sim/struct.Sim.html" title="struct sim::Sim">Sim</a>, map: &<a class="struct" href="../../map_model/struct.Map.html" title="struct map_model::Map">Map</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>;
|
||||
}</pre></div>
|
||||
<h2 id='required-methods' class='small-section-header'>Required methods<a href='#required-methods' class='anchor'></a></h2><div class='methods'><h3 id='tymethod.run' class='method'><code>fn <a href='#tymethod.run' class='fnname'>run</a>(&mut self, sim: &<a class="struct" href="../../sim/struct.Sim.html" title="struct sim::Sim">Sim</a>, map: &<a class="struct" href="../../map_model/struct.Map.html" title="struct map_model::Map">Map</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></h3></div><span class='loading-content'>Loading content...</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 dyn <a class="trait" href="../../sim/sim/trait.SimCallback.html" title="trait sim::sim::SimCallback">SimCallback</a></code><a href='#impl' class='anchor'></a></h3><div class='impl-items'><h4 id='method.is' class="method"><code>pub fn <a href='#method.is' class='fnname'>is</a><__T: <a class="trait" href="../../sim/sim/trait.SimCallback.html" title="trait sim::sim::SimCallback">SimCallback</a>>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></h4><div class='docblock'><p>Returns true if the trait object wraps an object of type <code>__T</code>.</p>
|
||||
|
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 `SimCallback` trait in crate `sim`."><meta name="keywords" content="rust, rustlang, rust-lang, SimCallback"><title>sim::SimCallback - 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 src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="shortcut icon" href="../favicon.ico"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc trait"><!--[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'>Trait SimCallback</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#required-methods">Required Methods</a><div class="sidebar-links"><a href="#tymethod.run">run</a></div><a class="sidebar-title" href="#implementations">Methods</a><div class="sidebar-links"><a href="#method.downcast">downcast</a><a href="#method.downcast_mut">downcast_mut</a><a href="#method.downcast_rc">downcast_rc</a><a href="#method.downcast_ref">downcast_ref</a><a href="#method.is">is</a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class='location'><a href='index.html'>sim</a></p><script>window.sidebarCurrent = {name: 'SimCallback', ty: 'trait', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></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/sim/mod.rs.html#1024-1027' title='goto source code'>[src]</a></span><span class='in-band'>Trait <a href='index.html'>sim</a>::<wbr><a class="trait" href=''>SimCallback</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust trait'>pub trait SimCallback: Downcast {
|
||||
<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/sim/mod.rs.html#1059-1062' title='goto source code'>[src]</a></span><span class='in-band'>Trait <a href='index.html'>sim</a>::<wbr><a class="trait" href=''>SimCallback</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust trait'>pub trait SimCallback: Downcast {
|
||||
fn <a href='#tymethod.run' class='fnname'>run</a>(&mut self, sim: &<a class="struct" href="../sim/struct.Sim.html" title="struct sim::Sim">Sim</a>, map: &<a class="struct" href="../map_model/struct.Map.html" title="struct map_model::Map">Map</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>;
|
||||
}</pre></div>
|
||||
<h2 id='required-methods' class='small-section-header'>Required methods<a href='#required-methods' class='anchor'></a></h2><div class='methods'><h3 id='tymethod.run' class='method'><code>fn <a href='#tymethod.run' class='fnname'>run</a>(&mut self, sim: &<a class="struct" href="../sim/struct.Sim.html" title="struct sim::Sim">Sim</a>, map: &<a class="struct" href="../map_model/struct.Map.html" title="struct map_model::Map">Map</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></h3></div><span class='loading-content'>Loading content...</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 dyn <a class="trait" href="../sim/sim/trait.SimCallback.html" title="trait sim::sim::SimCallback">SimCallback</a></code><a href='#impl' class='anchor'></a></h3><div class='impl-items'><h4 id='method.is' class="method"><code>pub fn <a href='#method.is' class='fnname'>is</a><__T: <a class="trait" href="../sim/sim/trait.SimCallback.html" title="trait sim::sim::SimCallback">SimCallback</a>>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></h4><div class='docblock'><p>Returns true if the trait object wraps an object of type <code>__T</code>.</p>
|
||||
|
@ -112,7 +112,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.47.0 (18bf6b4f0 2020-10-07)"</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">"Fri, 23 Oct 2020 01:43:24 +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">"Fri, 23 Oct 2020 03:17:32 +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>
|
||||
|
@ -1041,6 +1041,41 @@
|
||||
<span id="1040">1040</span>
|
||||
<span id="1041">1041</span>
|
||||
<span id="1042">1042</span>
|
||||
<span id="1043">1043</span>
|
||||
<span id="1044">1044</span>
|
||||
<span id="1045">1045</span>
|
||||
<span id="1046">1046</span>
|
||||
<span id="1047">1047</span>
|
||||
<span id="1048">1048</span>
|
||||
<span id="1049">1049</span>
|
||||
<span id="1050">1050</span>
|
||||
<span id="1051">1051</span>
|
||||
<span id="1052">1052</span>
|
||||
<span id="1053">1053</span>
|
||||
<span id="1054">1054</span>
|
||||
<span id="1055">1055</span>
|
||||
<span id="1056">1056</span>
|
||||
<span id="1057">1057</span>
|
||||
<span id="1058">1058</span>
|
||||
<span id="1059">1059</span>
|
||||
<span id="1060">1060</span>
|
||||
<span id="1061">1061</span>
|
||||
<span id="1062">1062</span>
|
||||
<span id="1063">1063</span>
|
||||
<span id="1064">1064</span>
|
||||
<span id="1065">1065</span>
|
||||
<span id="1066">1066</span>
|
||||
<span id="1067">1067</span>
|
||||
<span id="1068">1068</span>
|
||||
<span id="1069">1069</span>
|
||||
<span id="1070">1070</span>
|
||||
<span id="1071">1071</span>
|
||||
<span id="1072">1072</span>
|
||||
<span id="1073">1073</span>
|
||||
<span id="1074">1074</span>
|
||||
<span id="1075">1075</span>
|
||||
<span id="1076">1076</span>
|
||||
<span id="1077">1077</span>
|
||||
</pre><div class="example-wrap"><pre class="rust ">
|
||||
<span class="comment">// This file has a jumbled mess of queries, setup, and mutating methods.</span>
|
||||
|
||||
@ -1479,79 +1514,114 @@
|
||||
<span class="self">self</span>.<span class="ident">trips</span>.<span class="ident">start_trip</span>(<span class="self">self</span>.<span class="ident">time</span>, <span class="ident">id</span>, <span class="ident">trip_spec</span>, <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">ctx</span>);
|
||||
}
|
||||
<span class="ident">Command</span>::<span class="ident">SpawnCar</span>(<span class="ident">create_car</span>, <span class="ident">retry_if_no_room</span>) <span class="op">=></span> {
|
||||
<span class="comment">// create_car contains a Path, which is expensive to clone. We need different parts</span>
|
||||
<span class="comment">// of create_car after attempting start_car_on_lane. Make copies just of those</span>
|
||||
<span class="comment">// here. In no case do we ever clone the path.</span>
|
||||
<span class="kw">let</span> <span class="ident">id</span> <span class="op">=</span> <span class="ident">create_car</span>.<span class="ident">vehicle</span>.<span class="ident">id</span>;
|
||||
<span class="kw">let</span> <span class="ident">maybe_route</span> <span class="op">=</span> <span class="ident">create_car</span>.<span class="ident">maybe_route</span>;
|
||||
<span class="kw">let</span> <span class="ident">trip_and_person</span> <span class="op">=</span> <span class="ident">create_car</span>.<span class="ident">trip_and_person</span>;
|
||||
<span class="kw">let</span> <span class="ident">maybe_parked_car</span> <span class="op">=</span> <span class="ident">create_car</span>.<span class="ident">maybe_parked_car</span>.<span class="ident">clone</span>();
|
||||
<span class="kw">let</span> <span class="ident">req</span> <span class="op">=</span> <span class="ident">create_car</span>.<span class="ident">req</span>.<span class="ident">clone</span>();
|
||||
|
||||
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">create_car</span>) <span class="op">=</span> <span class="self">self</span>.<span class="ident">driving</span>.<span class="ident">start_car_on_lane</span>(
|
||||
<span class="self">self</span>.<span class="ident">time</span>,
|
||||
<span class="ident">create_car</span>,
|
||||
<span class="ident">map</span>,
|
||||
<span class="kw-2">&</span><span class="self">self</span>.<span class="ident">intersections</span>,
|
||||
<span class="kw-2">&</span><span class="self">self</span>.<span class="ident">parking</span>,
|
||||
<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>.<span class="ident">scheduler</span>,
|
||||
) {
|
||||
<span class="comment">// Starting the car failed for some reason.</span>
|
||||
<span class="kw">if</span> <span class="ident">retry_if_no_room</span> {
|
||||
<span class="comment">// TODO Record this in the trip log</span>
|
||||
<span class="self">self</span>.<span class="ident">scheduler</span>.<span class="ident">push</span>(
|
||||
<span class="self">self</span>.<span class="ident">time</span> <span class="op">+</span> <span class="ident">BLIND_RETRY_TO_SPAWN</span>,
|
||||
<span class="ident">Command</span>::<span class="ident">SpawnCar</span>(<span class="ident">create_car</span>, <span class="ident">retry_if_no_room</span>),
|
||||
);
|
||||
} <span class="kw">else</span> {
|
||||
<span class="comment">// Buses don't use Command::SpawnCar, so this must exist.</span>
|
||||
<span class="kw">let</span> (<span class="ident">trip</span>, <span class="ident">person</span>) <span class="op">=</span> <span class="ident">create_car</span>.<span class="ident">trip_and_person</span>.<span class="ident">unwrap</span>();
|
||||
<span class="comment">// Have to redeclare for the borrow checker</span>
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">ctx</span> <span class="op">=</span> <span class="ident">Ctx</span> {
|
||||
<span class="ident">parking</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>.<span class="ident">parking</span>,
|
||||
<span class="ident">intersections</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>.<span class="ident">intersections</span>,
|
||||
<span class="ident">cap</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>.<span class="ident">cap</span>,
|
||||
<span class="ident">scheduler</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>.<span class="ident">scheduler</span>,
|
||||
<span class="ident">map</span>,
|
||||
};
|
||||
<span class="self">self</span>.<span class="ident">trips</span>.<span class="ident">cancel_trip</span>(
|
||||
<span class="self">self</span>.<span class="ident">time</span>,
|
||||
<span class="ident">trip</span>,
|
||||
<span class="macro">format</span><span class="macro">!</span>(
|
||||
<span class="string">"no room to spawn car for {} by {}, not retrying"</span>,
|
||||
<span class="ident">trip</span>, <span class="ident">person</span>
|
||||
),
|
||||
<span class="prelude-val">Some</span>(<span class="ident">create_car</span>.<span class="ident">vehicle</span>),
|
||||
<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">ctx</span>,
|
||||
);
|
||||
}
|
||||
} <span class="kw">else</span> {
|
||||
<span class="comment">// Creating the car succeeded.</span>
|
||||
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>((<span class="ident">trip</span>, <span class="ident">person</span>)) <span class="op">=</span> <span class="ident">trip_and_person</span> {
|
||||
<span class="self">self</span>.<span class="ident">trips</span>.<span class="ident">agent_starting_trip_leg</span>(<span class="ident">AgentID</span>::<span class="ident">Car</span>(<span class="ident">id</span>), <span class="ident">trip</span>);
|
||||
<span class="ident">events</span>.<span class="ident">push</span>(<span class="ident">Event</span>::<span class="ident">TripPhaseStarting</span>(
|
||||
<span class="ident">trip</span>,
|
||||
<span class="ident">person</span>,
|
||||
<span class="prelude-val">Some</span>(<span class="ident">req</span>),
|
||||
<span class="kw">if</span> <span class="ident">id</span>.<span class="number">1</span> <span class="op">==</span> <span class="ident">VehicleType</span>::<span class="ident">Car</span> {
|
||||
<span class="ident">TripPhaseType</span>::<span class="ident">Driving</span>
|
||||
} <span class="kw">else</span> {
|
||||
<span class="ident">TripPhaseType</span>::<span class="ident">Biking</span>
|
||||
},
|
||||
));
|
||||
}
|
||||
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">parked_car</span>) <span class="op">=</span> <span class="ident">maybe_parked_car</span> {
|
||||
<span class="kw">if</span> <span class="kw">let</span> <span class="ident">ParkingSpot</span>::<span class="ident">Offstreet</span>(<span class="ident">b</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">parked_car</span>.<span class="ident">spot</span> {
|
||||
<span class="comment">// Buses don't start in parking garages, so trip must exist</span>
|
||||
<span class="ident">events</span>.<span class="ident">push</span>(<span class="ident">Event</span>::<span class="ident">PersonLeavesBuilding</span>(<span class="ident">trip_and_person</span>.<span class="ident">unwrap</span>().<span class="number">1</span>, <span class="ident">b</span>));
|
||||
<span class="comment">// If this SpawnCar is being retried and the map was live-edited since the first</span>
|
||||
<span class="comment">// attempt, the path might've become invalid. TODO Skip this check</span>
|
||||
<span class="comment">// most of the time.</span>
|
||||
<span class="kw">let</span> <span class="ident">constraints</span> <span class="op">=</span> <span class="ident">create_car</span>.<span class="ident">vehicle</span>.<span class="ident">vehicle_type</span>.<span class="ident">to_constraints</span>();
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">ok</span> <span class="op">=</span> <span class="bool-val">true</span>;
|
||||
<span class="kw">for</span> <span class="ident">step</span> <span class="kw">in</span> <span class="ident">create_car</span>.<span class="ident">router</span>.<span class="ident">get_path</span>().<span class="ident">get_steps</span>() {
|
||||
<span class="kw">match</span> <span class="ident">step</span>.<span class="ident">as_traversable</span>() {
|
||||
<span class="ident">Traversable</span>::<span class="ident">Lane</span>(<span class="ident">l</span>) <span class="op">=></span> {
|
||||
<span class="kw">if</span> <span class="op">!</span><span class="ident">constraints</span>.<span class="ident">can_use</span>(<span class="ident">ctx</span>.<span class="ident">map</span>.<span class="ident">get_l</span>(<span class="ident">l</span>), <span class="ident">ctx</span>.<span class="ident">map</span>) {
|
||||
<span class="ident">ok</span> <span class="op">=</span> <span class="bool-val">false</span>;
|
||||
<span class="kw">break</span>;
|
||||
}
|
||||
}
|
||||
<span class="ident">Traversable</span>::<span class="ident">Turn</span>(<span class="ident">t</span>) <span class="op">=></span> {
|
||||
<span class="kw">if</span> <span class="ident">ctx</span>.<span class="ident">map</span>.<span class="ident">maybe_get_t</span>(<span class="ident">t</span>).<span class="ident">is_none</span>() {
|
||||
<span class="ident">ok</span> <span class="op">=</span> <span class="bool-val">false</span>;
|
||||
<span class="kw">break</span>;
|
||||
}
|
||||
}
|
||||
<span class="self">self</span>.<span class="ident">parking</span>.<span class="ident">remove_parked_car</span>(<span class="ident">parked_car</span>);
|
||||
}
|
||||
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">route</span>) <span class="op">=</span> <span class="ident">maybe_route</span> {
|
||||
<span class="self">self</span>.<span class="ident">transit</span>.<span class="ident">bus_created</span>(<span class="ident">id</span>, <span class="ident">route</span>);
|
||||
}
|
||||
<span class="kw">if</span> <span class="op">!</span><span class="ident">ok</span> {
|
||||
<span class="self">self</span>.<span class="ident">trips</span>.<span class="ident">cancel_trip</span>(
|
||||
<span class="self">self</span>.<span class="ident">time</span>,
|
||||
<span class="ident">create_car</span>.<span class="ident">trip_and_person</span>.<span class="ident">unwrap</span>().<span class="number">0</span>,
|
||||
<span class="string">"path is no longer valid after map edits"</span>.<span class="ident">to_string</span>(),
|
||||
<span class="prelude-val">Some</span>(<span class="ident">create_car</span>.<span class="ident">vehicle</span>),
|
||||
<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">ctx</span>,
|
||||
);
|
||||
} <span class="kw">else</span> {
|
||||
<span class="comment">// create_car contains a Path, which is expensive to clone. We need different</span>
|
||||
<span class="comment">// parts of create_car after attempting start_car_on_lane.</span>
|
||||
<span class="comment">// Make copies just of those here. In no case do we ever</span>
|
||||
<span class="comment">// clone the path.</span>
|
||||
<span class="kw">let</span> <span class="ident">id</span> <span class="op">=</span> <span class="ident">create_car</span>.<span class="ident">vehicle</span>.<span class="ident">id</span>;
|
||||
<span class="kw">let</span> <span class="ident">maybe_route</span> <span class="op">=</span> <span class="ident">create_car</span>.<span class="ident">maybe_route</span>;
|
||||
<span class="kw">let</span> <span class="ident">trip_and_person</span> <span class="op">=</span> <span class="ident">create_car</span>.<span class="ident">trip_and_person</span>;
|
||||
<span class="kw">let</span> <span class="ident">maybe_parked_car</span> <span class="op">=</span> <span class="ident">create_car</span>.<span class="ident">maybe_parked_car</span>.<span class="ident">clone</span>();
|
||||
<span class="kw">let</span> <span class="ident">req</span> <span class="op">=</span> <span class="ident">create_car</span>.<span class="ident">req</span>.<span class="ident">clone</span>();
|
||||
|
||||
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">create_car</span>) <span class="op">=</span> <span class="self">self</span>.<span class="ident">driving</span>.<span class="ident">start_car_on_lane</span>(
|
||||
<span class="self">self</span>.<span class="ident">time</span>,
|
||||
<span class="ident">create_car</span>,
|
||||
<span class="ident">map</span>,
|
||||
<span class="kw-2">&</span><span class="self">self</span>.<span class="ident">intersections</span>,
|
||||
<span class="kw-2">&</span><span class="self">self</span>.<span class="ident">parking</span>,
|
||||
<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>.<span class="ident">scheduler</span>,
|
||||
) {
|
||||
<span class="comment">// Starting the car failed for some reason.</span>
|
||||
<span class="kw">if</span> <span class="ident">retry_if_no_room</span> {
|
||||
<span class="comment">// TODO Record this in the trip log</span>
|
||||
<span class="self">self</span>.<span class="ident">scheduler</span>.<span class="ident">push</span>(
|
||||
<span class="self">self</span>.<span class="ident">time</span> <span class="op">+</span> <span class="ident">BLIND_RETRY_TO_SPAWN</span>,
|
||||
<span class="ident">Command</span>::<span class="ident">SpawnCar</span>(<span class="ident">create_car</span>, <span class="ident">retry_if_no_room</span>),
|
||||
);
|
||||
} <span class="kw">else</span> {
|
||||
<span class="comment">// Buses don't use Command::SpawnCar, so this must exist.</span>
|
||||
<span class="kw">let</span> (<span class="ident">trip</span>, <span class="ident">person</span>) <span class="op">=</span> <span class="ident">create_car</span>.<span class="ident">trip_and_person</span>.<span class="ident">unwrap</span>();
|
||||
<span class="comment">// Have to redeclare for the borrow checker</span>
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">ctx</span> <span class="op">=</span> <span class="ident">Ctx</span> {
|
||||
<span class="ident">parking</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>.<span class="ident">parking</span>,
|
||||
<span class="ident">intersections</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>.<span class="ident">intersections</span>,
|
||||
<span class="ident">cap</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>.<span class="ident">cap</span>,
|
||||
<span class="ident">scheduler</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>.<span class="ident">scheduler</span>,
|
||||
<span class="ident">map</span>,
|
||||
};
|
||||
<span class="self">self</span>.<span class="ident">trips</span>.<span class="ident">cancel_trip</span>(
|
||||
<span class="self">self</span>.<span class="ident">time</span>,
|
||||
<span class="ident">trip</span>,
|
||||
<span class="macro">format</span><span class="macro">!</span>(
|
||||
<span class="string">"no room to spawn car for {} by {}, not retrying"</span>,
|
||||
<span class="ident">trip</span>, <span class="ident">person</span>
|
||||
),
|
||||
<span class="prelude-val">Some</span>(<span class="ident">create_car</span>.<span class="ident">vehicle</span>),
|
||||
<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">ctx</span>,
|
||||
);
|
||||
}
|
||||
} <span class="kw">else</span> {
|
||||
<span class="comment">// Creating the car succeeded.</span>
|
||||
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>((<span class="ident">trip</span>, <span class="ident">person</span>)) <span class="op">=</span> <span class="ident">trip_and_person</span> {
|
||||
<span class="self">self</span>.<span class="ident">trips</span>.<span class="ident">agent_starting_trip_leg</span>(<span class="ident">AgentID</span>::<span class="ident">Car</span>(<span class="ident">id</span>), <span class="ident">trip</span>);
|
||||
<span class="ident">events</span>.<span class="ident">push</span>(<span class="ident">Event</span>::<span class="ident">TripPhaseStarting</span>(
|
||||
<span class="ident">trip</span>,
|
||||
<span class="ident">person</span>,
|
||||
<span class="prelude-val">Some</span>(<span class="ident">req</span>),
|
||||
<span class="kw">if</span> <span class="ident">id</span>.<span class="number">1</span> <span class="op">==</span> <span class="ident">VehicleType</span>::<span class="ident">Car</span> {
|
||||
<span class="ident">TripPhaseType</span>::<span class="ident">Driving</span>
|
||||
} <span class="kw">else</span> {
|
||||
<span class="ident">TripPhaseType</span>::<span class="ident">Biking</span>
|
||||
},
|
||||
));
|
||||
}
|
||||
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">parked_car</span>) <span class="op">=</span> <span class="ident">maybe_parked_car</span> {
|
||||
<span class="kw">if</span> <span class="kw">let</span> <span class="ident">ParkingSpot</span>::<span class="ident">Offstreet</span>(<span class="ident">b</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">parked_car</span>.<span class="ident">spot</span> {
|
||||
<span class="comment">// Buses don't start in parking garages, so trip must exist</span>
|
||||
<span class="ident">events</span>.<span class="ident">push</span>(<span class="ident">Event</span>::<span class="ident">PersonLeavesBuilding</span>(
|
||||
<span class="ident">trip_and_person</span>.<span class="ident">unwrap</span>().<span class="number">1</span>,
|
||||
<span class="ident">b</span>,
|
||||
));
|
||||
}
|
||||
<span class="self">self</span>.<span class="ident">parking</span>.<span class="ident">remove_parked_car</span>(<span class="ident">parked_car</span>);
|
||||
}
|
||||
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">route</span>) <span class="op">=</span> <span class="ident">maybe_route</span> {
|
||||
<span class="self">self</span>.<span class="ident">transit</span>.<span class="ident">bus_created</span>(<span class="ident">id</span>, <span class="ident">route</span>);
|
||||
}
|
||||
<span class="self">self</span>.<span class="ident">analytics</span>
|
||||
.<span class="ident">record_demand</span>(<span class="self">self</span>.<span class="ident">driving</span>.<span class="ident">get_path</span>(<span class="ident">id</span>).<span class="ident">unwrap</span>(), <span class="ident">map</span>);
|
||||
}
|
||||
<span class="self">self</span>.<span class="ident">analytics</span>
|
||||
.<span class="ident">record_demand</span>(<span class="self">self</span>.<span class="ident">driving</span>.<span class="ident">get_path</span>(<span class="ident">id</span>).<span class="ident">unwrap</span>(), <span class="ident">map</span>);
|
||||
}
|
||||
}
|
||||
<span class="ident">Command</span>::<span class="ident">SpawnPed</span>(<span class="ident">create_ped</span>) <span class="op">=></span> {
|
||||
|
Loading…
Reference in New Issue
Block a user