This commit is contained in:
dabreegster 2021-01-12 20:25:56 +00:00
parent 9155021c6b
commit f5d4aa866d
6 changed files with 65 additions and 25 deletions

View File

@ -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">&#9776;</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">&#x2212;</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: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a> = &quot;Tue, 12 Jan 2021 20:00:46 +0000&quot;;</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">&#x2212;</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: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a> = &quot;Tue, 12 Jan 2021 20:23:16 +0000&quot;;</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>

View File

@ -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 `driving` mod in crate `sim`."><meta name="keywords" content="rust, rustlang, rust-lang, driving"><title>sim::mechanics::driving - 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">&#9776;</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 driving</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li><li><a href="#constants">Constants</a></li></ul></div><p class="location"><a href="../../index.html">sim</a>::<wbr><a href="../index.html">mechanics</a></p><script>window.sidebarCurrent = {name: "driving", 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">&#x2212;</span>]</a></span><a class="srclink" href="../../../src/sim/mechanics/driving.rs.html#1-1178" title="goto source code">[src]</a></span><span class="in-band">Module <a href="../../index.html">sim</a>::<wbr><a href="../index.html">mechanics</a>::<wbr><a class="mod" href="">driving</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">&#x2212;</span>]</a></span><a class="srclink" href="../../../src/sim/mechanics/driving.rs.html#1-1198" title="goto source code">[src]</a></span><span class="in-band">Module <a href="../../index.html">sim</a>::<wbr><a href="../index.html">mechanics</a>::<wbr><a class="mod" href="">driving</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.DrivingSimState.html" title="sim::mechanics::driving::DrivingSimState struct">DrivingSimState</a></td><td class="docblock-short"><p>Simulates vehicles!</p>
</td></tr></table><h2 id="constants" class="section-header"><a href="#constants">Constants</a></h2>
<table><tr class="module-item"><td><a class="constant" href="constant.BLIND_RETRY_TO_CREEP_FORWARDS.html" title="sim::mechanics::driving::BLIND_RETRY_TO_CREEP_FORWARDS constant">BLIND_RETRY_TO_CREEP_FORWARDS</a></td><td class="docblock-short"></td></tr><tr class="module-item"><td><a class="constant" href="constant.BLIND_RETRY_TO_REACH_END_DIST.html" title="sim::mechanics::driving::BLIND_RETRY_TO_REACH_END_DIST constant">BLIND_RETRY_TO_REACH_END_DIST</a></td><td class="docblock-short"></td></tr><tr class="module-item"><td><a class="constant" href="constant.TIME_TO_WAIT_AT_BUS_STOP.html" title="sim::mechanics::driving::TIME_TO_WAIT_AT_BUS_STOP constant">TIME_TO_WAIT_AT_BUS_STOP</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 = "sim";</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

View File

