This commit is contained in:
dabreegster 2020-10-19 20:16:46 +00:00
parent d89e391f26
commit a3f087c3fe
9 changed files with 90 additions and 32 deletions

View File

@ -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">&#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!"><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'>&#x2212;</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: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a> = &quot;Mon, 19 Oct 2020 20:07:41 +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-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: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a> = &quot;Mon, 19 Oct 2020 20:14:01 +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>

File diff suppressed because one or more lines are too long

View File

@ -1,2 +1,2 @@
<!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 `dump_cars` fn in crate `sim`."><meta name="keywords" content="rust, rustlang, rust-lang, dump_cars"><title>sim::mechanics::queue::dump_cars - 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 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">&#9776;</div><a href='../../../sim/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'>sim</a>::<wbr><a href='../index.html'>mechanics</a>::<wbr><a href='index.html'>queue</a></p><script>window.sidebarCurrent = {name: 'dump_cars', 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!"><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'>&#x2212;</span>]</a></span><a class='srclink' href='../../../src/sim/mechanics/queue.rs.html#278-313' title='goto source code'>[src]</a></span><span class='in-band'>Function <a href='../../index.html'>sim</a>::<wbr><a href='../index.html'>mechanics</a>::<wbr><a href='index.html'>queue</a>::<wbr><a class="fn" href=''>dump_cars</a></span></h1><pre class='rust fn'>fn dump_cars(<br>&nbsp;&nbsp;&nbsp;&nbsp;dists: &amp;<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="struct" href="../../../sim/struct.CarID.html" title="struct sim::CarID">CarID</a>, <a class="struct" href="../../../geom/distance/struct.Distance.html" title="struct geom::distance::Distance">Distance</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>&gt;, <br>&nbsp;&nbsp;&nbsp;&nbsp;cars: &amp;<a class="struct" href="../../../abstutil/collections/struct.FixedMap.html" title="struct abstutil::collections::FixedMap">FixedMap</a>&lt;<a class="struct" href="../../../sim/struct.CarID.html" title="struct sim::CarID">CarID</a>, <a class="struct" href="../../../sim/mechanics/car/struct.Car.html" title="struct sim::mechanics::car::Car">Car</a>&gt;, <br>&nbsp;&nbsp;&nbsp;&nbsp;id: <a class="enum" href="../../../map_model/traversable/enum.Traversable.html" title="enum map_model::traversable::Traversable">Traversable</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;now: <a class="struct" href="../../../geom/time/struct.Time.html" title="struct geom::time::Time">Time</a><br>)</pre></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>
<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/queue.rs.html#307-342' title='goto source code'>[src]</a></span><span class='in-band'>Function <a href='../../index.html'>sim</a>::<wbr><a href='../index.html'>mechanics</a>::<wbr><a href='index.html'>queue</a>::<wbr><a class="fn" href=''>dump_cars</a></span></h1><pre class='rust fn'>fn dump_cars(<br>&nbsp;&nbsp;&nbsp;&nbsp;dists: &amp;<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="struct" href="../../../sim/struct.CarID.html" title="struct sim::CarID">CarID</a>, <a class="struct" href="../../../geom/distance/struct.Distance.html" title="struct geom::distance::Distance">Distance</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>&gt;, <br>&nbsp;&nbsp;&nbsp;&nbsp;cars: &amp;<a class="struct" href="../../../abstutil/collections/struct.FixedMap.html" title="struct abstutil::collections::FixedMap">FixedMap</a>&lt;<a class="struct" href="../../../sim/struct.CarID.html" title="struct sim::CarID">CarID</a>, <a class="struct" href="../../../sim/mechanics/car/struct.Car.html" title="struct sim::mechanics::car::Car">Car</a>&gt;, <br>&nbsp;&nbsp;&nbsp;&nbsp;id: <a class="enum" href="../../../map_model/traversable/enum.Traversable.html" title="enum map_model::traversable::Traversable">Traversable</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;now: <a class="struct" href="../../../geom/time/struct.Time.html" title="struct geom::time::Time">Time</a><br>)</pre></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>

