mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-11-28 12:12:00 +03:00
deploy: c0c7e22c40
This commit is contained in:
parent
4ec36ad036
commit
901d476c8d
@ -1,5 +1,5 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `BUILT_TIME_UTC` constant in crate `game`."><meta name="keywords" content="rust, rustlang, rust-lang, BUILT_TIME_UTC"><title>game::pregame::built_info::BUILT_TIME_UTC - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
|
||||
<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
|
||||
<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc constant"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../game/index.html'><div class='logo-container rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class="location"><a href="../../index.html">game</a>::<wbr><a href="../index.html">pregame</a>::<wbr><a href="index.html">built_info</a></p><script>window.sidebarCurrent = {name: "BUILT_TIME_UTC", ty: "constant", relpath: ""};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><span class="help-button">?</span>
|
||||
<a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../../../src/game/home/runner/work/abstreet/abstreet/target/debug/build/game-b5501e76eef510ad/out/built.rs.html#53" title="goto source code">[src]</a></span><span class="in-band">Constant <a href="../../index.html">game</a>::<wbr><a href="../index.html">pregame</a>::<wbr><a href="index.html">built_info</a>::<wbr><a class="constant" href="">BUILT_TIME_UTC</a></span></h1><pre class="rust const">pub const BUILT_TIME_UTC: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a> = "Sun, 03 Jan 2021 20:50:14 +0000";</pre><div class="docblock"><p>The built-time in RFC2822, UTC</p>
|
||||
<a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../../../src/game/home/runner/work/abstreet/abstreet/target/debug/build/game-b5501e76eef510ad/out/built.rs.html#53" title="goto source code">[src]</a></span><span class="in-band">Constant <a href="../../index.html">game</a>::<wbr><a href="../index.html">pregame</a>::<wbr><a href="index.html">built_info</a>::<wbr><a class="constant" href="">BUILT_TIME_UTC</a></span></h1><pre class="rust const">pub const BUILT_TIME_UTC: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a> = "Mon, 04 Jan 2021 02:14:23 +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,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 `all_walking_costs_from` fn in crate `map_model`."><meta name="keywords" content="rust, rustlang, rust-lang, all_walking_costs_from"><title>map_model::connectivity::all_walking_costs_from - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
|
||||
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
|
||||
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc fn"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../map_model/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">map_model</a>::<wbr><a href="index.html">connectivity</a></p><script>window.sidebarCurrent = {name: "all_walking_costs_from", ty: "fn", relpath: ""};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><span class="help-button">?</span>
|
||||
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../../src/map_model/connectivity/walking.rs.html#68-133" title="goto source code">[src]</a></span><span class="in-band">Function <a href="../index.html">map_model</a>::<wbr><a href="index.html">connectivity</a>::<wbr><a class="fn" href="">all_walking_costs_from</a></span></h1><pre class="rust fn">pub fn all_walking_costs_from(<br> map: &<a class="struct" href="../../map_model/struct.Map.html" title="struct map_model::Map">Map</a>, <br> start: <a class="struct" href="../../map_model/struct.BuildingID.html" title="struct map_model::BuildingID">BuildingID</a>, <br> time_limit: <a class="struct" href="../../geom/duration/struct.Duration.html" title="struct geom::duration::Duration">Duration</a>, <br> opts: <a class="struct" href="../../map_model/connectivity/struct.WalkingOptions.html" title="struct map_model::connectivity::WalkingOptions">WalkingOptions</a><br>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/collections/hash/map/struct.HashMap.html" title="struct std::collections::hash::map::HashMap">HashMap</a><<a class="struct" href="../../map_model/struct.BuildingID.html" title="struct map_model::BuildingID">BuildingID</a>, <a class="struct" href="../../geom/duration/struct.Duration.html" title="struct geom::duration::Duration">Duration</a>></pre><div class="docblock"><p>Starting from one building, calculate the cost to all others. If a destination isn't reachable,
|
||||
<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/map_model/connectivity/walking.rs.html#68-141" title="goto source code">[src]</a></span><span class="in-band">Function <a href="../index.html">map_model</a>::<wbr><a href="index.html">connectivity</a>::<wbr><a class="fn" href="">all_walking_costs_from</a></span></h1><pre class="rust fn">pub fn all_walking_costs_from(<br> map: &<a class="struct" href="../../map_model/struct.Map.html" title="struct map_model::Map">Map</a>, <br> start: <a class="struct" href="../../map_model/struct.BuildingID.html" title="struct map_model::BuildingID">BuildingID</a>, <br> time_limit: <a class="struct" href="../../geom/duration/struct.Duration.html" title="struct geom::duration::Duration">Duration</a>, <br> opts: <a class="struct" href="../../map_model/connectivity/struct.WalkingOptions.html" title="struct map_model::connectivity::WalkingOptions">WalkingOptions</a><br>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/collections/hash/map/struct.HashMap.html" title="struct std::collections::hash::map::HashMap">HashMap</a><<a class="struct" href="../../map_model/struct.BuildingID.html" title="struct map_model::BuildingID">BuildingID</a>, <a class="struct" href="../../geom/duration/struct.Duration.html" title="struct geom::duration::Duration">Duration</a>></pre><div class="docblock"><p>Starting from one building, calculate the cost to all others. If a destination isn't reachable,
|
||||
it won't be included in the results. Ignore results greater than the time_limit away.</p>
|
||||
<p>If the start building is on the shoulder of a road and <code>!opts.allow_shoulders</code>, then the
|
||||
results will always be empty.</p>
|
||||
|
@ -1,7 +1,7 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `all_walking_costs_from` fn in crate `map_model`."><meta name="keywords" content="rust, rustlang, rust-lang, all_walking_costs_from"><title>map_model::connectivity::walking::all_walking_costs_from - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
|
||||
<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
|
||||
<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc fn"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../map_model/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">map_model</a>::<wbr><a href="../index.html">connectivity</a>::<wbr><a href="index.html">walking</a></p><script>window.sidebarCurrent = {name: "all_walking_costs_from", ty: "fn", relpath: ""};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><span class="help-button">?</span>
|
||||
<a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../../../src/map_model/connectivity/walking.rs.html#68-133" title="goto source code">[src]</a></span><span class="in-band">Function <a href="../../index.html">map_model</a>::<wbr><a href="../index.html">connectivity</a>::<wbr><a href="index.html">walking</a>::<wbr><a class="fn" href="">all_walking_costs_from</a></span></h1><pre class="rust fn">pub fn all_walking_costs_from(<br> map: &<a class="struct" href="../../../map_model/struct.Map.html" title="struct map_model::Map">Map</a>, <br> start: <a class="struct" href="../../../map_model/struct.BuildingID.html" title="struct map_model::BuildingID">BuildingID</a>, <br> time_limit: <a class="struct" href="../../../geom/duration/struct.Duration.html" title="struct geom::duration::Duration">Duration</a>, <br> opts: <a class="struct" href="../../../map_model/connectivity/struct.WalkingOptions.html" title="struct map_model::connectivity::WalkingOptions">WalkingOptions</a><br>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/collections/hash/map/struct.HashMap.html" title="struct std::collections::hash::map::HashMap">HashMap</a><<a class="struct" href="../../../map_model/struct.BuildingID.html" title="struct map_model::BuildingID">BuildingID</a>, <a class="struct" href="../../../geom/duration/struct.Duration.html" title="struct geom::duration::Duration">Duration</a>></pre><div class="docblock"><p>Starting from one building, calculate the cost to all others. If a destination isn't reachable,
|
||||
<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/map_model/connectivity/walking.rs.html#68-141" title="goto source code">[src]</a></span><span class="in-band">Function <a href="../../index.html">map_model</a>::<wbr><a href="../index.html">connectivity</a>::<wbr><a href="index.html">walking</a>::<wbr><a class="fn" href="">all_walking_costs_from</a></span></h1><pre class="rust fn">pub fn all_walking_costs_from(<br> map: &<a class="struct" href="../../../map_model/struct.Map.html" title="struct map_model::Map">Map</a>, <br> start: <a class="struct" href="../../../map_model/struct.BuildingID.html" title="struct map_model::BuildingID">BuildingID</a>, <br> time_limit: <a class="struct" href="../../../geom/duration/struct.Duration.html" title="struct geom::duration::Duration">Duration</a>, <br> opts: <a class="struct" href="../../../map_model/connectivity/struct.WalkingOptions.html" title="struct map_model::connectivity::WalkingOptions">WalkingOptions</a><br>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/std/collections/hash/map/struct.HashMap.html" title="struct std::collections::hash::map::HashMap">HashMap</a><<a class="struct" href="../../../map_model/struct.BuildingID.html" title="struct map_model::BuildingID">BuildingID</a>, <a class="struct" href="../../../geom/duration/struct.Duration.html" title="struct geom::duration::Duration">Duration</a>></pre><div class="docblock"><p>Starting from one building, calculate the cost to all others. If a destination isn't reachable,
|
||||
it won't be included in the results. Ignore results greater than the time_limit away.</p>
|
||||
<p>If the start building is on the shoulder of a road and <code>!opts.allow_shoulders</code>, then the
|
||||
results will always be empty.</p>
|
||||
|
@ -1,7 +1,7 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `walking` mod in crate `map_model`."><meta name="keywords" content="rust, rustlang, rust-lang, walking"><title>map_model::connectivity::walking - Rust</title><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
|
||||
<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
|
||||
<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../map_model/index.html'><div class='logo-container rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a><p class="location">Module walking</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">map_model</a>::<wbr><a href="../index.html">connectivity</a></p><script>window.sidebarCurrent = {name: "walking", ty: "mod", relpath: "../"};</script><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><span class="help-button">?</span>
|
||||
<a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../../../src/map_model/connectivity/walking.rs.html#1-133" title="goto source code">[src]</a></span><span class="in-band">Module <a href="../../index.html">map_model</a>::<wbr><a href="../index.html">connectivity</a>::<wbr><a class="mod" href="">walking</a></span></h1><h2 id="structs" class="section-header"><a href="#structs">Structs</a></h2>
|
||||
<a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../../../src/map_model/connectivity/walking.rs.html#1-141" title="goto source code">[src]</a></span><span class="in-band">Module <a href="../../index.html">map_model</a>::<wbr><a href="../index.html">connectivity</a>::<wbr><a class="mod" href="">walking</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.Item.html" title="map_model::connectivity::walking::Item struct">Item</a></td><td class="docblock-short"></td></tr><tr class="module-item"><td><a class="struct" href="struct.WalkingOptions.html" title="map_model::connectivity::walking::WalkingOptions struct">WalkingOptions</a></td><td class="docblock-short"></td></tr></table><h2 id="functions" class="section-header"><a href="#functions">Functions</a></h2>
|
||||
<table><tr class="module-item"><td><a class="fn" href="fn.all_walking_costs_from.html" title="map_model::connectivity::walking::all_walking_costs_from fn">all_walking_costs_from</a></td><td class="docblock-short"><p>Starting from one building, calculate the cost to all others. If a destination isn't reachable,
|
||||
it won't be included in the results. Ignore results greater than the time_limit away.</p>
|
||||
|
@ -122,7 +122,7 @@
|
||||
<span class="doccomment">/// The output of `rustdoc -V`</span>
|
||||
<span class="kw">pub</span> <span class="kw">const</span> <span class="ident">RUSTDOC_VERSION</span>: <span class="kw-2">&</span><span class="ident">str</span> <span class="op">=</span> <span class="string">"rustdoc 1.49.0 (e1884a8e3 2020-12-29)"</span>;
|
||||
<span class="doccomment">/// The built-time in RFC2822, UTC</span>
|
||||
<span class="kw">pub</span> <span class="kw">const</span> <span class="ident">BUILT_TIME_UTC</span>: <span class="kw-2">&</span><span class="ident">str</span> <span class="op">=</span> <span class="string">"Sun, 03 Jan 2021 20:50:14 +0000"</span>;
|
||||
<span class="kw">pub</span> <span class="kw">const</span> <span class="ident">BUILT_TIME_UTC</span>: <span class="kw-2">&</span><span class="ident">str</span> <span class="op">=</span> <span class="string">"Mon, 04 Jan 2021 02:14:23 +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>
|
||||
|
@ -134,6 +134,14 @@
|
||||
<span id="131">131</span>
|
||||
<span id="132">132</span>
|
||||
<span id="133">133</span>
|
||||
<span id="134">134</span>
|
||||
<span id="135">135</span>
|
||||
<span id="136">136</span>
|
||||
<span id="137">137</span>
|
||||
<span id="138">138</span>
|
||||
<span id="139">139</span>
|
||||
<span id="140">140</span>
|
||||
<span id="141">141</span>
|
||||
</pre><div class="example-wrap"><pre class="rust ">
|
||||
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">cmp</span>::<span class="ident">Ordering</span>;
|
||||
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">collections</span>::{<span class="ident">BinaryHeap</span>, <span class="ident">HashMap</span>};
|
||||
@ -262,7 +270,15 @@
|
||||
<span class="comment">// end of the sidewalk to the building</span>
|
||||
<span class="kw">for</span> <span class="ident">b</span> <span class="kw">in</span> <span class="ident">map</span>.<span class="ident">all_buildings</span>() {
|
||||
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">cost</span>) <span class="op">=</span> <span class="ident">cost_per_node</span>.<span class="ident">get</span>(<span class="kw-2">&</span><span class="ident">WalkingNode</span>::<span class="ident">closest</span>(<span class="ident">b</span>.<span class="ident">sidewalk_pos</span>, <span class="ident">map</span>)) {
|
||||
<span class="ident">results</span>.<span class="ident">insert</span>(<span class="ident">b</span>.<span class="ident">id</span>, <span class="kw-2">*</span><span class="ident">cost</span>);
|
||||
<span class="kw">let</span> <span class="ident">sidewalk_len</span> <span class="op">=</span> <span class="ident">map</span>.<span class="ident">get_l</span>(<span class="ident">b</span>.<span class="ident">sidewalk</span>()).<span class="ident">length</span>();
|
||||
<span class="kw">let</span> <span class="ident">bldg_dist</span> <span class="op">=</span> <span class="ident">b</span>.<span class="ident">sidewalk_pos</span>.<span class="ident">dist_along</span>();
|
||||
<span class="kw">let</span> <span class="ident">distance_from_closest_node</span> <span class="op">=</span> <span class="kw">if</span> <span class="ident">sidewalk_len</span> <span class="op">-</span> <span class="ident">bldg_dist</span> <span class="op"><</span><span class="op">=</span> <span class="ident">bldg_dist</span> {
|
||||
<span class="ident">bldg_dist</span>
|
||||
}<span class="kw">else</span>{
|
||||
<span class="ident">sidewalk_len</span> <span class="op">-</span> <span class="ident">bldg_dist</span>
|
||||
};
|
||||
<span class="kw">let</span> <span class="ident">total_cost</span> <span class="op">=</span> <span class="kw-2">*</span><span class="ident">cost</span> <span class="op">+</span> <span class="ident">distance_from_closest_node</span> <span class="op">/</span> <span class="ident">opts</span>.<span class="ident">walking_speed</span>;
|
||||
<span class="ident">results</span>.<span class="ident">insert</span>(<span class="ident">b</span>.<span class="ident">id</span>, <span class="ident">total_cost</span>);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user