@ -10,7 +10,7 @@ for convenient debugging.</p>
</div></div><h3 id="impl-Display" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> for <a class="struct" href="../sim/struct.CarID.html" title="struct sim::CarID">CarID</a></code><a href="#impl-Display" class="anchor"></a><a class="srclink" href="../src/sim/lib.rs.html#100-109" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt-1" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt" class="fnname">fmt</a>(&amp;self, f: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>&lt;'_&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class="srclink" href="../src/sim/lib.rs.html#101-108" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt">Read more</a></p>
</div></div><h3 id="impl-Eq" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> for <a class="struct" href="../sim/struct.CarID.html" title="struct sim::CarID">CarID</a></code><a href="#impl-Eq" class="anchor"></a><a class="srclink" href="../src/sim/lib.rs.html#90" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Hash" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a> for <a class="struct" href="../sim/struct.CarID.html" title="struct sim::CarID">CarID</a></code><a href="#impl-Hash" class="anchor"></a><a class="srclink" href="../src/sim/lib.rs.html#90" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.hash" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#tymethod.hash" class="fnname">hash</a>&lt;__H:&nbsp;<a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="trait core::hash::Hasher">Hasher</a>&gt;(&amp;self, state: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>__H)</code><a class="srclink" href="../src/sim/lib.rs.html#90" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Feeds this value into the given <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="Hasher"><code>Hasher</code></a>. <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#tymethod.hash">Read more</a></p>
</div><h4 id="method.hash_slice" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#method.hash_slice" class="fnname">hash_slice</a>&lt;H&gt;(data: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;[Self]</a>, state: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>H) <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;H: <a class="trait" href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="trait core::hash::Hasher">Hasher</a>,&nbsp;</span></code><span class="since" title="Stable since Rust version 1.3.0">1.3.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/hash/mod.rs.html#184-191" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Feeds a slice of this type into the given <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hasher.html" title="Hasher"><code>Hasher</code></a>. <a href="https://doc.rust-lang.org/nightly/core/hash/trait.Hash.html#method.hash_slice">Read more</a></p>
</div></div><h3 id="impl-IndexableKey" class="impl"><code class="in-band">impl <a class="trait" href="../abstutil/collections/trait.IndexableKey.html" title="trait abstutil::collections::IndexableKey">IndexableKey</a> for <a class="struct" href="../sim/struct.CarID.html" title="struct sim::CarID">CarID</a></code><a href="#impl-IndexableKey" class="anchor"></a><a class="srclink" href="../src/sim/mechanics/driving.rs.html#1174-1178" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.index" class="method hidden"><code>fn <a href="../abstutil/collections/trait.IndexableKey.html#tymethod.index" class="fnname">index</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code><a class="srclink" href="../src/sim/mechanics/driving.rs.html#1175-1177" title="goto source code">[src]</a></h4></div><h3 id="impl-Ord" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a> for <a class="struct" href="../sim/struct.CarID.html" title="struct sim::CarID">CarID</a></code><a href="#impl-Ord" class="anchor"></a><a class="srclink" href="../src/sim/lib.rs.html#90" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.cmp" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#tymethod.cmp" class="fnname">cmp</a>(&amp;self, other: &amp;<a class="struct" href="../sim/struct.CarID.html" title="struct sim::CarID">CarID</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a></code><a class="srclink" href="../src/sim/lib.rs.html#90" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>This method returns an <a href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="Ordering"><code>Ordering</code></a> between <code>self</code> and <code>other</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#tymethod.cmp">Read more</a></p>
</div></div><h3 id="impl-IndexableKey" class="impl"><code class="in-band">impl <a class="trait" href="../abstutil/collections/trait.IndexableKey.html" title="trait abstutil::collections::IndexableKey">IndexableKey</a> for <a class="struct" href="../sim/struct.CarID.html" title="struct sim::CarID">CarID</a></code><a href="#impl-IndexableKey" class="anchor"></a><a class="srclink" href="../src/sim/mechanics/driving.rs.html#1194-1198" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.index" class="method hidden"><code>fn <a href="../abstutil/collections/trait.IndexableKey.html#tymethod.index" class="fnname">index</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code><a class="srclink" href="../src/sim/mechanics/driving.rs.html#1195-1197" title="goto source code">[src]</a></h4></div><h3 id="impl-Ord" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a> for <a class="struct" href="../sim/struct.CarID.html" title="struct sim::CarID">CarID</a></code><a href="#impl-Ord" class="anchor"></a><a class="srclink" href="../src/sim/lib.rs.html#90" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.cmp" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#tymethod.cmp" class="fnname">cmp</a>(&amp;self, other: &amp;<a class="struct" href="../sim/struct.CarID.html" title="struct sim::CarID">CarID</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a></code><a class="srclink" href="../src/sim/lib.rs.html#90" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>This method returns an <a href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="Ordering"><code>Ordering</code></a> between <code>self</code> and <code>other</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#tymethod.cmp">Read more</a></p>
</div><h4 id="method.max" class="method hidden"><code><span class="docblock attributes">#[must_use]</span>fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.max" class="fnname">max</a>(self, other: Self) -&gt; Self</code><span class="since" title="Stable since Rust version 1.21.0">1.21.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#605-610" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Compares and returns the maximum of two values. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.max">Read more</a></p>
</div><h4 id="method.min" class="method hidden"><code><span class="docblock attributes">#[must_use]</span>fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.min" class="fnname">min</a>(self, other: Self) -&gt; Self</code><span class="since" title="Stable since Rust version 1.21.0">1.21.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#625-630" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Compares and returns the minimum of two values. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.min">Read more</a></p>
</div><h4 id="method.clamp" class="method hidden"><code><span class="docblock attributes">#[must_use]</span>fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.clamp" class="fnname">clamp</a>(self, min: Self, max: Self) -&gt; Self</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#652-664" title="goto source code">[src]</a></h4><div class="stability hidden"><div class="stab unstable"><span class="emoji">🔬</span> This is a nightly-only experimental API. (<code>clamp</code>)</div></div><div class='docblock hidden'><p>Restrict a value to a certain interval. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.clamp">Read more</a></p>

View File

@ -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">&amp;</span><span class="ident">str</span> <span class="op">=</span> <span class="string">&quot;rustdoc 1.49.0 (e1884a8e3 2020-12-29)&quot;</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">&amp;</span><span class="ident">str</span> <span class="op">=</span> <span class="string">&quot;Tue, 12 Jan 2021 20:00:46 +0000&quot;</span>;
<span class="kw">pub</span> <span class="kw">const</span> <span class="ident">BUILT_TIME_UTC</span>: <span class="kw-2">&amp;</span><span class="ident">str</span> <span class="op">=</span> <span class="string">&quot;Tue, 12 Jan 2021 20:23:16 +0000&quot;</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">&amp;</span><span class="ident">str</span> <span class="op">=</span> <span class="string">&quot;x86_64&quot;</span>;
<span class="doccomment">/// The endianness, given by `cfg!(target_endian)`.</span>

View File

@ -1179,6 +1179,26 @@
<span id="1176">1176</span>
<span id="1177">1177</span>
<span id="1178">1178</span>
<span id="1179">1179</span>
<span id="1180">1180</span>
<span id="1181">1181</span>
<span id="1182">1182</span>
<span id="1183">1183</span>
<span id="1184">1184</span>
<span id="1185">1185</span>
<span id="1186">1186</span>
<span id="1187">1187</span>
<span id="1188">1188</span>
<span id="1189">1189</span>
<span id="1190">1190</span>
<span id="1191">1191</span>
<span id="1192">1192</span>
<span id="1193">1193</span>
<span id="1194">1194</span>
<span id="1195">1195</span>
<span id="1196">1196</span>
<span id="1197">1197</span>
<span id="1198">1198</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">BTreeSet</span>, <span class="ident">HashMap</span>, <span class="ident">HashSet</span>, <span class="ident">VecDeque</span>};
@ -2195,26 +2215,46 @@
}
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">agent_properties</span>(<span class="kw-2">&amp;</span><span class="self">self</span>, <span class="ident">id</span>: <span class="ident">CarID</span>, <span class="ident">now</span>: <span class="ident">Time</span>) <span class="op">-</span><span class="op">&gt;</span> <span class="ident">AgentProperties</span> {
<span class="kw">let</span> <span class="ident">car</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">cars</span>.<span class="ident">get</span>(<span class="kw-2">&amp;</span><span class="ident">id</span>).<span class="ident">unwrap</span>();
<span class="kw">let</span> <span class="ident">path</span> <span class="op">=</span> <span class="ident">car</span>.<span class="ident">router</span>.<span class="ident">get_path</span>();
<span class="kw">let</span> <span class="ident">time_spent_waiting</span> <span class="op">=</span> <span class="ident">car</span>.<span class="ident">state</span>.<span class="ident">time_spent_waiting</span>(<span class="ident">now</span>);
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">car</span>) <span class="op">=</span> <span class="self">self</span>.<span class="ident">cars</span>.<span class="ident">get</span>(<span class="kw-2">&amp;</span><span class="ident">id</span>) {
<span class="kw">let</span> <span class="ident">path</span> <span class="op">=</span> <span class="ident">car</span>.<span class="ident">router</span>.<span class="ident">get_path</span>();
<span class="kw">let</span> <span class="ident">time_spent_waiting</span> <span class="op">=</span> <span class="ident">car</span>.<span class="ident">state</span>.<span class="ident">time_spent_waiting</span>(<span class="ident">now</span>);
<span class="comment">// In all cases, we can figure out exactly where we are along the current queue, then</span>
<span class="comment">// assume we&#39;ve travelled from the start of that, unless it&#39;s the very first step.</span>
<span class="kw">let</span> <span class="ident">front</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">get_car_front</span>(<span class="ident">now</span>, <span class="ident">car</span>);
<span class="kw">let</span> <span class="ident">current_state_dist</span> <span class="op">=</span>
<span class="kw">if</span> <span class="ident">car</span>.<span class="ident">router</span>.<span class="ident">head</span>() <span class="op">=</span><span class="op">=</span> <span class="ident">Traversable</span>::<span class="ident">Lane</span>(<span class="ident">path</span>.<span class="ident">get_req</span>().<span class="ident">start</span>.<span class="ident">lane</span>()) {
<span class="ident">front</span> <span class="op">-</span> <span class="ident">path</span>.<span class="ident">get_req</span>().<span class="ident">start</span>.<span class="ident">dist_along</span>()
} <span class="kw">else</span> {
<span class="ident">front</span>
};
<span class="comment">// In all cases, we can figure out exactly where we are along the current queue, then</span>
<span class="comment">// assume we&#39;ve travelled from the start of that, unless it&#39;s the very first step.</span>
<span class="kw">let</span> <span class="ident">front</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">get_car_front</span>(<span class="ident">now</span>, <span class="ident">car</span>);
<span class="kw">let</span> <span class="ident">current_state_dist</span> <span class="op">=</span>
<span class="kw">if</span> <span class="ident">car</span>.<span class="ident">router</span>.<span class="ident">head</span>() <span class="op">=</span><span class="op">=</span> <span class="ident">Traversable</span>::<span class="ident">Lane</span>(<span class="ident">path</span>.<span class="ident">get_req</span>().<span class="ident">start</span>.<span class="ident">lane</span>()) {
<span class="ident">front</span> <span class="op">-</span> <span class="ident">path</span>.<span class="ident">get_req</span>().<span class="ident">start</span>.<span class="ident">dist_along</span>()
} <span class="kw">else</span> {
<span class="ident">front</span>
};
<span class="ident">AgentProperties</span> {
<span class="ident">total_time</span>: <span class="ident">now</span> <span class="op">-</span> <span class="ident">car</span>.<span class="ident">started_at</span>,
<span class="ident">waiting_here</span>: <span class="ident">time_spent_waiting</span>,
<span class="ident">total_waiting</span>: <span class="ident">car</span>.<span class="ident">total_blocked_time</span> <span class="op">+</span> <span class="ident">time_spent_waiting</span>,
<span class="ident">dist_crossed</span>: <span class="ident">path</span>.<span class="ident">crossed_so_far</span>() <span class="op">+</span> <span class="ident">current_state_dist</span>,
<span class="ident">total_dist</span>: <span class="ident">path</span>.<span class="ident">total_length</span>(),
<span class="ident">AgentProperties</span> {
<span class="ident">total_time</span>: <span class="ident">now</span> <span class="op">-</span> <span class="ident">car</span>.<span class="ident">started_at</span>,
<span class="ident">waiting_here</span>: <span class="ident">time_spent_waiting</span>,
<span class="ident">total_waiting</span>: <span class="ident">car</span>.<span class="ident">total_blocked_time</span> <span class="op">+</span> <span class="ident">time_spent_waiting</span>,
<span class="ident">dist_crossed</span>: <span class="ident">path</span>.<span class="ident">crossed_so_far</span>() <span class="op">+</span> <span class="ident">current_state_dist</span>,
<span class="ident">total_dist</span>: <span class="ident">path</span>.<span class="ident">total_length</span>(),
}
} <span class="kw">else</span> {
<span class="kw">for</span> (<span class="ident">car</span>, <span class="kw">_</span>) <span class="kw">in</span> <span class="kw-2">&amp;</span><span class="self">self</span>.<span class="ident">waiting_to_spawn</span> {
<span class="kw">if</span> <span class="ident">id</span> <span class="op">=</span><span class="op">=</span> <span class="kw-2">*</span><span class="ident">car</span> {
<span class="comment">// If the vehicle is waiting to spawn, we don&#39;t have any stats on them yet. We</span>
<span class="comment">// could track when they originally tried to spawn and use for a few of these</span>
<span class="comment">// fields, but we should also make sure that delay gets recorded later.</span>
<span class="kw">return</span> <span class="ident">AgentProperties</span> {
<span class="ident">total_time</span>: <span class="ident">Duration</span>::<span class="ident">ZERO</span>,
<span class="ident">waiting_here</span>: <span class="ident">Duration</span>::<span class="ident">ZERO</span>,
<span class="ident">total_waiting</span>: <span class="ident">Duration</span>::<span class="ident">ZERO</span>,
<span class="ident">dist_crossed</span>: <span class="ident">Distance</span>::<span class="ident">ZERO</span>,
<span class="ident">total_dist</span>: <span class="ident">Distance</span>::<span class="ident">ZERO</span>,
};
}
}
<span class="macro">panic</span><span class="macro">!</span>(
<span class="string">&quot;Can&#39;t get agent_properties of {} at {}; they don&#39;t exist&quot;</span>,
<span class="ident">id</span>, <span class="ident">now</span>
);
}
}