View File

@ -1,2 +1,2 @@
<!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 `validate_positions` fn in crate `sim`."><meta name="keywords" content="rust, rustlang, rust-lang, validate_positions"><title>sim::mechanics::queue::validate_positions - 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 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">&#9776;</div><a href='../../../sim/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'>sim</a>::<wbr><a href='../index.html'>mechanics</a>::<wbr><a href='index.html'>queue</a></p><script>window.sidebarCurrent = {name: 'validate_positions', 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!"><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'>&#x2212;</span>]</a></span><a class='srclink' href='../../../src/sim/mechanics/queue.rs.html#261-276' title='goto source code'>[src]</a></span><span class='in-band'>Function <a href='../../index.html'>sim</a>::<wbr><a href='../index.html'>mechanics</a>::<wbr><a href='index.html'>queue</a>::<wbr><a class="fn" href=''>validate_positions</a></span></h1><pre class='rust fn'>fn validate_positions(<br>&nbsp;&nbsp;&nbsp;&nbsp;dists: &amp;<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="struct" href="../../../sim/struct.CarID.html" title="struct sim::CarID">CarID</a>, <a class="struct" href="../../../geom/distance/struct.Distance.html" title="struct geom::distance::Distance">Distance</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>&gt;, <br>&nbsp;&nbsp;&nbsp;&nbsp;cars: &amp;<a class="struct" href="../../../abstutil/collections/struct.FixedMap.html" title="struct abstutil::collections::FixedMap">FixedMap</a>&lt;<a class="struct" href="../../../sim/struct.CarID.html" title="struct sim::CarID">CarID</a>, <a class="struct" href="../../../sim/mechanics/car/struct.Car.html" title="struct sim::mechanics::car::Car">Car</a>&gt;, <br>&nbsp;&nbsp;&nbsp;&nbsp;now: <a class="struct" href="../../../geom/time/struct.Time.html" title="struct geom::time::Time">Time</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;id: <a class="enum" href="../../../map_model/traversable/enum.Traversable.html" title="enum map_model::traversable::Traversable">Traversable</a><br>)</pre></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>
<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/queue.rs.html#290-305' title='goto source code'>[src]</a></span><span class='in-band'>Function <a href='../../index.html'>sim</a>::<wbr><a href='../index.html'>mechanics</a>::<wbr><a href='index.html'>queue</a>::<wbr><a class="fn" href=''>validate_positions</a></span></h1><pre class='rust fn'>fn validate_positions(<br>&nbsp;&nbsp;&nbsp;&nbsp;dists: &amp;<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="struct" href="../../../sim/struct.CarID.html" title="struct sim::CarID">CarID</a>, <a class="struct" href="../../../geom/distance/struct.Distance.html" title="struct geom::distance::Distance">Distance</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>&gt;, <br>&nbsp;&nbsp;&nbsp;&nbsp;cars: &amp;<a class="struct" href="../../../abstutil/collections/struct.FixedMap.html" title="struct abstutil::collections::FixedMap">FixedMap</a>&lt;<a class="struct" href="../../../sim/struct.CarID.html" title="struct sim::CarID">CarID</a>, <a class="struct" href="../../../sim/mechanics/car/struct.Car.html" title="struct sim::mechanics::car::Car">Car</a>&gt;, <br>&nbsp;&nbsp;&nbsp;&nbsp;now: <a class="struct" href="../../../geom/time/struct.Time.html" title="struct geom::time::Time">Time</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;id: <a class="enum" href="../../../map_model/traversable/enum.Traversable.html" title="enum map_model::traversable::Traversable">Traversable</a><br>)</pre></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>

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 `queue` mod in crate `sim`."><meta name="keywords" content="rust, rustlang, rust-lang, queue"><title>sim::mechanics::queue - 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">&#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 queue</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'>sim</a>::<wbr><a href='../index.html'>mechanics</a></p><script>window.sidebarCurrent = {name: 'queue', 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'>&#x2212;</span>]</a></span><a class='srclink' href='../../../src/sim/mechanics/queue.rs.html#1-313' 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=''>queue</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/queue.rs.html#1-342' 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=''>queue</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.Queue.html" title='sim::mechanics::queue::Queue struct'>Queue</a></td><td class='docblock-short'><p>A Queue of vehicles on a single lane or turn. No over-taking or lane-changing. This is where
https://dabreegster.github.io/abstreet/trafficsim/discrete_event.html#exact-positions is
implemented.</p>

File diff suppressed because one or more lines are too long

View File

@ -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">&amp;</span><span class="ident">str</span> <span class="op">=</span> <span class="string">&quot;rustdoc 1.47.0 (18bf6b4f0 2020-10-07)&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;Mon, 19 Oct 2020 20:07:41 +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;Mon, 19 Oct 2020 20:14:01 +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

@ -1791,18 +1791,18 @@
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">update_laggy_head</span>(<span class="kw-2">&amp;</span><span class="kw-2">mut</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="ident">ctx</span>: <span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">Ctx</span>) {
<span class="kw">let</span> <span class="ident">currently_on</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">cars</span>[<span class="kw-2">&amp;</span><span class="ident">id</span>].<span class="ident">router</span>.<span class="ident">head</span>();
<span class="kw">let</span> <span class="ident">current_dists</span> <span class="op">=</span>
<span class="self">self</span>.<span class="ident">queues</span>[<span class="kw-2">&amp;</span><span class="ident">currently_on</span>].<span class="ident">get_car_positions</span>(<span class="ident">now</span>, <span class="kw-2">&amp;</span><span class="self">self</span>.<span class="ident">cars</span>, <span class="kw-2">&amp;</span><span class="self">self</span>.<span class="ident">queues</span>);
<span class="comment">// This car must be the tail.</span>
<span class="kw">let</span> <span class="ident">dist_along_last</span> <span class="op">=</span> {
<span class="kw">let</span> (<span class="ident">last_id</span>, <span class="ident">dist</span>) <span class="op">=</span> <span class="ident">current_dists</span>.<span class="ident">last</span>().<span class="ident">unwrap</span>();
<span class="kw">if</span> <span class="ident">id</span> <span class="op">!=</span> <span class="kw-2">*</span><span class="ident">last_id</span> {
<span class="kw">let</span> (<span class="ident">last_id</span>, <span class="ident">dist</span>) <span class="op">=</span> <span class="self">self</span>.<span class="ident">queues</span>[<span class="kw-2">&amp;</span><span class="ident">currently_on</span>]
.<span class="ident">get_last_car_position</span>(<span class="ident">now</span>, <span class="kw-2">&amp;</span><span class="self">self</span>.<span class="ident">cars</span>, <span class="kw-2">&amp;</span><span class="self">self</span>.<span class="ident">queues</span>)
.<span class="ident">unwrap</span>();
<span class="kw">if</span> <span class="ident">id</span> <span class="op">!=</span> <span class="ident">last_id</span> {
<span class="macro">panic</span><span class="macro">!</span>(
<span class="string">&quot;At {} on {:?}, laggy head {} isn&#39;t the last on the lane; it&#39;s {}&quot;</span>,
<span class="ident">now</span>, <span class="ident">currently_on</span>, <span class="ident">id</span>, <span class="ident">last_id</span>
);
}
<span class="kw-2">*</span><span class="ident">dist</span>
<span class="ident">dist</span>
};
<span class="comment">// Trim off as many of the oldest last_steps as we&#39;ve made distance.</span>

View File

@ -312,6 +312,35 @@
<span id="311">311</span>
<span id="312">312</span>
<span id="313">313</span>
<span id="314">314</span>
<span id="315">315</span>
<span id="316">316</span>
<span id="317">317</span>
<span id="318">318</span>
<span id="319">319</span>
<span id="320">320</span>
<span id="321">321</span>
<span id="322">322</span>
<span id="323">323</span>
<span id="324">324</span>
<span id="325">325</span>
<span id="326">326</span>
<span id="327">327</span>
<span id="328">328</span>
<span id="329">329</span>
<span id="330">330</span>
<span id="331">331</span>
<span id="332">332</span>
<span id="333">333</span>
<span id="334">334</span>
<span id="335">335</span>
<span id="336">336</span>
<span id="337">337</span>
<span id="338">338</span>
<span id="339">339</span>
<span id="340">340</span>
<span id="341">341</span>
<span id="342">342</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">VecDeque</span>};
@ -354,6 +383,15 @@
}
}
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">get_last_car_position</span>(
<span class="kw-2">&amp;</span><span class="self">self</span>,
<span class="ident">now</span>: <span class="ident">Time</span>,
<span class="ident">cars</span>: <span class="kw-2">&amp;</span><span class="ident">FixedMap</span><span class="op">&lt;</span><span class="ident">CarID</span>, <span class="ident">Car</span><span class="op">&gt;</span>,
<span class="ident">queues</span>: <span class="kw-2">&amp;</span><span class="ident">BTreeMap</span><span class="op">&lt;</span><span class="ident">Traversable</span>, <span class="ident">Queue</span><span class="op">&gt;</span>,
) <span class="op">-&gt;</span> <span class="prelude-ty">Option</span><span class="op">&lt;</span>(<span class="ident">CarID</span>, <span class="ident">Distance</span>)<span class="op">&gt;</span> {
<span class="self">self</span>.<span class="ident">inner_get_last_car_position</span>(<span class="ident">now</span>, <span class="ident">cars</span>, <span class="ident">queues</span>, <span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">BTreeSet</span>::<span class="ident">new</span>(), <span class="prelude-val">None</span>)
}
<span class="doccomment">/// Farthest along (greatest distance) is first.</span>
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">get_car_positions</span>(
<span class="kw-2">&amp;</span><span class="self">self</span>,
@ -361,26 +399,34 @@
<span class="ident">cars</span>: <span class="kw-2">&amp;</span><span class="ident">FixedMap</span><span class="op">&lt;</span><span class="ident">CarID</span>, <span class="ident">Car</span><span class="op">&gt;</span>,
<span class="ident">queues</span>: <span class="kw-2">&amp;</span><span class="ident">BTreeMap</span><span class="op">&lt;</span><span class="ident">Traversable</span>, <span class="ident">Queue</span><span class="op">&gt;</span>,
) <span class="op">-&gt;</span> <span class="ident">Vec</span><span class="op">&lt;</span>(<span class="ident">CarID</span>, <span class="ident">Distance</span>)<span class="op">&gt;</span> {
<span class="self">self</span>.<span class="ident">inner_get_car_positions</span>(<span class="ident">now</span>, <span class="ident">cars</span>, <span class="ident">queues</span>, <span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">BTreeSet</span>::<span class="ident">new</span>())
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">all_cars</span> <span class="op">=</span> <span class="macro">vec</span><span class="macro">!</span>[];
<span class="self">self</span>.<span class="ident">inner_get_last_car_position</span>(
<span class="ident">now</span>,
<span class="ident">cars</span>,
<span class="ident">queues</span>,
<span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">BTreeSet</span>::<span class="ident">new</span>(),
<span class="prelude-val">Some</span>(<span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">all_cars</span>),
);
<span class="ident">all_cars</span>
}
<span class="kw">fn</span> <span class="ident">inner_get_car_positions</span>(
<span class="kw">fn</span> <span class="ident">inner_get_last_car_position</span>(
<span class="kw-2">&amp;</span><span class="self">self</span>,
<span class="ident">now</span>: <span class="ident">Time</span>,
<span class="ident">cars</span>: <span class="kw-2">&amp;</span><span class="ident">FixedMap</span><span class="op">&lt;</span><span class="ident">CarID</span>, <span class="ident">Car</span><span class="op">&gt;</span>,
<span class="ident">queues</span>: <span class="kw-2">&amp;</span><span class="ident">BTreeMap</span><span class="op">&lt;</span><span class="ident">Traversable</span>, <span class="ident">Queue</span><span class="op">&gt;</span>,
<span class="ident">recursed_queues</span>: <span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">BTreeSet</span><span class="op">&lt;</span><span class="ident">Traversable</span><span class="op">&gt;</span>,
) <span class="op">-&gt;</span> <span class="ident">Vec</span><span class="op">&lt;</span>(<span class="ident">CarID</span>, <span class="ident">Distance</span>)<span class="op">&gt;</span> {
<span class="kw-2">mut</span> <span class="ident">intermediate_results</span>: <span class="prelude-ty">Option</span><span class="op">&lt;</span><span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">Vec</span><span class="op">&lt;</span>(<span class="ident">CarID</span>, <span class="ident">Distance</span>)<span class="op">&gt;&gt;</span>,
) <span class="op">-&gt;</span> <span class="prelude-ty">Option</span><span class="op">&lt;</span>(<span class="ident">CarID</span>, <span class="ident">Distance</span>)<span class="op">&gt;</span> {
<span class="kw">if</span> <span class="self">self</span>.<span class="ident">cars</span>.<span class="ident">is_empty</span>() {
<span class="kw">return</span> <span class="ident">Vec</span>::<span class="ident">new</span>();
<span class="kw">return</span> <span class="prelude-val">None</span>;
}
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">result</span>: <span class="ident">Vec</span><span class="op">&lt;</span>(<span class="ident">CarID</span>, <span class="ident">Distance</span>)<span class="op">&gt;</span> <span class="op">=</span> <span class="ident">Vec</span>::<span class="ident">new</span>();
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">previous</span>: <span class="prelude-ty">Option</span><span class="op">&lt;</span>(<span class="ident">CarID</span>, <span class="ident">Distance</span>)<span class="op">&gt;</span> <span class="op">=</span> <span class="prelude-val">None</span>;
<span class="kw">for</span> <span class="ident">id</span> <span class="kw">in</span> <span class="kw-2">&amp;</span><span class="self">self</span>.<span class="ident">cars</span> {
<span class="kw">let</span> <span class="ident">bound</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">result</span>.<span class="ident">last</span>() {
<span class="kw">let</span> <span class="ident">bound</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">previous</span> {
<span class="prelude-val">Some</span>((<span class="ident">leader</span>, <span class="ident">last_dist</span>)) <span class="op">=&gt;</span> {
<span class="kw-2">*</span><span class="ident">last_dist</span> <span class="op">-</span> <span class="ident">cars</span>[<span class="ident">leader</span>].<span class="ident">vehicle</span>.<span class="ident">length</span> <span class="op">-</span> <span class="ident">FOLLOWING_DISTANCE</span>
<span class="ident">last_dist</span> <span class="op">-</span> <span class="ident">cars</span>[<span class="kw-2">&amp;</span><span class="ident">leader</span>].<span class="ident">vehicle</span>.<span class="ident">length</span> <span class="op">-</span> <span class="ident">FOLLOWING_DISTANCE</span>
}
<span class="prelude-val">None</span> <span class="op">=&gt;</span> <span class="kw">match</span> <span class="self">self</span>.<span class="ident">laggy_head</span> {
<span class="prelude-val">Some</span>(<span class="ident">id</span>) <span class="op">=&gt;</span> {
@ -411,9 +457,14 @@
} <span class="kw">else</span> {
<span class="ident">recursed_queues</span>.<span class="ident">insert</span>(<span class="ident">recurse_to</span>);
<span class="kw">let</span> (<span class="ident">head</span>, <span class="ident">head_dist</span>) <span class="op">=</span> <span class="kw-2">*</span><span class="ident">queues</span>[<span class="kw-2">&amp;</span><span class="ident">leader</span>.<span class="ident">router</span>.<span class="ident">head</span>()]
.<span class="ident">inner_get_car_positions</span>(<span class="ident">now</span>, <span class="ident">cars</span>, <span class="ident">queues</span>, <span class="ident">recursed_queues</span>)
.<span class="ident">last</span>()
<span class="kw">let</span> (<span class="ident">head</span>, <span class="ident">head_dist</span>) <span class="op">=</span> <span class="ident">queues</span>[<span class="kw-2">&amp;</span><span class="ident">leader</span>.<span class="ident">router</span>.<span class="ident">head</span>()]
.<span class="ident">inner_get_last_car_position</span>(
<span class="ident">now</span>,
<span class="ident">cars</span>,
<span class="ident">queues</span>,
<span class="ident">recursed_queues</span>,
<span class="prelude-val">None</span>,
)
.<span class="ident">unwrap</span>();
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">head</span>, <span class="ident">id</span>);
@ -443,7 +494,9 @@
<span class="comment">// There&#39;s spillover and a car shouldn&#39;t have been able to enter yet.</span>
<span class="kw">if</span> <span class="ident">bound</span> <span class="op">&lt;</span> <span class="ident">Distance</span>::<span class="ident">ZERO</span> {
<span class="ident">dump_cars</span>(<span class="kw-2">&amp;</span><span class="ident">result</span>, <span class="ident">cars</span>, <span class="self">self</span>.<span class="ident">id</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">intermediate_results</span>) <span class="op">=</span> <span class="ident">intermediate_results</span> {
<span class="ident">dump_cars</span>(<span class="ident">intermediate_results</span>, <span class="ident">cars</span>, <span class="self">self</span>.<span class="ident">id</span>, <span class="ident">now</span>);
}
<span class="macro">panic</span><span class="macro">!</span>(
<span class="string">&quot;Queue has spillover on {} at {} -- can&#39;t draw {}, bound is {}. Laggy head is \
{:?}. This is usually a geometry bug; check for duplicate roads going \
@ -475,13 +528,18 @@
<span class="ident">CarState</span>::<span class="ident">IdlingAtStop</span>(<span class="ident">front</span>, <span class="kw">_</span>) <span class="op">=&gt;</span> <span class="ident">front</span>,
};
<span class="ident">result</span>.<span class="ident">push</span>((<span class="kw-2">*</span><span class="ident">id</span>, <span class="ident">front</span>));
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="kw-2">ref</span> <span class="kw-2">mut</span> <span class="ident">intermediate_results</span>) <span class="op">=</span> <span class="ident">intermediate_results</span> {
<span class="ident">intermediate_results</span>.<span class="ident">push</span>((<span class="kw-2">*</span><span class="ident">id</span>, <span class="ident">front</span>));
}
<span class="ident">previous</span> <span class="op">=</span> <span class="prelude-val">Some</span>((<span class="kw-2">*</span><span class="ident">id</span>, <span class="ident">front</span>));
}
<span class="comment">// Enable to detect possible bugs, but save time otherwise</span>
<span class="kw">if</span> <span class="bool-val">false</span> {
<span class="ident">validate_positions</span>(<span class="kw-2">&amp;</span><span class="ident">result</span>, <span class="ident">cars</span>, <span class="ident">now</span>, <span class="self">self</span>.<span class="ident">id</span>)
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">intermediate_results</span>) <span class="op">=</span> <span class="ident">intermediate_results</span> {
<span class="ident">validate_positions</span>(<span class="ident">intermediate_results</span>, <span class="ident">cars</span>, <span class="ident">now</span>, <span class="self">self</span>.<span class="ident">id</span>)
}
}
<span class="ident">result</span>
<span class="ident">previous</span>
}
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">get_idx_to_insert_car</span>(