mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-12-25 07:25:47 +03:00
deploy: 0058f99da2
This commit is contained in:
parent
db83772ca0
commit
09d35e1ba5
@ -86,9 +86,9 @@ the event and immediately apply the transition. <a href="#method.panel_changed">
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.on_mouseover-13" class="method trait-impl has-srclink"><div class="rightside"></div><a href="#method.on_mouseover-13" class="anchor"></a><h4 class="code-header">fn <a href="#method.on_mouseover" class="fnname">on_mouseover</a>(&mut self, &mut EventCtx<'_>, <a class="primitive" href="https://doc.rust-lang.org/1.58.1/std/primitive.reference.html">&mut </a>A)</h4></div></summary><div class='docblock'><p>Called when the mouse has moved.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.other_event-13" class="method trait-impl has-srclink"><div class="rightside"></div><a href="#method.other_event-13" class="anchor"></a><h4 class="code-header">fn <a href="#method.other_event" class="fnname">other_event</a>(&mut self, &mut EventCtx<'_>, <a class="primitive" href="https://doc.rust-lang.org/1.58.1/std/primitive.reference.html">&mut </a>A) -> Transition<A></h4></div></summary><div class='docblock'><p>If a panel <code>on_click</code> event didn’t occur and <code>panel_changed</code> didn’t return transition, then
|
||||
call this to handle all other events. <a href="#method.other_event">Read more</a></p>
|
||||
</div></details><div id="method.draw-73" class="method trait-impl has-srclink"><div class="rightside"></div><a href="#method.draw-73" class="anchor"></a><h4 class="code-header">fn <a href="#method.draw" class="fnname">draw</a>(&self, &mut GfxCtx<'_>, <a class="primitive" href="https://doc.rust-lang.org/1.58.1/std/primitive.reference.html">&</a>A)</h4></div><div id="method.draw_baselayer-72" class="method trait-impl has-srclink"><div class="rightside"></div><a href="#method.draw_baselayer-72" class="anchor"></a><h4 class="code-header">fn <a href="#method.draw_baselayer" class="fnname">draw_baselayer</a>(&self) -> DrawBaselayer</h4></div></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-SimpleState%3CApp%3E-14" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/game/sandbox/gameplay/actdev.rs.html#269-282" title="goto source code">[src]</a></div><a href="#impl-SimpleState%3CApp%3E-14" class="anchor"></a><h3 class="code-header in-band">impl SimpleState<<a class="struct" href="struct.App.html" title="struct game::app::App">App</a>> for <a class="struct" href="../sandbox/gameplay/actdev/struct.About.html" title="struct game::sandbox::gameplay::actdev::About">About</a></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.on_click-14" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/game/sandbox/gameplay/actdev.rs.html#270-277" title="goto source code">[src]</a></div><a href="#method.on_click-14" class="anchor"></a><h4 class="code-header">fn <a class="fnname">on_click</a>(<br> &mut self, <br> _: &mut EventCtx<'_>, <br> _: &mut <a class="struct" href="struct.App.html" title="struct game::app::App">App</a>, <br> x: &<a class="primitive" href="https://doc.rust-lang.org/1.58.1/std/primitive.str.html">str</a>, <br> _: &mut Panel<br>) -> Transition<<a class="struct" href="struct.App.html" title="struct game::app::App">App</a>></h4></div></summary><div class='docblock'><p>Called when something on the panel has been clicked. Since the action is just a string,
|
||||
</div></details><div id="method.draw-73" class="method trait-impl has-srclink"><div class="rightside"></div><a href="#method.draw-73" class="anchor"></a><h4 class="code-header">fn <a href="#method.draw" class="fnname">draw</a>(&self, &mut GfxCtx<'_>, <a class="primitive" href="https://doc.rust-lang.org/1.58.1/std/primitive.reference.html">&</a>A)</h4></div><div id="method.draw_baselayer-72" class="method trait-impl has-srclink"><div class="rightside"></div><a href="#method.draw_baselayer-72" class="anchor"></a><h4 class="code-header">fn <a href="#method.draw_baselayer" class="fnname">draw_baselayer</a>(&self) -> DrawBaselayer</h4></div></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-SimpleState%3CApp%3E-14" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/game/sandbox/gameplay/actdev.rs.html#270-283" title="goto source code">[src]</a></div><a href="#impl-SimpleState%3CApp%3E-14" class="anchor"></a><h3 class="code-header in-band">impl SimpleState<<a class="struct" href="struct.App.html" title="struct game::app::App">App</a>> for <a class="struct" href="../sandbox/gameplay/actdev/struct.About.html" title="struct game::sandbox::gameplay::actdev::About">About</a></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.on_click-14" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/game/sandbox/gameplay/actdev.rs.html#271-278" title="goto source code">[src]</a></div><a href="#method.on_click-14" class="anchor"></a><h4 class="code-header">fn <a class="fnname">on_click</a>(<br> &mut self, <br> _: &mut EventCtx<'_>, <br> _: &mut <a class="struct" href="struct.App.html" title="struct game::app::App">App</a>, <br> x: &<a class="primitive" href="https://doc.rust-lang.org/1.58.1/std/primitive.str.html">str</a>, <br> _: &mut Panel<br>) -> Transition<<a class="struct" href="struct.App.html" title="struct game::app::App">App</a>></h4></div></summary><div class='docblock'><p>Called when something on the panel has been clicked. Since the action is just a string,
|
||||
the fallback case can just use <code>unreachable!()</code>. <a href="#tymethod.on_click">Read more</a></p>
|
||||
</div></details><div id="method.draw-74" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/game/sandbox/gameplay/actdev.rs.html#279-281" title="goto source code">[src]</a></div><a href="#method.draw-74" class="anchor"></a><h4 class="code-header">fn <a href="#method.draw" class="fnname">draw</a>(&self, g: &mut GfxCtx<'_>, app: &<a class="struct" href="struct.App.html" title="struct game::app::App">App</a>)</h4></div><details class="rustdoc-toggle method-toggle" open><summary><div id="method.on_click_custom-14" class="method trait-impl has-srclink"><div class="rightside"></div><a href="#method.on_click_custom-14" class="anchor"></a><h4 class="code-header">fn <a href="#method.on_click_custom" class="fnname">on_click_custom</a>(<br> &mut self, <br> _ctx: &mut EventCtx<'_>, <br> _app: <a class="primitive" href="https://doc.rust-lang.org/1.58.1/std/primitive.reference.html">&mut </a>A, <br> _action: <a class="struct" href="https://doc.rust-lang.org/1.58.1/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><dyn <a class="trait" href="../../abstutil/clone/trait.CloneableAny.html" title="trait abstutil::clone::CloneableAny">CloneableAny</a> + 'static, <a class="struct" href="https://doc.rust-lang.org/1.58.1/alloc/alloc/struct.Global.html" title="struct alloc::alloc::Global">Global</a>>, <br> _panel: &mut Panel<br>) -> Transition<A></h4></div></summary><div class='docblock'><p>Called when something on the panel has been clicked.</p>
|
||||
</div></details><div id="method.draw-74" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/game/sandbox/gameplay/actdev.rs.html#280-282" title="goto source code">[src]</a></div><a href="#method.draw-74" class="anchor"></a><h4 class="code-header">fn <a href="#method.draw" class="fnname">draw</a>(&self, g: &mut GfxCtx<'_>, app: &<a class="struct" href="struct.App.html" title="struct game::app::App">App</a>)</h4></div><details class="rustdoc-toggle method-toggle" open><summary><div id="method.on_click_custom-14" class="method trait-impl has-srclink"><div class="rightside"></div><a href="#method.on_click_custom-14" class="anchor"></a><h4 class="code-header">fn <a href="#method.on_click_custom" class="fnname">on_click_custom</a>(<br> &mut self, <br> _ctx: &mut EventCtx<'_>, <br> _app: <a class="primitive" href="https://doc.rust-lang.org/1.58.1/std/primitive.reference.html">&mut </a>A, <br> _action: <a class="struct" href="https://doc.rust-lang.org/1.58.1/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><dyn <a class="trait" href="../../abstutil/clone/trait.CloneableAny.html" title="trait abstutil::clone::CloneableAny">CloneableAny</a> + 'static, <a class="struct" href="https://doc.rust-lang.org/1.58.1/alloc/alloc/struct.Global.html" title="struct alloc::alloc::Global">Global</a>>, <br> _panel: &mut Panel<br>) -> Transition<A></h4></div></summary><div class='docblock'><p>Called when something on the panel has been clicked.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.panel_changed-15" class="method trait-impl has-srclink"><div class="rightside"></div><a href="#method.panel_changed-15" class="anchor"></a><h4 class="code-header">fn <a href="#method.panel_changed" class="fnname">panel_changed</a>(<br> &mut self, <br> &mut EventCtx<'_>, <br> <a class="primitive" href="https://doc.rust-lang.org/1.58.1/std/primitive.reference.html">&mut </a>A, <br> &mut Panel<br>) -> <a class="enum" href="https://doc.rust-lang.org/1.58.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Transition<A>></h4></div></summary><div class='docblock'><p>Called when something on the panel has changed. If a transition is returned, stop handling
|
||||
the event and immediately apply the transition. <a href="#method.panel_changed">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.on_mouseover-14" class="method trait-impl has-srclink"><div class="rightside"></div><a href="#method.on_mouseover-14" class="anchor"></a><h4 class="code-header">fn <a href="#method.on_mouseover" class="fnname">on_mouseover</a>(&mut self, &mut EventCtx<'_>, <a class="primitive" href="https://doc.rust-lang.org/1.58.1/std/primitive.reference.html">&mut </a>A)</h4></div></summary><div class='docblock'><p>Called when the mouse has moved.</p>
|
||||
|
@ -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 `find_active_trip` fn in crate `game`."><meta name="keywords" content="rust, rustlang, rust-lang, find_active_trip"><title>find_active_trip in game::sandbox::gameplay::actdev - 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><script src="../../../../crates.js"></script><script defer src="../../../../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../../favicon.svg"><style type="text/css">#crate-search{background-image:url("../../../../down-arrow.svg");}</style></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">☰</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"><h2 class="location">Other items in<br><a href="../../../index.html">game</a>::<wbr><a href="../../index.html">sandbox</a>::<wbr><a href="../index.html">gameplay</a>::<wbr><a href="index.html">actdev</a></h2><div id="sidebar-vars" data-name="find_active_trip" data-ty="fn" data-relpath=""></div><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" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><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" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../../../wheel.svg"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Function <a href="../../../index.html">game</a>::<wbr><a href="../../index.html">sandbox</a>::<wbr><a href="../index.html">gameplay</a>::<wbr><a href="index.html">actdev</a>::<wbr><a class="fn" href="#">find_active_trip</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span><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/sandbox/gameplay/actdev.rs.html#284-294" title="goto source code">[src]</a></span></h1><div class="docblock item-decl"><pre class="rust fn"><code>fn find_active_trip(app: &<a class="struct" href="../../../app/struct.App.html" title="struct game::app::App">App</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.58.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/1.58.1/std/primitive.tuple.html">(</a><a class="struct" href="../../../../sim/struct.PersonID.html" title="struct sim::PersonID">PersonID</a>, <a class="struct" href="../../../../sim/struct.TripID.html" title="struct sim::TripID">TripID</a><a class="primitive" href="https://doc.rust-lang.org/1.58.1/std/primitive.tuple.html">)</a>></code></pre></div></section><section id="search" class="content hidden"></section><div id="rustdoc-vars" data-root-path="../../../../" data-current-crate="game" data-search-index-js="../../../../search-index.js" data-search-js="../../../../search.js"></div>
|
||||
<noscript><link rel="stylesheet" href="../../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../../favicon.svg"><style type="text/css">#crate-search{background-image:url("../../../../down-arrow.svg");}</style></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">☰</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"><h2 class="location">Other items in<br><a href="../../../index.html">game</a>::<wbr><a href="../../index.html">sandbox</a>::<wbr><a href="../index.html">gameplay</a>::<wbr><a href="index.html">actdev</a></h2><div id="sidebar-vars" data-name="find_active_trip" data-ty="fn" data-relpath=""></div><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" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><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" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../../../wheel.svg"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Function <a href="../../../index.html">game</a>::<wbr><a href="../../index.html">sandbox</a>::<wbr><a href="../index.html">gameplay</a>::<wbr><a href="index.html">actdev</a>::<wbr><a class="fn" href="#">find_active_trip</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span><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/sandbox/gameplay/actdev.rs.html#285-295" title="goto source code">[src]</a></span></h1><div class="docblock item-decl"><pre class="rust fn"><code>fn find_active_trip(app: &<a class="struct" href="../../../app/struct.App.html" title="struct game::app::App">App</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.58.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/1.58.1/std/primitive.tuple.html">(</a><a class="struct" href="../../../../sim/struct.PersonID.html" title="struct sim::PersonID">PersonID</a>, <a class="struct" href="../../../../sim/struct.TripID.html" title="struct sim::TripID">TripID</a><a class="primitive" href="https://doc.rust-lang.org/1.58.1/std/primitive.tuple.html">)</a>></code></pre></div></section><section id="search" class="content hidden"></section><div id="rustdoc-vars" data-root-path="../../../../" data-current-crate="game" data-search-index-js="../../../../search-index.js" data-search-js="../../../../search.js"></div>
|
||||
</body></html>
|
@ -1,5 +1,5 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `actdev` mod in crate `game`."><meta name="keywords" content="rust, rustlang, rust-lang, actdev"><title>game::sandbox::gameplay::actdev - 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><script src="../../../../crates.js"></script><script defer src="../../../../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../../favicon.svg"><style type="text/css">#crate-search{background-image:url("../../../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">☰</div><a href='../../../../game/index.html'><div class='logo-container rust-logo'><img src='../../../../rust-logo.png' alt='logo'></div></a><h2 class="location">Module actdev</h2><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><div id="sidebar-vars" data-name="actdev" data-ty="mod" data-relpath="./"></div><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" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><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" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../../../wheel.svg"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Module <a href="../../../index.html">game</a>::<wbr><a href="../../index.html">sandbox</a>::<wbr><a href="../index.html">gameplay</a>::<wbr><a class="mod" href="#">actdev</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span><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/sandbox/gameplay/actdev.rs.html#1-294" title="goto source code">[src]</a></span></h1><h2 id="structs" class="small-section-header"><a href="#structs">Structs</a></h2>
|
||||
<noscript><link rel="stylesheet" href="../../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../../favicon.svg"><style type="text/css">#crate-search{background-image:url("../../../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">☰</div><a href='../../../../game/index.html'><div class='logo-container rust-logo'><img src='../../../../rust-logo.png' alt='logo'></div></a><h2 class="location">Module actdev</h2><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><div id="sidebar-vars" data-name="actdev" data-ty="mod" data-relpath="./"></div><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" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><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" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../../../wheel.svg"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Module <a href="../../../index.html">game</a>::<wbr><a href="../../index.html">sandbox</a>::<wbr><a href="../index.html">gameplay</a>::<wbr><a class="mod" href="#">actdev</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span><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/sandbox/gameplay/actdev.rs.html#1-295" title="goto source code">[src]</a></span></h1><h2 id="structs" class="small-section-header"><a href="#structs">Structs</a></h2>
|
||||
<div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.About.html" title="game::sandbox::gameplay::actdev::About struct">About</a></div><div class="item-right docblock-short"></div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.Actdev.html" title="game::sandbox::gameplay::actdev::Actdev struct">Actdev</a></div><div class="item-right docblock-short"><p>A gameplay mode with specific controls for integration with
|
||||
https://cyipt.github.io/acton/articles/the-actdev-project.html.</p>
|
||||
</div></div></div><h2 id="functions" class="small-section-header"><a href="#functions">Functions</a></h2>
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -20,5 +20,5 @@ type <code>__T</code>. Returns the original <code>Rc</code>-ed trait if it isn
|
||||
<code>None</code> if it isn’t.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.downcast_mut" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../src/game/sandbox/gameplay/mod.rs.html#80" title="goto source code">[src]</a></div><a href="#method.downcast_mut" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.downcast_mut" class="fnname">downcast_mut</a><__T: <a class="trait" href="trait.GameplayState.html" title="trait game::sandbox::gameplay::GameplayState">GameplayState</a>>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.58.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/1.58.1/std/primitive.reference.html">&mut </a>__T></h4></div></summary><div class="docblock"><p>Returns a mutable reference to the object within the trait object if it is of type
|
||||
<code>__T</code>, or <code>None</code> if it isn’t.</p>
|
||||
</div></details></div></details><h2 id="implementors" class="small-section-header">Implementors<a href="#implementors" class="anchor"></a></h2><div class="item-list" id="implementors-list"><div id="impl-GameplayState" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../../src/game/sandbox/gameplay/actdev.rs.html#49-265" title="goto source code">[src]</a></div><a href="#impl-GameplayState" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="trait.GameplayState.html" title="trait game::sandbox::gameplay::GameplayState">GameplayState</a> for <a class="struct" href="actdev/struct.Actdev.html" title="struct game::sandbox::gameplay::actdev::Actdev">Actdev</a></h3></div><div id="impl-GameplayState-1" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../../src/game/sandbox/gameplay/commute.rs.html#102-219" title="goto source code">[src]</a></div><a href="#impl-GameplayState-1" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="trait.GameplayState.html" title="trait game::sandbox::gameplay::GameplayState">GameplayState</a> for <a class="struct" href="commute/struct.OptimizeCommute.html" title="struct game::sandbox::gameplay::commute::OptimizeCommute">OptimizeCommute</a></h3></div><div id="impl-GameplayState-2" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../../src/game/sandbox/gameplay/fix_traffic_signals.rs.html#84-319" title="goto source code">[src]</a></div><a href="#impl-GameplayState-2" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="trait.GameplayState.html" title="trait game::sandbox::gameplay::GameplayState">GameplayState</a> for <a class="struct" href="fix_traffic_signals/struct.FixTrafficSignals.html" title="struct game::sandbox::gameplay::fix_traffic_signals::FixTrafficSignals">FixTrafficSignals</a></h3></div><div id="impl-GameplayState-3" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../../src/game/sandbox/gameplay/freeform/mod.rs.html#41-170" title="goto source code">[src]</a></div><a href="#impl-GameplayState-3" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="trait.GameplayState.html" title="trait game::sandbox::gameplay::GameplayState">GameplayState</a> for <a class="struct" href="freeform/struct.Freeform.html" title="struct game::sandbox::gameplay::freeform::Freeform">Freeform</a></h3></div><div id="impl-GameplayState-4" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../../src/game/sandbox/gameplay/play_scenario.rs.html#55-210" title="goto source code">[src]</a></div><a href="#impl-GameplayState-4" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="trait.GameplayState.html" title="trait game::sandbox::gameplay::GameplayState">GameplayState</a> for <a class="struct" href="play_scenario/struct.PlayScenario.html" title="struct game::sandbox::gameplay::play_scenario::PlayScenario">PlayScenario</a></h3></div><div id="impl-GameplayState-5" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../../src/game/sandbox/gameplay/tutorial.rs.html#355-460" title="goto source code">[src]</a></div><a href="#impl-GameplayState-5" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="trait.GameplayState.html" title="trait game::sandbox::gameplay::GameplayState">GameplayState</a> for <a class="struct" href="tutorial/struct.Tutorial.html" title="struct game::sandbox::gameplay::tutorial::Tutorial">Tutorial</a></h3></div></div><script type="text/javascript" src="../../../implementors/game/sandbox/gameplay/trait.GameplayState.js" async></script></section><section id="search" class="content hidden"></section><div id="rustdoc-vars" data-root-path="../../../" data-current-crate="game" data-search-index-js="../../../search-index.js" data-search-js="../../../search.js"></div>
|
||||
</div></details></div></details><h2 id="implementors" class="small-section-header">Implementors<a href="#implementors" class="anchor"></a></h2><div class="item-list" id="implementors-list"><div id="impl-GameplayState" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../../src/game/sandbox/gameplay/actdev.rs.html#49-266" title="goto source code">[src]</a></div><a href="#impl-GameplayState" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="trait.GameplayState.html" title="trait game::sandbox::gameplay::GameplayState">GameplayState</a> for <a class="struct" href="actdev/struct.Actdev.html" title="struct game::sandbox::gameplay::actdev::Actdev">Actdev</a></h3></div><div id="impl-GameplayState-1" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../../src/game/sandbox/gameplay/commute.rs.html#102-219" title="goto source code">[src]</a></div><a href="#impl-GameplayState-1" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="trait.GameplayState.html" title="trait game::sandbox::gameplay::GameplayState">GameplayState</a> for <a class="struct" href="commute/struct.OptimizeCommute.html" title="struct game::sandbox::gameplay::commute::OptimizeCommute">OptimizeCommute</a></h3></div><div id="impl-GameplayState-2" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../../src/game/sandbox/gameplay/fix_traffic_signals.rs.html#84-319" title="goto source code">[src]</a></div><a href="#impl-GameplayState-2" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="trait.GameplayState.html" title="trait game::sandbox::gameplay::GameplayState">GameplayState</a> for <a class="struct" href="fix_traffic_signals/struct.FixTrafficSignals.html" title="struct game::sandbox::gameplay::fix_traffic_signals::FixTrafficSignals">FixTrafficSignals</a></h3></div><div id="impl-GameplayState-3" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../../src/game/sandbox/gameplay/freeform/mod.rs.html#41-170" title="goto source code">[src]</a></div><a href="#impl-GameplayState-3" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="trait.GameplayState.html" title="trait game::sandbox::gameplay::GameplayState">GameplayState</a> for <a class="struct" href="freeform/struct.Freeform.html" title="struct game::sandbox::gameplay::freeform::Freeform">Freeform</a></h3></div><div id="impl-GameplayState-4" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../../src/game/sandbox/gameplay/play_scenario.rs.html#55-210" title="goto source code">[src]</a></div><a href="#impl-GameplayState-4" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="trait.GameplayState.html" title="trait game::sandbox::gameplay::GameplayState">GameplayState</a> for <a class="struct" href="play_scenario/struct.PlayScenario.html" title="struct game::sandbox::gameplay::play_scenario::PlayScenario">PlayScenario</a></h3></div><div id="impl-GameplayState-5" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../../src/game/sandbox/gameplay/tutorial.rs.html#355-460" title="goto source code">[src]</a></div><a href="#impl-GameplayState-5" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="trait.GameplayState.html" title="trait game::sandbox::gameplay::GameplayState">GameplayState</a> for <a class="struct" href="tutorial/struct.Tutorial.html" title="struct game::sandbox::gameplay::tutorial::Tutorial">Tutorial</a></h3></div></div><script type="text/javascript" src="../../../implementors/game/sandbox/gameplay/trait.GameplayState.js" async></script></section><section id="search" class="content hidden"></section><div id="rustdoc-vars" data-root-path="../../../" data-current-crate="game" data-search-index-js="../../../search-index.js" data-search-js="../../../search.js"></div>
|
||||
</body></html>
|
@ -1,4 +1,4 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="The build time in RFC2822, UTC."><meta name="keywords" content="rust, rustlang, rust-lang, BUILT_TIME_UTC"><title>BUILT_TIME_UTC in map_gui::tools::title_screen::built_info - 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><script src="../../../../crates.js"></script><script defer src="../../../../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../../favicon.svg"><style type="text/css">#crate-search{background-image:url("../../../../down-arrow.svg");}</style></head><body class="rustdoc constant"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">☰</div><a href='../../../../map_gui/index.html'><div class='logo-container rust-logo'><img src='../../../../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><h2 class="location">Other items in<br><a href="../../../index.html">map_gui</a>::<wbr><a href="../../index.html">tools</a>::<wbr><a href="../index.html">title_screen</a>::<wbr><a href="index.html">built_info</a></h2><div id="sidebar-vars" data-name="BUILT_TIME_UTC" data-ty="constant" data-relpath=""></div><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" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><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" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../../../wheel.svg"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Constant <a href="../../../index.html">map_gui</a>::<wbr><a href="../../index.html">tools</a>::<wbr><a href="../index.html">title_screen</a>::<wbr><a href="index.html">built_info</a>::<wbr><a class="constant" href="#">BUILT_TIME_UTC</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span><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_gui/home/runner/work/abstreet/abstreet/target/debug/build/map_gui-c32b77646ab1d63c/out/built.rs.html#78" title="goto source code">[src]</a></span></h1><div class="docblock item-decl"><pre class="rust const"><code>pub const BUILT_TIME_UTC: &<a class="primitive" href="https://doc.rust-lang.org/1.58.1/std/primitive.str.html">str</a> = r"Fri, 28 Jan 2022 13:22:29 +0000";</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>The build time in RFC2822, UTC.</p>
|
||||
<noscript><link rel="stylesheet" href="../../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../../favicon.svg"><style type="text/css">#crate-search{background-image:url("../../../../down-arrow.svg");}</style></head><body class="rustdoc constant"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">☰</div><a href='../../../../map_gui/index.html'><div class='logo-container rust-logo'><img src='../../../../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><h2 class="location">Other items in<br><a href="../../../index.html">map_gui</a>::<wbr><a href="../../index.html">tools</a>::<wbr><a href="../index.html">title_screen</a>::<wbr><a href="index.html">built_info</a></h2><div id="sidebar-vars" data-name="BUILT_TIME_UTC" data-ty="constant" data-relpath=""></div><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" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><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" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../../../wheel.svg"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Constant <a href="../../../index.html">map_gui</a>::<wbr><a href="../../index.html">tools</a>::<wbr><a href="../index.html">title_screen</a>::<wbr><a href="index.html">built_info</a>::<wbr><a class="constant" href="#">BUILT_TIME_UTC</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span><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_gui/home/runner/work/abstreet/abstreet/target/debug/build/map_gui-c32b77646ab1d63c/out/built.rs.html#78" title="goto source code">[src]</a></span></h1><div class="docblock item-decl"><pre class="rust const"><code>pub const BUILT_TIME_UTC: &<a class="primitive" href="https://doc.rust-lang.org/1.58.1/std/primitive.str.html">str</a> = r"Sun, 30 Jan 2022 18:34:39 +0000";</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>The build time in RFC2822, UTC.</p>
|
||||
</div></details></section><section id="search" class="content hidden"></section><div id="rustdoc-vars" data-root-path="../../../../" data-current-crate="map_gui" data-search-index-js="../../../../search-index.js" data-search-js="../../../../search.js"></div>
|
||||
</body></html>
|
File diff suppressed because one or more lines are too long
@ -223,7 +223,7 @@
|
||||
}
|
||||
|
||||
<span class="kw">let</span> <span class="ident">work</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">person</span>.<span class="ident">trips</span>[<span class="ident">num_trips</span> <span class="op">-</span> <span class="number">2</span>].<span class="ident">destination</span> {
|
||||
<span class="ident">TripEndpoint::Bldg</span>(<span class="ident">b</span>) => <span class="ident">b</span>,
|
||||
<span class="ident">TripEndpoint::Building</span>(<span class="ident">b</span>) => <span class="ident">b</span>,
|
||||
<span class="kw">_</span> => <span class="kw">continue</span>,
|
||||
};
|
||||
<span class="kw">let</span> <span class="ident">has_bike</span> <span class="op">=</span> <span class="ident">person</span>.<span class="ident">trips</span>[<span class="ident">num_trips</span> <span class="op">-</span> <span class="number">2</span>].<span class="ident">mode</span> <span class="op">==</span> <span class="ident">TripMode::Bike</span>;
|
||||
@ -242,15 +242,15 @@
|
||||
<span class="ident">person</span>.<span class="ident">trips</span>.<span class="ident">push</span>(<span class="ident">IndividTrip::new</span>(
|
||||
<span class="ident">depart</span>,
|
||||
<span class="ident">TripPurpose::Meal</span>,
|
||||
<span class="ident">TripEndpoint::Bldg</span>(<span class="ident">work</span>),
|
||||
<span class="ident">TripEndpoint::Bldg</span>(<span class="ident">restaurant</span>),
|
||||
<span class="ident">TripEndpoint::Building</span>(<span class="ident">work</span>),
|
||||
<span class="ident">TripEndpoint::Building</span>(<span class="ident">restaurant</span>),
|
||||
<span class="ident">mode</span>,
|
||||
));
|
||||
<span class="ident">person</span>.<span class="ident">trips</span>.<span class="ident">push</span>(<span class="ident">IndividTrip::new</span>(
|
||||
<span class="ident">depart</span> <span class="op">+</span> <span class="ident">Duration::minutes</span>(<span class="number">30</span>),
|
||||
<span class="ident">TripPurpose::Work</span>,
|
||||
<span class="ident">TripEndpoint::Bldg</span>(<span class="ident">restaurant</span>),
|
||||
<span class="ident">TripEndpoint::Bldg</span>(<span class="ident">work</span>),
|
||||
<span class="ident">TripEndpoint::Building</span>(<span class="ident">restaurant</span>),
|
||||
<span class="ident">TripEndpoint::Building</span>(<span class="ident">work</span>),
|
||||
<span class="ident">mode</span>,
|
||||
));
|
||||
<span class="ident">person</span>.<span class="ident">trips</span>.<span class="ident">push</span>(<span class="ident">return_home</span>);
|
||||
|
@ -1933,7 +1933,7 @@
|
||||
))
|
||||
}
|
||||
(<span class="ident">ID::Building</span>(<span class="ident">b</span>), <span class="string">"route from here"</span>) => <span class="ident">Transition::Push</span>(
|
||||
<span class="ident">routes::RouteExplorer::new_state</span>(<span class="ident">ctx</span>, <span class="ident">app</span>, <span class="ident">TripEndpoint::Bldg</span>(<span class="ident">b</span>)),
|
||||
<span class="ident">routes::RouteExplorer::new_state</span>(<span class="ident">ctx</span>, <span class="ident">app</span>, <span class="ident">TripEndpoint::Building</span>(<span class="ident">b</span>)),
|
||||
),
|
||||
<span class="kw">_</span> => <span class="macro">unreachable!</span>(),
|
||||
}
|
||||
|
@ -715,7 +715,7 @@
|
||||
}
|
||||
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">hovering</span>) <span class="op">=</span> <span class="kw">match</span> <span class="ident">app</span>.<span class="ident">primary</span>.<span class="ident">current_selection</span> {
|
||||
<span class="prelude-val">Some</span>(<span class="ident">ID::Intersection</span>(<span class="ident">i</span>)) => <span class="prelude-val">Some</span>(<span class="ident">TripEndpoint::Border</span>(<span class="ident">i</span>)),
|
||||
<span class="prelude-val">Some</span>(<span class="ident">ID::Building</span>(<span class="ident">b</span>)) => <span class="prelude-val">Some</span>(<span class="ident">TripEndpoint::Bldg</span>(<span class="ident">b</span>)),
|
||||
<span class="prelude-val">Some</span>(<span class="ident">ID::Building</span>(<span class="ident">b</span>)) => <span class="prelude-val">Some</span>(<span class="ident">TripEndpoint::Building</span>(<span class="ident">b</span>)),
|
||||
<span class="prelude-val">None</span> => <span class="prelude-val">None</span>,
|
||||
<span class="kw">_</span> => <span class="macro">unreachable!</span>(),
|
||||
} {
|
||||
@ -754,7 +754,7 @@
|
||||
<span class="ident">Color::BLUE</span>.<span class="ident">alpha</span>(<span class="number">0.8</span>),
|
||||
<span class="kw">match</span> <span class="self">self</span>.<span class="ident">start</span> {
|
||||
<span class="ident">TripEndpoint::Border</span>(<span class="ident">i</span>) => <span class="ident">app</span>.<span class="ident">primary</span>.<span class="ident">map</span>.<span class="ident">get_i</span>(<span class="ident">i</span>).<span class="ident">polygon</span>.<span class="ident">clone</span>(),
|
||||
<span class="ident">TripEndpoint::Bldg</span>(<span class="ident">b</span>) => <span class="ident">app</span>.<span class="ident">primary</span>.<span class="ident">map</span>.<span class="ident">get_b</span>(<span class="ident">b</span>).<span class="ident">polygon</span>.<span class="ident">clone</span>(),
|
||||
<span class="ident">TripEndpoint::Building</span>(<span class="ident">b</span>) => <span class="ident">app</span>.<span class="ident">primary</span>.<span class="ident">map</span>.<span class="ident">get_b</span>(<span class="ident">b</span>).<span class="ident">polygon</span>.<span class="ident">clone</span>(),
|
||||
<span class="ident">TripEndpoint::SuddenlyAppear</span>(<span class="kw">_</span>) => <span class="macro">unreachable!</span>(),
|
||||
},
|
||||
);
|
||||
@ -763,7 +763,7 @@
|
||||
<span class="ident">Color::GREEN</span>.<span class="ident">alpha</span>(<span class="number">0.8</span>),
|
||||
<span class="kw">match</span> <span class="ident">endpt</span> {
|
||||
<span class="ident">TripEndpoint::Border</span>(<span class="ident">i</span>) => <span class="ident">app</span>.<span class="ident">primary</span>.<span class="ident">map</span>.<span class="ident">get_i</span>(<span class="kw-2">*</span><span class="ident">i</span>).<span class="ident">polygon</span>.<span class="ident">clone</span>(),
|
||||
<span class="ident">TripEndpoint::Bldg</span>(<span class="ident">b</span>) => <span class="ident">app</span>.<span class="ident">primary</span>.<span class="ident">map</span>.<span class="ident">get_b</span>(<span class="kw-2">*</span><span class="ident">b</span>).<span class="ident">polygon</span>.<span class="ident">clone</span>(),
|
||||
<span class="ident">TripEndpoint::Building</span>(<span class="ident">b</span>) => <span class="ident">app</span>.<span class="ident">primary</span>.<span class="ident">map</span>.<span class="ident">get_b</span>(<span class="kw-2">*</span><span class="ident">b</span>).<span class="ident">polygon</span>.<span class="ident">clone</span>(),
|
||||
<span class="ident">TripEndpoint::SuddenlyAppear</span>(<span class="kw">_</span>) => <span class="macro">unreachable!</span>(),
|
||||
},
|
||||
);
|
||||
|
@ -190,7 +190,7 @@
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">per_bldg</span> <span class="op">=</span> <span class="ident">Counter::new</span>();
|
||||
<span class="kw">for</span> <span class="ident">p</span> <span class="kw">in</span> <span class="kw-2">&</span><span class="ident">scenario</span>.<span class="ident">people</span> {
|
||||
<span class="kw">for</span> <span class="ident">trip</span> <span class="kw">in</span> <span class="kw-2">&</span><span class="ident">p</span>.<span class="ident">trips</span> {
|
||||
<span class="kw">if</span> <span class="kw">let</span> <span class="ident">TripEndpoint::Bldg</span>(<span class="ident">b</span>) <span class="op">=</span> <span class="ident">trip</span>.<span class="ident">destination</span> {
|
||||
<span class="kw">if</span> <span class="kw">let</span> <span class="ident">TripEndpoint::Building</span>(<span class="ident">b</span>) <span class="op">=</span> <span class="ident">trip</span>.<span class="ident">destination</span> {
|
||||
<span class="ident">per_bldg</span>.<span class="ident">inc</span>(<span class="ident">b</span>);
|
||||
}
|
||||
}
|
||||
|
@ -1139,7 +1139,7 @@
|
||||
<span class="kw">for</span> <span class="ident">t</span> <span class="kw">in</span> <span class="kw-2">&</span><span class="ident">person</span>.<span class="ident">trips</span> {
|
||||
<span class="kw">let</span> <span class="ident">trip</span> <span class="op">=</span> <span class="ident">app</span>.<span class="ident">primary</span>.<span class="ident">sim</span>.<span class="ident">trip_info</span>(<span class="kw-2">*</span><span class="ident">t</span>);
|
||||
<span class="kw">let</span> <span class="ident">at</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">trip</span>.<span class="ident">start</span> {
|
||||
<span class="ident">TripEndpoint::Bldg</span>(<span class="ident">b</span>) => {
|
||||
<span class="ident">TripEndpoint::Building</span>(<span class="ident">b</span>) => {
|
||||
<span class="kw">let</span> <span class="ident">b</span> <span class="op">=</span> <span class="ident">app</span>.<span class="ident">primary</span>.<span class="ident">map</span>.<span class="ident">get_b</span>(<span class="ident">b</span>);
|
||||
<span class="kw">if</span> <span class="ident">b</span>.<span class="ident">amenities</span>.<span class="ident">is_empty</span>() {
|
||||
<span class="ident">b</span>.<span class="ident">address</span>.<span class="ident">clone</span>()
|
||||
@ -1164,7 +1164,7 @@
|
||||
<span class="comment">// Where do they spend the night?</span>
|
||||
<span class="kw">let</span> <span class="ident">last_trip</span> <span class="op">=</span> <span class="ident">app</span>.<span class="ident">primary</span>.<span class="ident">sim</span>.<span class="ident">trip_info</span>(<span class="kw-2">*</span><span class="ident">person</span>.<span class="ident">trips</span>.<span class="ident">last</span>().<span class="ident">unwrap</span>());
|
||||
<span class="kw">let</span> <span class="ident">at</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">last_trip</span>.<span class="ident">end</span> {
|
||||
<span class="ident">TripEndpoint::Bldg</span>(<span class="ident">b</span>) => {
|
||||
<span class="ident">TripEndpoint::Building</span>(<span class="ident">b</span>) => {
|
||||
<span class="kw">let</span> <span class="ident">b</span> <span class="op">=</span> <span class="ident">app</span>.<span class="ident">primary</span>.<span class="ident">map</span>.<span class="ident">get_b</span>(<span class="ident">b</span>);
|
||||
<span class="kw">if</span> <span class="ident">b</span>.<span class="ident">amenities</span>.<span class="ident">is_empty</span>() {
|
||||
<span class="ident">b</span>.<span class="ident">address</span>.<span class="ident">clone</span>()
|
||||
|
@ -1894,7 +1894,7 @@
|
||||
<span class="comment">// (ID, center, name)</span>
|
||||
<span class="kw">fn</span> <span class="ident">endpoint</span>(<span class="ident">endpt</span>: <span class="kw-2">&</span><span class="ident">TripEndpoint</span>, <span class="ident">app</span>: <span class="kw-2">&</span><span class="ident">App</span>) -> (<span class="ident">ID</span>, <span class="ident">Pt2D</span>, <span class="ident">String</span>) {
|
||||
<span class="kw">match</span> <span class="ident">endpt</span> {
|
||||
<span class="ident">TripEndpoint::Bldg</span>(<span class="ident">b</span>) => {
|
||||
<span class="ident">TripEndpoint::Building</span>(<span class="ident">b</span>) => {
|
||||
<span class="kw">let</span> <span class="ident">bldg</span> <span class="op">=</span> <span class="ident">app</span>.<span class="ident">primary</span>.<span class="ident">map</span>.<span class="ident">get_b</span>(<span class="kw-2">*</span><span class="ident">b</span>);
|
||||
(<span class="ident">ID::Building</span>(<span class="kw-2">*</span><span class="ident">b</span>), <span class="ident">bldg</span>.<span class="ident">label_center</span>, <span class="ident">bldg</span>.<span class="ident">address</span>.<span class="ident">clone</span>())
|
||||
}
|
||||
|
@ -807,12 +807,12 @@
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">trips_to_block</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">TripInfo</span><span class="op">></span><span class="op">></span> <span class="op">=</span> <span class="ident">trips_from_block</span>.<span class="ident">clone</span>();
|
||||
<span class="kw">for</span> (<span class="kw">_</span>, <span class="ident">trip</span>) <span class="kw">in</span> <span class="ident">app</span>.<span class="ident">primary</span>.<span class="ident">sim</span>.<span class="ident">all_trip_info</span>() {
|
||||
<span class="kw">let</span> <span class="ident">block1</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">trip</span>.<span class="ident">start</span> {
|
||||
<span class="ident">TripEndpoint::Bldg</span>(<span class="ident">b</span>) => <span class="ident">bldg_to_block</span>[<span class="kw-2">&</span><span class="ident">b</span>],
|
||||
<span class="ident">TripEndpoint::Building</span>(<span class="ident">b</span>) => <span class="ident">bldg_to_block</span>[<span class="kw-2">&</span><span class="ident">b</span>],
|
||||
<span class="ident">TripEndpoint::Border</span>(<span class="ident">i</span>) => <span class="ident">border_to_block</span>[<span class="kw-2">&</span><span class="ident">i</span>],
|
||||
<span class="ident">TripEndpoint::SuddenlyAppear</span>(<span class="kw">_</span>) => <span class="kw">continue</span>,
|
||||
};
|
||||
<span class="kw">let</span> <span class="ident">block2</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">trip</span>.<span class="ident">end</span> {
|
||||
<span class="ident">TripEndpoint::Bldg</span>(<span class="ident">b</span>) => <span class="ident">bldg_to_block</span>[<span class="kw-2">&</span><span class="ident">b</span>],
|
||||
<span class="ident">TripEndpoint::Building</span>(<span class="ident">b</span>) => <span class="ident">bldg_to_block</span>[<span class="kw-2">&</span><span class="ident">b</span>],
|
||||
<span class="ident">TripEndpoint::Border</span>(<span class="ident">i</span>) => <span class="ident">border_to_block</span>[<span class="kw-2">&</span><span class="ident">i</span>],
|
||||
<span class="ident">TripEndpoint::SuddenlyAppear</span>(<span class="kw">_</span>) => <span class="kw">continue</span>,
|
||||
};
|
||||
@ -871,7 +871,7 @@
|
||||
}
|
||||
<span class="kw">if</span> <span class="self">self</span>.<span class="ident">filter</span>.<span class="ident">from_block</span> {
|
||||
<span class="kw">match</span> <span class="ident">trip</span>.<span class="ident">end</span> {
|
||||
<span class="ident">TripEndpoint::Bldg</span>(<span class="ident">b</span>) => {
|
||||
<span class="ident">TripEndpoint::Building</span>(<span class="ident">b</span>) => {
|
||||
<span class="ident">count</span>.<span class="ident">inc</span>(<span class="self">self</span>.<span class="ident">bldg_to_block</span>[<span class="kw-2">&</span><span class="ident">b</span>]);
|
||||
}
|
||||
<span class="ident">TripEndpoint::Border</span>(<span class="ident">i</span>) => {
|
||||
@ -883,7 +883,7 @@
|
||||
}
|
||||
} <span class="kw">else</span> {
|
||||
<span class="kw">match</span> <span class="ident">trip</span>.<span class="ident">start</span> {
|
||||
<span class="ident">TripEndpoint::Bldg</span>(<span class="ident">b</span>) => {
|
||||
<span class="ident">TripEndpoint::Building</span>(<span class="ident">b</span>) => {
|
||||
<span class="ident">count</span>.<span class="ident">inc</span>(<span class="self">self</span>.<span class="ident">bldg_to_block</span>[<span class="kw-2">&</span><span class="ident">b</span>]);
|
||||
}
|
||||
<span class="ident">TripEndpoint::Border</span>(<span class="ident">i</span>) => {
|
||||
|
@ -197,7 +197,7 @@
|
||||
<span class="ident">batch</span>.<span class="ident">append</span>(<span class="ident">map_gui::tools::start_marker</span>(
|
||||
<span class="ident">g</span>,
|
||||
<span class="kw">match</span> <span class="ident">trip</span>.<span class="ident">start</span> {
|
||||
<span class="ident">TripEndpoint::Bldg</span>(<span class="ident">b</span>) => <span class="ident">app</span>.<span class="ident">primary</span>.<span class="ident">map</span>.<span class="ident">get_b</span>(<span class="ident">b</span>).<span class="ident">label_center</span>,
|
||||
<span class="ident">TripEndpoint::Building</span>(<span class="ident">b</span>) => <span class="ident">app</span>.<span class="ident">primary</span>.<span class="ident">map</span>.<span class="ident">get_b</span>(<span class="ident">b</span>).<span class="ident">label_center</span>,
|
||||
<span class="ident">TripEndpoint::Border</span>(<span class="ident">i</span>) => <span class="ident">app</span>.<span class="ident">primary</span>.<span class="ident">map</span>.<span class="ident">get_i</span>(<span class="ident">i</span>).<span class="ident">polygon</span>.<span class="ident">center</span>(),
|
||||
<span class="ident">TripEndpoint::SuddenlyAppear</span>(<span class="ident">pos</span>) => <span class="ident">pos</span>.<span class="ident">pt</span>(<span class="kw-2">&</span><span class="ident">app</span>.<span class="ident">primary</span>.<span class="ident">map</span>),
|
||||
},
|
||||
@ -206,7 +206,7 @@
|
||||
<span class="ident">batch</span>.<span class="ident">append</span>(<span class="ident">map_gui::tools::goal_marker</span>(
|
||||
<span class="ident">g</span>,
|
||||
<span class="kw">match</span> <span class="ident">trip</span>.<span class="ident">end</span> {
|
||||
<span class="ident">TripEndpoint::Bldg</span>(<span class="ident">b</span>) => <span class="ident">app</span>.<span class="ident">primary</span>.<span class="ident">map</span>.<span class="ident">get_b</span>(<span class="ident">b</span>).<span class="ident">label_center</span>,
|
||||
<span class="ident">TripEndpoint::Building</span>(<span class="ident">b</span>) => <span class="ident">app</span>.<span class="ident">primary</span>.<span class="ident">map</span>.<span class="ident">get_b</span>(<span class="ident">b</span>).<span class="ident">label_center</span>,
|
||||
<span class="ident">TripEndpoint::Border</span>(<span class="ident">i</span>) => <span class="ident">app</span>.<span class="ident">primary</span>.<span class="ident">map</span>.<span class="ident">get_i</span>(<span class="ident">i</span>).<span class="ident">polygon</span>.<span class="ident">center</span>(),
|
||||
<span class="ident">TripEndpoint::SuddenlyAppear</span>(<span class="ident">pos</span>) => <span class="ident">pos</span>.<span class="ident">pt</span>(<span class="kw-2">&</span><span class="ident">app</span>.<span class="ident">primary</span>.<span class="ident">map</span>),
|
||||
},
|
||||
|
@ -461,8 +461,8 @@
|
||||
.<span class="ident">into_iter</span>()
|
||||
.<span class="ident">filter_map</span>(<span class="op">|</span>(<span class="ident">id</span>, <span class="ident">info</span>)<span class="op">|</span> {
|
||||
<span class="kw">if</span> <span class="ident">info</span>.<span class="ident">mode</span> <span class="op">==</span> <span class="ident">TripMode::Drive</span>
|
||||
<span class="op">&&</span> <span class="macro">matches!</span>(<span class="ident">info</span>.<span class="ident">start</span>, <span class="ident">TripEndpoint::Bldg</span>(<span class="kw">_</span>))
|
||||
<span class="op">&&</span> <span class="macro">matches!</span>(<span class="ident">info</span>.<span class="ident">end</span>, <span class="ident">TripEndpoint::Bldg</span>(<span class="kw">_</span>))
|
||||
<span class="op">&&</span> <span class="macro">matches!</span>(<span class="ident">info</span>.<span class="ident">start</span>, <span class="ident">TripEndpoint::Building</span>(<span class="kw">_</span>))
|
||||
<span class="op">&&</span> <span class="macro">matches!</span>(<span class="ident">info</span>.<span class="ident">end</span>, <span class="ident">TripEndpoint::Building</span>(<span class="kw">_</span>))
|
||||
{
|
||||
<span class="prelude-val">Some</span>((<span class="ident">id</span>, <span class="ident">info</span>))
|
||||
} <span class="kw">else</span> {
|
||||
|
@ -293,6 +293,7 @@
|
||||
<span id="292">292</span>
|
||||
<span id="293">293</span>
|
||||
<span id="294">294</span>
|
||||
<span id="295">295</span>
|
||||
</pre><pre class="rust"><code><span class="kw">use</span> <span class="ident">std::collections::BTreeSet</span>;
|
||||
|
||||
<span class="kw">use</span> <span class="ident">maplit::btreeset</span>;
|
||||
@ -364,7 +365,8 @@
|
||||
.<span class="ident">polygon</span>;
|
||||
|
||||
<span class="kw">for</span> <span class="ident">person</span> <span class="kw">in</span> <span class="ident">app</span>.<span class="ident">primary</span>.<span class="ident">sim</span>.<span class="ident">get_all_people</span>() {
|
||||
<span class="kw">if</span> <span class="kw">let</span> <span class="ident">TripEndpoint::Bldg</span>(<span class="ident">b</span>) <span class="op">=</span> <span class="ident">app</span>.<span class="ident">primary</span>.<span class="ident">sim</span>.<span class="ident">trip_info</span>(<span class="ident">person</span>.<span class="ident">trips</span>[<span class="number">0</span>]).<span class="ident">start</span>
|
||||
<span class="kw">if</span> <span class="kw">let</span> <span class="ident">TripEndpoint::Building</span>(<span class="ident">b</span>) <span class="op">=</span>
|
||||
<span class="ident">app</span>.<span class="ident">primary</span>.<span class="ident">sim</span>.<span class="ident">trip_info</span>(<span class="ident">person</span>.<span class="ident">trips</span>[<span class="number">0</span>]).<span class="ident">start</span>
|
||||
{
|
||||
<span class="kw">if</span> <span class="ident">study_area</span>.<span class="ident">contains_pt</span>(<span class="ident">app</span>.<span class="ident">primary</span>.<span class="ident">map</span>.<span class="ident">get_b</span>(<span class="ident">b</span>).<span class="ident">polygon</span>.<span class="ident">center</span>()) {
|
||||
<span class="ident">highlight</span>.<span class="ident">insert</span>(<span class="ident">person</span>.<span class="ident">id</span>);
|
||||
|
@ -810,7 +810,7 @@
|
||||
<span class="ident">lane</span>.<span class="ident">id</span>,
|
||||
<span class="ident">rand_dist</span>(<span class="kw-2">&mut</span> <span class="ident">rng</span>, <span class="ident">Distance::ZERO</span>, <span class="ident">lane</span>.<span class="ident">length</span>()),
|
||||
)),
|
||||
<span class="ident">TripEndpoint::Bldg</span>(<span class="ident">map</span>.<span class="ident">all_buildings</span>().<span class="ident">choose</span>(<span class="kw-2">&mut</span> <span class="ident">rng</span>).<span class="ident">unwrap</span>().<span class="ident">id</span>),
|
||||
<span class="ident">TripEndpoint::Building</span>(<span class="ident">map</span>.<span class="ident">all_buildings</span>().<span class="ident">choose</span>(<span class="kw-2">&mut</span> <span class="ident">rng</span>).<span class="ident">unwrap</span>().<span class="ident">id</span>),
|
||||
<span class="ident">mode</span>,
|
||||
)],
|
||||
});
|
||||
@ -826,7 +826,7 @@
|
||||
<span class="ident">lane</span>.<span class="ident">id</span>,
|
||||
<span class="ident">rand_dist</span>(<span class="kw-2">&mut</span> <span class="ident">rng</span>, <span class="number">0.1</span> <span class="op">*</span> <span class="ident">lane</span>.<span class="ident">length</span>(), <span class="number">0.9</span> <span class="op">*</span> <span class="ident">lane</span>.<span class="ident">length</span>()),
|
||||
)),
|
||||
<span class="ident">TripEndpoint::Bldg</span>(<span class="ident">map</span>.<span class="ident">all_buildings</span>().<span class="ident">choose</span>(<span class="kw-2">&mut</span> <span class="ident">rng</span>).<span class="ident">unwrap</span>().<span class="ident">id</span>),
|
||||
<span class="ident">TripEndpoint::Building</span>(<span class="ident">map</span>.<span class="ident">all_buildings</span>().<span class="ident">choose</span>(<span class="kw-2">&mut</span> <span class="ident">rng</span>).<span class="ident">unwrap</span>().<span class="ident">id</span>),
|
||||
<span class="ident">TripMode::Walk</span>,
|
||||
)],
|
||||
});
|
||||
|
@ -380,7 +380,7 @@
|
||||
.<span class="ident">build</span>(<span class="ident">ctx</span>),
|
||||
};
|
||||
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">b</span>) <span class="op">=</span> <span class="ident">start</span> {
|
||||
<span class="kw">let</span> <span class="ident">endpt</span> <span class="op">=</span> <span class="ident">TripEndpoint::Bldg</span>(<span class="ident">b</span>);
|
||||
<span class="kw">let</span> <span class="ident">endpt</span> <span class="op">=</span> <span class="ident">TripEndpoint::Building</span>(<span class="ident">b</span>);
|
||||
<span class="kw">let</span> <span class="ident">pt</span> <span class="op">=</span> <span class="ident">endpt</span>.<span class="ident">pt</span>(<span class="kw-2">&</span><span class="ident">app</span>.<span class="ident">primary</span>.<span class="ident">map</span>);
|
||||
<span class="ident">spawner</span>.<span class="ident">start</span> <span class="op">=</span> <span class="prelude-val">Some</span>((<span class="ident">endpt</span>, <span class="ident">pt</span>));
|
||||
<span class="ident">spawner</span>.<span class="ident">panel</span>.<span class="ident">replace</span>(
|
||||
@ -526,7 +526,7 @@
|
||||
}
|
||||
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">hovering</span>) <span class="op">=</span> <span class="kw">match</span> <span class="ident">app</span>.<span class="ident">primary</span>.<span class="ident">current_selection</span> {
|
||||
<span class="prelude-val">Some</span>(<span class="ident">ID::Intersection</span>(<span class="ident">i</span>)) => <span class="prelude-val">Some</span>(<span class="ident">TripEndpoint::Border</span>(<span class="ident">i</span>)),
|
||||
<span class="prelude-val">Some</span>(<span class="ident">ID::Building</span>(<span class="ident">b</span>)) => <span class="prelude-val">Some</span>(<span class="ident">TripEndpoint::Bldg</span>(<span class="ident">b</span>)),
|
||||
<span class="prelude-val">Some</span>(<span class="ident">ID::Building</span>(<span class="ident">b</span>)) => <span class="prelude-val">Some</span>(<span class="ident">TripEndpoint::Building</span>(<span class="ident">b</span>)),
|
||||
<span class="prelude-val">None</span> => <span class="prelude-val">None</span>,
|
||||
<span class="kw">_</span> => <span class="macro">unreachable!</span>(),
|
||||
} {
|
||||
|
@ -2105,7 +2105,7 @@
|
||||
<span class="ident">start_time</span>: <span class="ident">Time::START_OF_DAY</span>,
|
||||
<span class="ident">stop_time</span>: <span class="ident">Time::START_OF_DAY</span> <span class="op">+</span> <span class="ident">Duration::seconds</span>(<span class="number">10.0</span>),
|
||||
<span class="ident">start_from_border</span>: <span class="ident">map</span>.<span class="ident">find_i_by_osm_id</span>(<span class="ident">osm::NodeID</span>(<span class="number">3005680098</span>)).<span class="ident">unwrap</span>(),
|
||||
<span class="ident">goal</span>: <span class="prelude-val">Some</span>(<span class="ident">TripEndpoint::Bldg</span>(
|
||||
<span class="ident">goal</span>: <span class="prelude-val">Some</span>(<span class="ident">TripEndpoint::Building</span>(
|
||||
<span class="ident">map</span>.<span class="ident">find_b_by_osm_id</span>(<span class="ident">bldg</span>(<span class="number">217699501</span>)).<span class="ident">unwrap</span>(),
|
||||
)),
|
||||
});
|
||||
@ -2505,7 +2505,7 @@
|
||||
<span class="ident">start_lane</span>,
|
||||
<span class="ident">map</span>.<span class="ident">get_l</span>(<span class="ident">start_lane</span>).<span class="ident">length</span>() <span class="op">*</span> <span class="number">0.8</span>,
|
||||
)),
|
||||
<span class="ident">TripEndpoint::Bldg</span>(<span class="ident">goal_bldg</span>),
|
||||
<span class="ident">TripEndpoint::Building</span>(<span class="ident">goal_bldg</span>),
|
||||
<span class="ident">TripMode::Drive</span>,
|
||||
)],
|
||||
});
|
||||
@ -2520,7 +2520,7 @@
|
||||
<span class="ident">lane_near_bldg</span>,
|
||||
<span class="ident">map</span>.<span class="ident">get_l</span>(<span class="ident">lane_near_bldg</span>).<span class="ident">length</span>() <span class="op">/</span> <span class="number">2.0</span>,
|
||||
)),
|
||||
<span class="ident">TripEndpoint::Bldg</span>(<span class="ident">goal_bldg</span>),
|
||||
<span class="ident">TripEndpoint::Building</span>(<span class="ident">goal_bldg</span>),
|
||||
<span class="ident">TripMode::Drive</span>,
|
||||
)],
|
||||
});
|
||||
|
@ -846,8 +846,8 @@
|
||||
.<span class="ident">all_trips</span>()
|
||||
.<span class="ident">filter</span>(<span class="op">|</span><span class="ident">trip</span><span class="op">|</span> {
|
||||
<span class="ident">trip</span>.<span class="ident">mode</span> <span class="op">==</span> <span class="ident">TripMode::Drive</span>
|
||||
<span class="op">&&</span> <span class="macro">matches!</span>(<span class="ident">trip</span>.<span class="ident">origin</span>, <span class="ident">TripEndpoint::Bldg</span>(<span class="kw">_</span>))
|
||||
<span class="op">&&</span> <span class="macro">matches!</span>(<span class="ident">trip</span>.<span class="ident">destination</span>, <span class="ident">TripEndpoint::Bldg</span>(<span class="kw">_</span>))
|
||||
<span class="op">&&</span> <span class="macro">matches!</span>(<span class="ident">trip</span>.<span class="ident">origin</span>, <span class="ident">TripEndpoint::Building</span>(<span class="kw">_</span>))
|
||||
<span class="op">&&</span> <span class="macro">matches!</span>(<span class="ident">trip</span>.<span class="ident">destination</span>, <span class="ident">TripEndpoint::Building</span>(<span class="kw">_</span>))
|
||||
})
|
||||
.<span class="ident">collect</span>(),
|
||||
<span class="op">|</span><span class="ident">trip</span><span class="op">|</span> {
|
||||
|
@ -345,11 +345,11 @@
|
||||
<span class="kw">let</span> <span class="ident">from_bldg</span> <span class="op">=</span> <span class="ident">from</span>
|
||||
.<span class="ident">osm_building</span>
|
||||
.<span class="ident">and_then</span>(<span class="op">|</span><span class="ident">id</span><span class="op">|</span> <span class="ident">osm_id_to_bldg</span>.<span class="ident">get</span>(<span class="kw-2">&</span><span class="ident">id</span>))
|
||||
.<span class="ident">map</span>(<span class="op">|</span><span class="ident">b</span><span class="op">|</span> <span class="ident">TripEndpoint::Bldg</span>(<span class="kw-2">*</span><span class="ident">b</span>));
|
||||
.<span class="ident">map</span>(<span class="op">|</span><span class="ident">b</span><span class="op">|</span> <span class="ident">TripEndpoint::Building</span>(<span class="kw-2">*</span><span class="ident">b</span>));
|
||||
<span class="kw">let</span> <span class="ident">to_bldg</span> <span class="op">=</span> <span class="ident">to</span>
|
||||
.<span class="ident">osm_building</span>
|
||||
.<span class="ident">and_then</span>(<span class="op">|</span><span class="ident">id</span><span class="op">|</span> <span class="ident">osm_id_to_bldg</span>.<span class="ident">get</span>(<span class="kw-2">&</span><span class="ident">id</span>))
|
||||
.<span class="ident">map</span>(<span class="op">|</span><span class="ident">b</span><span class="op">|</span> <span class="ident">TripEndpoint::Bldg</span>(<span class="kw-2">*</span><span class="ident">b</span>));
|
||||
.<span class="ident">map</span>(<span class="op">|</span><span class="ident">b</span><span class="op">|</span> <span class="ident">TripEndpoint::Building</span>(<span class="kw-2">*</span><span class="ident">b</span>));
|
||||
|
||||
<span class="kw">if</span> <span class="ident">only_passthrough_trips</span> {
|
||||
<span class="kw">if</span> <span class="ident">from_bldg</span>.<span class="ident">is_some</span>() <span class="op">|</span><span class="op">|</span> <span class="ident">to_bldg</span>.<span class="ident">is_some</span>() {
|
||||
|
@ -313,7 +313,7 @@
|
||||
<span class="comment">// data imported using importer/actdev_scenarios.sh already covers them.</span>
|
||||
<span class="kw">let</span> <span class="ident">before</span> <span class="op">=</span> <span class="ident">scenario</span>.<span class="ident">people</span>.<span class="ident">len</span>();
|
||||
<span class="ident">scenario</span>.<span class="ident">people</span>.<span class="ident">retain</span>(<span class="op">|</span><span class="ident">p</span><span class="op">|</span> <span class="kw">match</span> <span class="ident">p</span>.<span class="ident">trips</span>[<span class="number">0</span>].<span class="ident">origin</span> {
|
||||
<span class="ident">TripEndpoint::Bldg</span>(<span class="ident">b</span>) => <span class="op">!</span><span class="ident">study_area</span>.<span class="ident">contains_pt</span>(<span class="ident">map</span>.<span class="ident">get_b</span>(<span class="ident">b</span>).<span class="ident">polygon</span>.<span class="ident">center</span>()),
|
||||
<span class="ident">TripEndpoint::Building</span>(<span class="ident">b</span>) => <span class="op">!</span><span class="ident">study_area</span>.<span class="ident">contains_pt</span>(<span class="ident">map</span>.<span class="ident">get_b</span>(<span class="ident">b</span>).<span class="ident">polygon</span>.<span class="ident">center</span>()),
|
||||
<span class="kw">_</span> => <span class="bool-val">true</span>,
|
||||
});
|
||||
<span class="macro">info!</span>(
|
||||
|
@ -175,7 +175,7 @@
|
||||
<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">r"rustdoc 1.58.1 (db9d1b20b 2022-01-20)"</span>;
|
||||
<span class="attribute">#[<span class="ident">doc</span><span class="op">=</span><span class="string">r#"The build time in RFC2822, UTC."#</span>]</span>
|
||||
<span class="attribute">#[<span class="ident">allow</span>(<span class="ident">dead_code</span>)]</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">r"Fri, 28 Jan 2022 13:22:29 +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">r"Sun, 30 Jan 2022 18:34:39 +0000"</span>;
|
||||
<span class="attribute">#[<span class="ident">doc</span><span class="op">=</span><span class="string">r#"The target architecture, given by `CARGO_CFG_TARGET_ARCH`."#</span>]</span>
|
||||
<span class="attribute">#[<span class="ident">allow</span>(<span class="ident">dead_code</span>)]</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">r"x86_64"</span>;
|
||||
|
@ -300,7 +300,7 @@
|
||||
}
|
||||
}
|
||||
<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="ident">snap_to_endpts</span>.<span class="ident">add</span>(<span class="ident">TripEndpoint::Bldg</span>(<span class="ident">b</span>.<span class="ident">id</span>), <span class="ident">b</span>.<span class="ident">polygon</span>.<span class="ident">points</span>());
|
||||
<span class="ident">snap_to_endpts</span>.<span class="ident">add</span>(<span class="ident">TripEndpoint::Building</span>(<span class="ident">b</span>.<span class="ident">id</span>), <span class="ident">b</span>.<span class="ident">polygon</span>.<span class="ident">points</span>());
|
||||
}
|
||||
|
||||
<span class="ident">InputWaypoints</span> {
|
||||
@ -507,7 +507,7 @@
|
||||
<span class="kw">fn</span> <span class="ident">new</span>(<span class="ident">app</span>: <span class="kw-2">&</span><span class="kw">dyn</span> <span class="ident">AppLike</span>, <span class="ident">at</span>: <span class="ident">TripEndpoint</span>) -> <span class="ident">Waypoint</span> {
|
||||
<span class="kw">let</span> <span class="ident">map</span> <span class="op">=</span> <span class="ident">app</span>.<span class="ident">map</span>();
|
||||
<span class="kw">let</span> (<span class="ident">center</span>, <span class="ident">label</span>) <span class="op">=</span> <span class="kw">match</span> <span class="ident">at</span> {
|
||||
<span class="ident">TripEndpoint::Bldg</span>(<span class="ident">b</span>) => {
|
||||
<span class="ident">TripEndpoint::Building</span>(<span class="ident">b</span>) => {
|
||||
<span class="kw">let</span> <span class="ident">b</span> <span class="op">=</span> <span class="ident">map</span>.<span class="ident">get_b</span>(<span class="ident">b</span>);
|
||||
(<span class="ident">b</span>.<span class="ident">polygon</span>.<span class="ident">center</span>(), <span class="ident">b</span>.<span class="ident">address</span>.<span class="ident">clone</span>())
|
||||
}
|
||||
|
@ -480,7 +480,7 @@
|
||||
<span class="ident">trips</span>: <span class="ident">Vec::new</span>(),
|
||||
};
|
||||
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">current_location</span> <span class="op">=</span> <span class="ident">TripEndpoint::Bldg</span>(<span class="ident">person</span>.<span class="ident">home</span>);
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">current_location</span> <span class="op">=</span> <span class="ident">TripEndpoint::Building</span>(<span class="ident">person</span>.<span class="ident">home</span>);
|
||||
<span class="kw">for</span> (<span class="ident">departure_time</span>, <span class="ident">activity</span>) <span class="kw">in</span> <span class="ident">schedule</span>.<span class="ident">activities</span> {
|
||||
<span class="comment">// TODO This field isn't that important; later we could map Activity to a TripPurpose</span>
|
||||
<span class="comment">// better.</span>
|
||||
@ -489,7 +489,7 @@
|
||||
<span class="kw">let</span> <span class="ident">goto</span> <span class="op">=</span> <span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">destination</span>) <span class="op">=</span>
|
||||
<span class="self">self</span>.<span class="ident">find_building_for_activity</span>(<span class="ident">activity</span>, <span class="ident">current_location</span>, <span class="ident">map</span>, <span class="ident">rng</span>)
|
||||
{
|
||||
<span class="ident">TripEndpoint::Bldg</span>(<span class="ident">destination</span>)
|
||||
<span class="ident">TripEndpoint::Building</span>(<span class="ident">destination</span>)
|
||||
} <span class="kw">else</span> <span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">i</span>) <span class="op">=</span> <span class="ident">commuter_borders</span>.<span class="ident">choose</span>(<span class="ident">rng</span>) {
|
||||
<span class="comment">// No buildings satisfy the activity. Just go somewhere off-map.</span>
|
||||
<span class="ident">TripEndpoint::Border</span>(<span class="kw-2">*</span><span class="ident">i</span>)
|
||||
@ -522,7 +522,7 @@
|
||||
<span class="ident">config</span>: <span class="kw-2">&</span><span class="ident">Config</span>,
|
||||
) -> <span class="ident">TripMode</span> {
|
||||
<span class="kw">let</span> (<span class="ident">b1</span>, <span class="ident">b2</span>) <span class="op">=</span> <span class="kw">match</span> (<span class="ident">from</span>, <span class="ident">to</span>) {
|
||||
(<span class="ident">TripEndpoint::Bldg</span>(<span class="ident">b1</span>), <span class="ident">TripEndpoint::Bldg</span>(<span class="ident">b2</span>)) => (<span class="ident">b1</span>, <span class="ident">b2</span>),
|
||||
(<span class="ident">TripEndpoint::Building</span>(<span class="ident">b1</span>), <span class="ident">TripEndpoint::Building</span>(<span class="ident">b2</span>)) => (<span class="ident">b1</span>, <span class="ident">b2</span>),
|
||||
<span class="comment">// TODO Always drive when going on or off-map?</span>
|
||||
<span class="kw">_</span> => {
|
||||
<span class="kw">return</span> <span class="ident">TripMode::Drive</span>;
|
||||
|
@ -507,7 +507,7 @@
|
||||
) -> <span class="prelude-ty">Option</span><span class="op"><</span>(<span class="ident">TripEndpoint</span>, <span class="ident">TripEndpoint</span>)<span class="op">></span> {
|
||||
<span class="kw">if</span> <span class="ident">rng</span>.<span class="ident">gen_bool</span>(<span class="self">self</span>.<span class="ident">pct_overlap</span>) <span class="op">&&</span> <span class="op">!</span><span class="self">self</span>.<span class="ident">homes</span>.<span class="ident">is_empty</span>() {
|
||||
<span class="kw">let</span> <span class="ident">b</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">homes</span>.<span class="ident">choose_weighted</span>(<span class="ident">rng</span>, <span class="op">|</span>(<span class="kw">_</span>, <span class="ident">n</span>)<span class="op">|</span> <span class="kw-2">*</span><span class="ident">n</span>).<span class="ident">unwrap</span>().<span class="number">0</span>;
|
||||
<span class="kw">return</span> <span class="prelude-val">Some</span>((<span class="ident">TripEndpoint::Bldg</span>(<span class="ident">b</span>), <span class="ident">TripEndpoint::Bldg</span>(<span class="ident">b</span>)));
|
||||
<span class="kw">return</span> <span class="prelude-val">Some</span>((<span class="ident">TripEndpoint::Building</span>(<span class="ident">b</span>), <span class="ident">TripEndpoint::Building</span>(<span class="ident">b</span>)));
|
||||
}
|
||||
<span class="self">self</span>.<span class="ident">pick_borders</span>(<span class="ident">mode</span>, <span class="ident">map</span>, <span class="ident">rng</span>)
|
||||
}
|
||||
@ -522,7 +522,7 @@
|
||||
) -> <span class="prelude-ty">Option</span><span class="op"><</span>(<span class="ident">TripEndpoint</span>, <span class="ident">TripEndpoint</span>)<span class="op">></span> {
|
||||
<span class="kw">if</span> <span class="ident">rng</span>.<span class="ident">gen_bool</span>(<span class="self">self</span>.<span class="ident">pct_overlap</span>) <span class="op">&&</span> <span class="op">!</span><span class="self">self</span>.<span class="ident">workplaces</span>.<span class="ident">is_empty</span>() {
|
||||
<span class="kw">let</span> <span class="ident">b</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">workplaces</span>.<span class="ident">choose_weighted</span>(<span class="ident">rng</span>, <span class="op">|</span>(<span class="kw">_</span>, <span class="ident">n</span>)<span class="op">|</span> <span class="kw-2">*</span><span class="ident">n</span>).<span class="ident">unwrap</span>().<span class="number">0</span>;
|
||||
<span class="kw">return</span> <span class="prelude-val">Some</span>((<span class="ident">TripEndpoint::Bldg</span>(<span class="ident">b</span>), <span class="ident">TripEndpoint::Bldg</span>(<span class="ident">b</span>)));
|
||||
<span class="kw">return</span> <span class="prelude-val">Some</span>((<span class="ident">TripEndpoint::Building</span>(<span class="ident">b</span>), <span class="ident">TripEndpoint::Building</span>(<span class="ident">b</span>)));
|
||||
}
|
||||
<span class="self">self</span>.<span class="ident">pick_borders</span>(<span class="ident">mode</span>, <span class="ident">map</span>, <span class="ident">rng</span>)
|
||||
}
|
||||
|
@ -448,7 +448,7 @@
|
||||
);
|
||||
<span class="kw">let</span> <span class="ident">home</span> <span class="op">=</span> <span class="kw">if</span> <span class="ident">is_local_resident</span> {
|
||||
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">residence</span>) <span class="op">=</span> <span class="ident">residents</span>.<span class="ident">pop</span>() {
|
||||
<span class="ident">TripEndpoint::Bldg</span>(<span class="ident">residence</span>)
|
||||
<span class="ident">TripEndpoint::Building</span>(<span class="ident">residence</span>)
|
||||
} <span class="kw">else</span> {
|
||||
<span class="kw-2">*</span><span class="ident">commuter_borders</span>.<span class="ident">choose</span>(<span class="ident">rng</span>)<span class="question-mark">?</span>
|
||||
}
|
||||
@ -458,7 +458,7 @@
|
||||
|
||||
<span class="kw">let</span> <span class="ident">work</span> <span class="op">=</span> <span class="kw">if</span> <span class="ident">is_local_worker</span> {
|
||||
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">workplace</span>) <span class="op">=</span> <span class="ident">workers</span>.<span class="ident">pop</span>() {
|
||||
<span class="ident">TripEndpoint::Bldg</span>(<span class="ident">workplace</span>)
|
||||
<span class="ident">TripEndpoint::Building</span>(<span class="ident">workplace</span>)
|
||||
} <span class="kw">else</span> {
|
||||
<span class="kw-2">*</span><span class="ident">commuter_borders</span>.<span class="ident">choose</span>(<span class="ident">rng</span>)<span class="question-mark">?</span>
|
||||
}
|
||||
@ -467,13 +467,13 @@
|
||||
};
|
||||
|
||||
<span class="kw">match</span> (<span class="kw-2">&</span><span class="ident">home</span>, <span class="kw-2">&</span><span class="ident">work</span>) {
|
||||
(<span class="ident">TripEndpoint::Bldg</span>(<span class="kw">_</span>), <span class="ident">TripEndpoint::Bldg</span>(<span class="kw">_</span>)) => {
|
||||
(<span class="ident">TripEndpoint::Building</span>(<span class="kw">_</span>), <span class="ident">TripEndpoint::Building</span>(<span class="kw">_</span>)) => {
|
||||
<span class="ident">num_trips_local</span> <span class="op">+</span><span class="op">=</span> <span class="number">1</span>;
|
||||
}
|
||||
(<span class="ident">TripEndpoint::Bldg</span>(<span class="kw">_</span>), <span class="ident">TripEndpoint::Border</span>(<span class="kw">_</span>)) => {
|
||||
(<span class="ident">TripEndpoint::Building</span>(<span class="kw">_</span>), <span class="ident">TripEndpoint::Border</span>(<span class="kw">_</span>)) => {
|
||||
<span class="ident">num_trips_commuting_out</span> <span class="op">+</span><span class="op">=</span> <span class="number">1</span>;
|
||||
}
|
||||
(<span class="ident">TripEndpoint::Border</span>(<span class="kw">_</span>), <span class="ident">TripEndpoint::Bldg</span>(<span class="kw">_</span>)) => {
|
||||
(<span class="ident">TripEndpoint::Border</span>(<span class="kw">_</span>), <span class="ident">TripEndpoint::Building</span>(<span class="kw">_</span>)) => {
|
||||
<span class="ident">num_trips_commuting_in</span> <span class="op">+</span><span class="op">=</span> <span class="number">1</span>;
|
||||
}
|
||||
(<span class="ident">TripEndpoint::Border</span>(<span class="kw">_</span>), <span class="ident">TripEndpoint::Border</span>(<span class="kw">_</span>)) => {
|
||||
@ -536,7 +536,7 @@
|
||||
|
||||
<span class="kw">let</span> <span class="ident">mode</span> <span class="op">=</span> <span class="kw">match</span> (<span class="kw-2">&</span><span class="ident">home</span>, <span class="kw-2">&</span><span class="ident">work</span>) {
|
||||
<span class="comment">// commuting entirely within map</span>
|
||||
(<span class="ident">TripEndpoint::Bldg</span>(<span class="ident">home_bldg</span>), <span class="ident">TripEndpoint::Bldg</span>(<span class="ident">work_bldg</span>)) => {
|
||||
(<span class="ident">TripEndpoint::Building</span>(<span class="ident">home_bldg</span>), <span class="ident">TripEndpoint::Building</span>(<span class="ident">work_bldg</span>)) => {
|
||||
<span class="comment">// Decide mode based on walking distance. If the buildings aren't connected,</span>
|
||||
<span class="comment">// probably a bug in importing; just skip this person.</span>
|
||||
<span class="kw">let</span> <span class="ident">dist</span> <span class="op">=</span> <span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">path</span>) <span class="op">=</span> <span class="ident">PathRequest::between_buildings</span>(
|
||||
|
@ -365,9 +365,9 @@
|
||||
<span class="ident">trips</span>: <span class="macro">vec!</span>[<span class="ident">IndividTrip::new</span>(
|
||||
<span class="ident">depart</span>,
|
||||
<span class="ident">TripPurpose::Shopping</span>,
|
||||
<span class="ident">TripEndpoint::Bldg</span>(<span class="ident">from_bldg</span>),
|
||||
<span class="ident">TripEndpoint::Building</span>(<span class="ident">from_bldg</span>),
|
||||
<span class="self">self</span>.<span class="ident">goal</span>.<span class="ident">unwrap_or_else</span>(<span class="op">|</span><span class="op">|</span> {
|
||||
<span class="ident">TripEndpoint::Bldg</span>(<span class="ident">map</span>.<span class="ident">all_buildings</span>().<span class="ident">choose</span>(<span class="ident">rng</span>).<span class="ident">unwrap</span>().<span class="ident">id</span>)
|
||||
<span class="ident">TripEndpoint::Building</span>(<span class="ident">map</span>.<span class="ident">all_buildings</span>().<span class="ident">choose</span>(<span class="ident">rng</span>).<span class="ident">unwrap</span>().<span class="ident">id</span>)
|
||||
}),
|
||||
<span class="ident">mode</span>,
|
||||
)],
|
||||
@ -385,7 +385,7 @@
|
||||
<span class="ident">TripPurpose::Shopping</span>,
|
||||
<span class="ident">TripEndpoint::Border</span>(<span class="self">self</span>.<span class="ident">start_from_border</span>),
|
||||
<span class="self">self</span>.<span class="ident">goal</span>.<span class="ident">unwrap_or_else</span>(<span class="op">|</span><span class="op">|</span> {
|
||||
<span class="ident">TripEndpoint::Bldg</span>(<span class="ident">map</span>.<span class="ident">all_buildings</span>().<span class="ident">choose</span>(<span class="ident">rng</span>).<span class="ident">unwrap</span>().<span class="ident">id</span>)
|
||||
<span class="ident">TripEndpoint::Building</span>(<span class="ident">map</span>.<span class="ident">all_buildings</span>().<span class="ident">choose</span>(<span class="ident">rng</span>).<span class="ident">unwrap</span>().<span class="ident">id</span>)
|
||||
}),
|
||||
<span class="ident">mode</span>,
|
||||
)],
|
||||
|
@ -563,7 +563,7 @@
|
||||
};
|
||||
<span class="kw">let</span> <span class="ident">goal</span> <span class="op">=</span> <span class="ident">driving_goal</span>(<span class="ident">to</span>, <span class="ident">constraints</span>, <span class="ident">map</span>)<span class="question-mark">?</span>;
|
||||
<span class="kw">match</span> <span class="ident">from</span> {
|
||||
<span class="ident">TripEndpoint::Bldg</span>(<span class="ident">start_bldg</span>) => {
|
||||
<span class="ident">TripEndpoint::Building</span>(<span class="ident">start_bldg</span>) => {
|
||||
<span class="kw">if</span> <span class="ident">mode</span> <span class="op">==</span> <span class="ident">TripMode::Drive</span> {
|
||||
<span class="ident">TripSpec::UsingParkedCar</span> {
|
||||
<span class="ident">start_bldg</span>,
|
||||
@ -632,7 +632,7 @@
|
||||
|
||||
<span class="kw">fn</span> <span class="ident">start_sidewalk_spot</span>(<span class="ident">endpt</span>: <span class="ident">TripEndpoint</span>, <span class="ident">map</span>: <span class="kw-2">&</span><span class="ident">Map</span>) -> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">SidewalkSpot</span><span class="op">></span> {
|
||||
<span class="kw">match</span> <span class="ident">endpt</span> {
|
||||
<span class="ident">TripEndpoint::Bldg</span>(<span class="ident">b</span>) => <span class="prelude-val">Ok</span>(<span class="ident">SidewalkSpot::building</span>(<span class="ident">b</span>, <span class="ident">map</span>)),
|
||||
<span class="ident">TripEndpoint::Building</span>(<span class="ident">b</span>) => <span class="prelude-val">Ok</span>(<span class="ident">SidewalkSpot::building</span>(<span class="ident">b</span>, <span class="ident">map</span>)),
|
||||
<span class="ident">TripEndpoint::Border</span>(<span class="ident">i</span>) => <span class="ident">SidewalkSpot::start_at_border</span>(<span class="ident">i</span>, <span class="ident">map</span>)
|
||||
.<span class="ident">ok_or_else</span>(<span class="op">|</span><span class="op">|</span> <span class="macro">anyhow!</span>(<span class="string">"can't start walking from {}"</span>, <span class="ident">i</span>)),
|
||||
<span class="ident">TripEndpoint::SuddenlyAppear</span>(<span class="ident">pos</span>) => <span class="prelude-val">Ok</span>(<span class="ident">SidewalkSpot::suddenly_appear</span>(<span class="ident">pos</span>, <span class="ident">map</span>)),
|
||||
@ -641,7 +641,7 @@
|
||||
|
||||
<span class="kw">fn</span> <span class="ident">end_sidewalk_spot</span>(<span class="ident">endpt</span>: <span class="ident">TripEndpoint</span>, <span class="ident">map</span>: <span class="kw-2">&</span><span class="ident">Map</span>) -> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">SidewalkSpot</span><span class="op">></span> {
|
||||
<span class="kw">match</span> <span class="ident">endpt</span> {
|
||||
<span class="ident">TripEndpoint::Bldg</span>(<span class="ident">b</span>) => <span class="prelude-val">Ok</span>(<span class="ident">SidewalkSpot::building</span>(<span class="ident">b</span>, <span class="ident">map</span>)),
|
||||
<span class="ident">TripEndpoint::Building</span>(<span class="ident">b</span>) => <span class="prelude-val">Ok</span>(<span class="ident">SidewalkSpot::building</span>(<span class="ident">b</span>, <span class="ident">map</span>)),
|
||||
<span class="ident">TripEndpoint::Border</span>(<span class="ident">i</span>) => {
|
||||
<span class="ident">SidewalkSpot::end_at_border</span>(<span class="ident">i</span>, <span class="ident">map</span>).<span class="ident">ok_or_else</span>(<span class="op">|</span><span class="op">|</span> <span class="macro">anyhow!</span>(<span class="string">"can't end walking at {}"</span>, <span class="ident">i</span>))
|
||||
}
|
||||
@ -655,7 +655,7 @@
|
||||
<span class="ident">map</span>: <span class="kw-2">&</span><span class="ident">Map</span>,
|
||||
) -> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">DrivingGoal</span><span class="op">></span> {
|
||||
<span class="kw">match</span> <span class="ident">endpt</span> {
|
||||
<span class="ident">TripEndpoint::Bldg</span>(<span class="ident">b</span>) => <span class="prelude-val">Ok</span>(<span class="ident">DrivingGoal::ParkNear</span>(<span class="ident">b</span>)),
|
||||
<span class="ident">TripEndpoint::Building</span>(<span class="ident">b</span>) => <span class="prelude-val">Ok</span>(<span class="ident">DrivingGoal::ParkNear</span>(<span class="ident">b</span>)),
|
||||
<span class="comment">// TODO Duplicates some logic from TripEndpoint::pos</span>
|
||||
<span class="ident">TripEndpoint::Border</span>(<span class="ident">i</span>) => <span class="ident">map</span>
|
||||
.<span class="ident">get_i</span>(<span class="ident">i</span>)
|
||||
|
@ -498,7 +498,7 @@
|
||||
}
|
||||
<span class="ident">TripMode::Drive</span> => {
|
||||
<span class="kw">let</span> <span class="ident">need_parked_at</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">trip</span>.<span class="ident">origin</span> {
|
||||
<span class="ident">TripEndpoint::Bldg</span>(<span class="ident">b</span>) => <span class="prelude-val">Some</span>(<span class="ident">b</span>),
|
||||
<span class="ident">TripEndpoint::Building</span>(<span class="ident">b</span>) => <span class="prelude-val">Some</span>(<span class="ident">b</span>),
|
||||
<span class="kw">_</span> => <span class="prelude-val">None</span>,
|
||||
};
|
||||
|
||||
@ -522,7 +522,7 @@
|
||||
<span class="comment">// Where does this car wind up?</span>
|
||||
<span class="ident">car_locations</span>.<span class="ident">retain</span>(<span class="op">|</span>(<span class="ident">i</span>, <span class="kw">_</span>)<span class="op">|</span> <span class="ident">idx</span> <span class="op">!</span><span class="op">=</span> <span class="kw-2">*</span><span class="ident">i</span>);
|
||||
<span class="kw">match</span> <span class="ident">trip</span>.<span class="ident">destination</span> {
|
||||
<span class="ident">TripEndpoint::Bldg</span>(<span class="ident">b</span>) => {
|
||||
<span class="ident">TripEndpoint::Building</span>(<span class="ident">b</span>) => {
|
||||
<span class="ident">car_locations</span>.<span class="ident">push</span>((<span class="ident">idx</span>, <span class="prelude-val">Some</span>(<span class="ident">b</span>)));
|
||||
}
|
||||
<span class="ident">TripEndpoint::Border</span>(<span class="kw">_</span>) <span class="op">|</span> <span class="ident">TripEndpoint::SuddenlyAppear</span>(<span class="kw">_</span>) => {
|
||||
|
@ -1542,7 +1542,7 @@
|
||||
<span class="kw">let</span> <span class="ident">person</span> <span class="op">=</span> <span class="kw-2">&mut</span> <span class="self">self</span>.<span class="ident">people</span>[<span class="ident">trip</span>.<span class="ident">person</span>.<span class="number">0</span>];
|
||||
<span class="kw">if</span> <span class="ident">person</span>.<span class="ident">trips</span>.<span class="ident">is_empty</span>() {
|
||||
<span class="ident">person</span>.<span class="ident">state</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">trip</span>.<span class="ident">info</span>.<span class="ident">start</span> {
|
||||
<span class="ident">TripEndpoint::Bldg</span>(<span class="ident">b</span>) => {
|
||||
<span class="ident">TripEndpoint::Building</span>(<span class="ident">b</span>) => {
|
||||
<span class="self">self</span>.<span class="ident">events</span>
|
||||
.<span class="ident">push</span>(<span class="ident">Event::PersonEntersBuilding</span>(<span class="ident">trip</span>.<span class="ident">person</span>, <span class="ident">b</span>));
|
||||
<span class="ident">PersonState::Inside</span>(<span class="ident">b</span>)
|
||||
@ -2425,7 +2425,7 @@
|
||||
}
|
||||
<span class="comment">// Warp to the destination</span>
|
||||
<span class="self">self</span>.<span class="ident">people</span>[<span class="ident">person</span>.<span class="number">0</span>].<span class="ident">state</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">trip</span>.<span class="ident">info</span>.<span class="ident">end</span> {
|
||||
<span class="ident">TripEndpoint::Bldg</span>(<span class="ident">b</span>) => {
|
||||
<span class="ident">TripEndpoint::Building</span>(<span class="ident">b</span>) => {
|
||||
<span class="self">self</span>.<span class="ident">events</span>.<span class="ident">push</span>(<span class="ident">Event::PersonEntersBuilding</span>(<span class="ident">person</span>, <span class="ident">b</span>));
|
||||
<span class="ident">PersonState::Inside</span>(<span class="ident">b</span>)
|
||||
}
|
||||
@ -2446,7 +2446,7 @@
|
||||
<span class="ident">ctx</span>.<span class="ident">parking</span>.<span class="ident">remove_parked_car</span>(<span class="ident">parked_car</span>);
|
||||
}
|
||||
|
||||
<span class="kw">if</span> <span class="kw">let</span> <span class="ident">TripEndpoint::Bldg</span>(<span class="ident">b</span>) <span class="op">=</span> <span class="ident">trip</span>.<span class="ident">info</span>.<span class="ident">end</span> {
|
||||
<span class="kw">if</span> <span class="kw">let</span> <span class="ident">TripEndpoint::Building</span>(<span class="ident">b</span>) <span class="op">=</span> <span class="ident">trip</span>.<span class="ident">info</span>.<span class="ident">end</span> {
|
||||
<span class="kw">let</span> <span class="ident">driving_lane</span> <span class="op">=</span> <span class="ident">ctx</span>.<span class="ident">map</span>.<span class="ident">find_driving_lane_near_building</span>(<span class="ident">b</span>);
|
||||
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">spot</span>) <span class="op">=</span> <span class="ident">ctx</span>
|
||||
.<span class="ident">parking</span>
|
||||
|
@ -162,7 +162,7 @@
|
||||
<span class="doccomment">/// Specifies where a trip begins or ends.</span>
|
||||
<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Serialize</span>, <span class="ident">Deserialize</span>, <span class="ident">PartialEq</span>, <span class="ident">Eq</span>, <span class="ident">PartialOrd</span>, <span class="ident">Ord</span>, <span class="ident">Debug</span>, <span class="ident">Clone</span>, <span class="ident">Copy</span>)]</span>
|
||||
<span class="kw">pub</span> <span class="kw">enum</span> <span class="ident">TripEndpoint</span> {
|
||||
<span class="ident">Bldg</span>(<span class="ident">BuildingID</span>),
|
||||
<span class="ident">Building</span>(<span class="ident">BuildingID</span>),
|
||||
<span class="ident">Border</span>(<span class="ident">IntersectionID</span>),
|
||||
<span class="doccomment">/// Used for interactive spawning, tests, etc. For now, only valid as a trip's start.</span>
|
||||
<span class="ident">SuddenlyAppear</span>(<span class="ident">Position</span>),
|
||||
@ -172,7 +172,7 @@
|
||||
<span class="doccomment">/// Returns a point representing where this endpoint is.</span>
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">pt</span>(<span class="self">self</span>, <span class="ident">map</span>: <span class="kw-2">&</span><span class="ident">Map</span>) -> <span class="ident">Pt2D</span> {
|
||||
<span class="kw">match</span> <span class="self">self</span> {
|
||||
<span class="ident">TripEndpoint::Bldg</span>(<span class="ident">b</span>) => <span class="ident">map</span>.<span class="ident">get_b</span>(<span class="ident">b</span>).<span class="ident">polygon</span>.<span class="ident">center</span>(),
|
||||
<span class="ident">TripEndpoint::Building</span>(<span class="ident">b</span>) => <span class="ident">map</span>.<span class="ident">get_b</span>(<span class="ident">b</span>).<span class="ident">polygon</span>.<span class="ident">center</span>(),
|
||||
<span class="ident">TripEndpoint::Border</span>(<span class="ident">i</span>) => <span class="ident">map</span>.<span class="ident">get_i</span>(<span class="ident">i</span>).<span class="ident">polygon</span>.<span class="ident">center</span>(),
|
||||
<span class="ident">TripEndpoint::SuddenlyAppear</span>(<span class="ident">pos</span>) => <span class="ident">pos</span>.<span class="ident">pt</span>(<span class="ident">map</span>),
|
||||
}
|
||||
@ -195,7 +195,7 @@
|
||||
<span class="ident">TripMode::Bike</span> => <span class="ident">PathRequest::vehicle</span>(<span class="ident">start</span>, <span class="ident">end</span>, <span class="ident">PathConstraints::Bike</span>),
|
||||
<span class="comment">// Only cars leaving from a building might turn out from the driveway in a special way</span>
|
||||
<span class="ident">TripMode::Drive</span> => {
|
||||
<span class="kw">if</span> <span class="macro">matches!</span>(<span class="ident">from</span>, <span class="ident">TripEndpoint::Bldg</span>(<span class="kw">_</span>)) {
|
||||
<span class="kw">if</span> <span class="macro">matches!</span>(<span class="ident">from</span>, <span class="ident">TripEndpoint::Building</span>(<span class="kw">_</span>)) {
|
||||
<span class="ident">PathRequest::leave_from_driveway</span>(<span class="ident">start</span>, <span class="ident">end</span>, <span class="ident">PathConstraints::Car</span>, <span class="ident">map</span>)
|
||||
} <span class="kw">else</span> {
|
||||
<span class="ident">PathRequest::vehicle</span>(<span class="ident">start</span>, <span class="ident">end</span>, <span class="ident">PathConstraints::Car</span>)
|
||||
@ -212,7 +212,7 @@
|
||||
<span class="kw">if</span> <span class="ident">from</span> {
|
||||
<span class="kw">match</span> <span class="self">self</span> {
|
||||
<span class="comment">// Fall through</span>
|
||||
<span class="ident">TripEndpoint::Bldg</span>(<span class="kw">_</span>) => {}
|
||||
<span class="ident">TripEndpoint::Building</span>(<span class="kw">_</span>) => {}
|
||||
<span class="ident">TripEndpoint::Border</span>(<span class="ident">i</span>) => {
|
||||
<span class="kw">return</span> <span class="ident">map</span>.<span class="ident">get_i</span>(<span class="ident">i</span>).<span class="ident">some_outgoing_road</span>(<span class="ident">map</span>).<span class="ident">and_then</span>(<span class="op">|</span><span class="ident">dr</span><span class="op">|</span> {
|
||||
<span class="ident">dr</span>.<span class="ident">lanes</span>(<span class="ident">constraints</span>, <span class="ident">map</span>)
|
||||
@ -227,7 +227,7 @@
|
||||
}
|
||||
|
||||
<span class="kw">match</span> <span class="self">self</span> {
|
||||
<span class="ident">TripEndpoint::Bldg</span>(<span class="ident">b</span>) => <span class="kw">match</span> <span class="ident">constraints</span> {
|
||||
<span class="ident">TripEndpoint::Building</span>(<span class="ident">b</span>) => <span class="kw">match</span> <span class="ident">constraints</span> {
|
||||
<span class="ident">PathConstraints::Car</span> => {
|
||||
<span class="kw">let</span> <span class="ident">driving_lane</span> <span class="op">=</span> <span class="ident">map</span>.<span class="ident">find_driving_lane_near_building</span>(<span class="ident">b</span>);
|
||||
<span class="kw">let</span> <span class="ident">sidewalk_pos</span> <span class="op">=</span> <span class="ident">map</span>.<span class="ident">get_b</span>(<span class="ident">b</span>).<span class="ident">sidewalk_pos</span>;
|
||||
@ -263,7 +263,7 @@
|
||||
|
||||
<span class="kw">fn</span> <span class="ident">sidewalk_pos</span>(<span class="self">self</span>, <span class="ident">map</span>: <span class="kw-2">&</span><span class="ident">Map</span>, <span class="ident">from</span>: <span class="ident">bool</span>) -> <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Position</span><span class="op">></span> {
|
||||
<span class="kw">match</span> <span class="self">self</span> {
|
||||
<span class="ident">TripEndpoint::Bldg</span>(<span class="ident">b</span>) => <span class="prelude-val">Some</span>(<span class="ident">map</span>.<span class="ident">get_b</span>(<span class="ident">b</span>).<span class="ident">sidewalk_pos</span>),
|
||||
<span class="ident">TripEndpoint::Building</span>(<span class="ident">b</span>) => <span class="prelude-val">Some</span>(<span class="ident">map</span>.<span class="ident">get_b</span>(<span class="ident">b</span>).<span class="ident">sidewalk_pos</span>),
|
||||
<span class="ident">TripEndpoint::Border</span>(<span class="ident">i</span>) => {
|
||||
<span class="kw">if</span> <span class="ident">from</span> {
|
||||
<span class="ident">TripEndpoint::start_walking_at_border</span>(<span class="ident">i</span>, <span class="ident">map</span>)
|
||||
|
@ -239,7 +239,7 @@
|
||||
) -> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">PersonSpec</span><span class="op">></span><span class="op">></span> {
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">closest</span>: <span class="ident">FindClosest</span><span class="op"><</span><span class="ident">TripEndpoint</span><span class="op">></span> <span class="op">=</span> <span class="ident">FindClosest::new</span>(<span class="ident">map</span>.<span class="ident">get_bounds</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="ident">closest</span>.<span class="ident">add</span>(<span class="ident">TripEndpoint::Bldg</span>(<span class="ident">b</span>.<span class="ident">id</span>), <span class="ident">b</span>.<span class="ident">polygon</span>.<span class="ident">points</span>());
|
||||
<span class="ident">closest</span>.<span class="ident">add</span>(<span class="ident">TripEndpoint::Building</span>(<span class="ident">b</span>.<span class="ident">id</span>), <span class="ident">b</span>.<span class="ident">polygon</span>.<span class="ident">points</span>());
|
||||
}
|
||||
<span class="kw">let</span> <span class="ident">borders</span> <span class="op">=</span> <span class="ident">MapBorders::new</span>(<span class="ident">map</span>);
|
||||
|
||||
|
@ -1,10 +1,10 @@
|
||||
<!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="Specifies where a trip begins or ends."><meta name="keywords" content="rust, rustlang, rust-lang, TripEndpoint"><title>TripEndpoint in synthpop::endpoint - 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><script src="../../crates.js"></script><script defer src="../../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../favicon.svg"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc enum"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">☰</div><a href='../../synthpop/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><h2 class="location">Enum TripEndpoint</h2><div class="sidebar-elems"><div class="block items"><h3 class="sidebar-title"><a href="#variants">Variants</a></h3><div class="sidebar-links"><a href="#variant.Bldg">Bldg</a><a href="#variant.Border">Border</a><a href="#variant.SuddenlyAppear">SuddenlyAppear</a></div><h3 class="sidebar-title"><a href="#implementations">Methods</a></h3><div class="sidebar-links"><a href="#method.end_walking_at_border">end_walking_at_border</a><a href="#method.path_req">path_req</a><a href="#method.pos">pos</a><a href="#method.pt">pt</a><a href="#method.sidewalk_pos">sidewalk_pos</a><a href="#method.start_walking_at_border">start_walking_at_border</a></div><h3 class="sidebar-title"><a href="#trait-implementations">Trait Implementations</a></h3><div class="sidebar-links"><a href="#impl-Clone">Clone</a><a href="#impl-Copy">Copy</a><a href="#impl-Debug">Debug</a><a href="#impl-Deserialize%3C%27de%3E">Deserialize<'de></a><a href="#impl-Eq">Eq</a><a href="#impl-Ord">Ord</a><a href="#impl-PartialEq%3CTripEndpoint%3E">PartialEq<TripEndpoint></a><a href="#impl-PartialOrd%3CTripEndpoint%3E">PartialOrd<TripEndpoint></a><a href="#impl-Serialize">Serialize</a><a href="#impl-StructuralEq">StructuralEq</a><a href="#impl-StructuralPartialEq">StructuralPartialEq</a></div><h3 class="sidebar-title"><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><h3 class="sidebar-title"><a href="#blanket-implementations">Blanket Implementations</a></h3><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-DeserializeOwned">DeserializeOwned</a><a href="#impl-Equivalent%3CK%3E">Equivalent<K></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-Same%3CT%3E">Same<T></a><a href="#impl-ToOwned">ToOwned</a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><h2 class="location">Other items in<br><a href="../index.html">synthpop</a>::<wbr><a href="index.html">endpoint</a></h2><div id="sidebar-vars" data-name="TripEndpoint" data-ty="enum" data-relpath=""></div><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" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><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" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../wheel.svg"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Enum <a href="../index.html">synthpop</a>::<wbr><a href="index.html">endpoint</a>::<wbr><a class="enum" href="#">TripEndpoint</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span><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/synthpop/endpoint.rs.html#9-14" title="goto source code">[src]</a></span></h1><div class="docblock item-decl"><pre class="rust enum"><code>pub enum TripEndpoint {
|
||||
Bldg(<a class="struct" href="../../map_model/objects/building/struct.BuildingID.html" title="struct map_model::objects::building::BuildingID">BuildingID</a>),
|
||||
<noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../favicon.svg"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc enum"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">☰</div><a href='../../synthpop/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><h2 class="location">Enum TripEndpoint</h2><div class="sidebar-elems"><div class="block items"><h3 class="sidebar-title"><a href="#variants">Variants</a></h3><div class="sidebar-links"><a href="#variant.Border">Border</a><a href="#variant.Building">Building</a><a href="#variant.SuddenlyAppear">SuddenlyAppear</a></div><h3 class="sidebar-title"><a href="#implementations">Methods</a></h3><div class="sidebar-links"><a href="#method.end_walking_at_border">end_walking_at_border</a><a href="#method.path_req">path_req</a><a href="#method.pos">pos</a><a href="#method.pt">pt</a><a href="#method.sidewalk_pos">sidewalk_pos</a><a href="#method.start_walking_at_border">start_walking_at_border</a></div><h3 class="sidebar-title"><a href="#trait-implementations">Trait Implementations</a></h3><div class="sidebar-links"><a href="#impl-Clone">Clone</a><a href="#impl-Copy">Copy</a><a href="#impl-Debug">Debug</a><a href="#impl-Deserialize%3C%27de%3E">Deserialize<'de></a><a href="#impl-Eq">Eq</a><a href="#impl-Ord">Ord</a><a href="#impl-PartialEq%3CTripEndpoint%3E">PartialEq<TripEndpoint></a><a href="#impl-PartialOrd%3CTripEndpoint%3E">PartialOrd<TripEndpoint></a><a href="#impl-Serialize">Serialize</a><a href="#impl-StructuralEq">StructuralEq</a><a href="#impl-StructuralPartialEq">StructuralPartialEq</a></div><h3 class="sidebar-title"><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><h3 class="sidebar-title"><a href="#blanket-implementations">Blanket Implementations</a></h3><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-DeserializeOwned">DeserializeOwned</a><a href="#impl-Equivalent%3CK%3E">Equivalent<K></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-Same%3CT%3E">Same<T></a><a href="#impl-ToOwned">ToOwned</a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><h2 class="location">Other items in<br><a href="../index.html">synthpop</a>::<wbr><a href="index.html">endpoint</a></h2><div id="sidebar-vars" data-name="TripEndpoint" data-ty="enum" data-relpath=""></div><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" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><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" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../wheel.svg"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Enum <a href="../index.html">synthpop</a>::<wbr><a href="index.html">endpoint</a>::<wbr><a class="enum" href="#">TripEndpoint</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span><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/synthpop/endpoint.rs.html#9-14" title="goto source code">[src]</a></span></h1><div class="docblock item-decl"><pre class="rust enum"><code>pub enum TripEndpoint {
|
||||
Building(<a class="struct" href="../../map_model/objects/building/struct.BuildingID.html" title="struct map_model::objects::building::BuildingID">BuildingID</a>),
|
||||
Border(<a class="struct" href="../../map_model/objects/intersection/struct.IntersectionID.html" title="struct map_model::objects::intersection::IntersectionID">IntersectionID</a>),
|
||||
SuddenlyAppear(<a class="struct" href="../../map_model/traversable/struct.Position.html" title="struct map_model::traversable::Position">Position</a>),
|
||||
}</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Specifies where a trip begins or ends.</p>
|
||||
</div></details><h2 id="variants" class="variants small-section-header">Variants<a href="#variants" class="anchor"></a></h2><h3 id="variant.Bldg" class="variant small-section-header"><a href="#variant.Bldg" class="anchor field"></a><code>Bldg(<a class="struct" href="../../map_model/objects/building/struct.BuildingID.html" title="struct map_model::objects::building::BuildingID">BuildingID</a>)</code></h3><div class="sub-variant" id="variant.Bldg.fields"><h4>Tuple Fields</h4><div class="sub-variant-field"><span id="variant.Bldg.field.0" class="variant small-section-header"><a href="#variant.Bldg.field.0" class="anchor field"></a><code>0: <a class="struct" href="../../map_model/objects/building/struct.BuildingID.html" title="struct map_model::objects::building::BuildingID">BuildingID</a></code></span></div></div><h3 id="variant.Border" class="variant small-section-header"><a href="#variant.Border" class="anchor field"></a><code>Border(<a class="struct" href="../../map_model/objects/intersection/struct.IntersectionID.html" title="struct map_model::objects::intersection::IntersectionID">IntersectionID</a>)</code></h3><div class="sub-variant" id="variant.Border.fields"><h4>Tuple Fields</h4><div class="sub-variant-field"><span id="variant.Border.field.0" class="variant small-section-header"><a href="#variant.Border.field.0" class="anchor field"></a><code>0: <a class="struct" href="../../map_model/objects/intersection/struct.IntersectionID.html" title="struct map_model::objects::intersection::IntersectionID">IntersectionID</a></code></span></div></div><h3 id="variant.SuddenlyAppear" class="variant small-section-header"><a href="#variant.SuddenlyAppear" class="anchor field"></a><code>SuddenlyAppear(<a class="struct" href="../../map_model/traversable/struct.Position.html" title="struct map_model::traversable::Position">Position</a>)</code></h3><div class="sub-variant" id="variant.SuddenlyAppear.fields"><h4>Tuple Fields</h4><div class="sub-variant-field"><span id="variant.SuddenlyAppear.field.0" class="variant small-section-header"><a href="#variant.SuddenlyAppear.field.0" class="anchor field"></a><code>0: <a class="struct" href="../../map_model/traversable/struct.Position.html" title="struct map_model::traversable::Position">Position</a></code></span></div></div><div class="docblock"><p>Used for interactive spawning, tests, etc. For now, only valid as a trip’s start.</p>
|
||||
</div></details><h2 id="variants" class="variants small-section-header">Variants<a href="#variants" class="anchor"></a></h2><h3 id="variant.Building" class="variant small-section-header"><a href="#variant.Building" class="anchor field"></a><code>Building(<a class="struct" href="../../map_model/objects/building/struct.BuildingID.html" title="struct map_model::objects::building::BuildingID">BuildingID</a>)</code></h3><div class="sub-variant" id="variant.Building.fields"><h4>Tuple Fields</h4><div class="sub-variant-field"><span id="variant.Building.field.0" class="variant small-section-header"><a href="#variant.Building.field.0" class="anchor field"></a><code>0: <a class="struct" href="../../map_model/objects/building/struct.BuildingID.html" title="struct map_model::objects::building::BuildingID">BuildingID</a></code></span></div></div><h3 id="variant.Border" class="variant small-section-header"><a href="#variant.Border" class="anchor field"></a><code>Border(<a class="struct" href="../../map_model/objects/intersection/struct.IntersectionID.html" title="struct map_model::objects::intersection::IntersectionID">IntersectionID</a>)</code></h3><div class="sub-variant" id="variant.Border.fields"><h4>Tuple Fields</h4><div class="sub-variant-field"><span id="variant.Border.field.0" class="variant small-section-header"><a href="#variant.Border.field.0" class="anchor field"></a><code>0: <a class="struct" href="../../map_model/objects/intersection/struct.IntersectionID.html" title="struct map_model::objects::intersection::IntersectionID">IntersectionID</a></code></span></div></div><h3 id="variant.SuddenlyAppear" class="variant small-section-header"><a href="#variant.SuddenlyAppear" class="anchor field"></a><code>SuddenlyAppear(<a class="struct" href="../../map_model/traversable/struct.Position.html" title="struct map_model::traversable::Position">Position</a>)</code></h3><div class="sub-variant" id="variant.SuddenlyAppear.fields"><h4>Tuple Fields</h4><div class="sub-variant-field"><span id="variant.SuddenlyAppear.field.0" class="variant small-section-header"><a href="#variant.SuddenlyAppear.field.0" class="anchor field"></a><code>0: <a class="struct" href="../../map_model/traversable/struct.Position.html" title="struct map_model::traversable::Position">Position</a></code></span></div></div><div class="docblock"><p>Used for interactive spawning, tests, etc. For now, only valid as a trip’s start.</p>
|
||||
</div><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../src/synthpop/endpoint.rs.html#16-154" title="goto source code">[src]</a></div><a href="#impl" class="anchor"></a><h3 class="code-header in-band">impl <a class="enum" href="enum.TripEndpoint.html" title="enum synthpop::endpoint::TripEndpoint">TripEndpoint</a></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.pt" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/synthpop/endpoint.rs.html#18-24" title="goto source code">[src]</a></div><a href="#method.pt" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.pt" class="fnname">pt</a>(self, map: &<a class="struct" href="../../map_model/struct.Map.html" title="struct map_model::Map">Map</a>) -> <a class="struct" href="../../geom/pt/struct.Pt2D.html" title="struct geom::pt::Pt2D">Pt2D</a></h4></div></summary><div class="docblock"><p>Returns a point representing where this endpoint is.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.path_req" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/synthpop/endpoint.rs.html#30-50" title="goto source code">[src]</a></div><a href="#method.path_req" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.path_req" class="fnname">path_req</a>(<br> from: <a class="enum" href="enum.TripEndpoint.html" title="enum synthpop::endpoint::TripEndpoint">TripEndpoint</a>, <br> to: <a class="enum" href="enum.TripEndpoint.html" title="enum synthpop::endpoint::TripEndpoint">TripEndpoint</a>, <br> mode: <a class="enum" href="../enum.TripMode.html" title="enum synthpop::TripMode">TripMode</a>, <br> map: &<a class="struct" href="../../map_model/struct.Map.html" title="struct map_model::Map">Map</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/1.58.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../../map_model/pathfind/v1/struct.PathRequest.html" title="struct map_model::pathfind::v1::PathRequest">PathRequest</a>></h4></div></summary><div class="docblock"><p>Figure out a single PathRequest that goes between two TripEndpoints. Assume a single mode
|
||||
the entire time – no walking to a car before driving, for instance. The result probably
|
||||
|
@ -1,10 +1,10 @@
|
||||
<!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="Specifies where a trip begins or ends."><meta name="keywords" content="rust, rustlang, rust-lang, TripEndpoint"><title>TripEndpoint in synthpop - 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><script src="../crates.js"></script><script defer src="../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../favicon.svg"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc enum"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">☰</div><a href='../synthpop/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><h2 class="location">Enum TripEndpoint</h2><div class="sidebar-elems"><div class="block items"><h3 class="sidebar-title"><a href="#variants">Variants</a></h3><div class="sidebar-links"><a href="#variant.Bldg">Bldg</a><a href="#variant.Border">Border</a><a href="#variant.SuddenlyAppear">SuddenlyAppear</a></div><h3 class="sidebar-title"><a href="#implementations">Methods</a></h3><div class="sidebar-links"><a href="#method.end_walking_at_border">end_walking_at_border</a><a href="#method.path_req">path_req</a><a href="#method.pos">pos</a><a href="#method.pt">pt</a><a href="#method.sidewalk_pos">sidewalk_pos</a><a href="#method.start_walking_at_border">start_walking_at_border</a></div><h3 class="sidebar-title"><a href="#trait-implementations">Trait Implementations</a></h3><div class="sidebar-links"><a href="#impl-Clone">Clone</a><a href="#impl-Copy">Copy</a><a href="#impl-Debug">Debug</a><a href="#impl-Deserialize%3C%27de%3E">Deserialize<'de></a><a href="#impl-Eq">Eq</a><a href="#impl-Ord">Ord</a><a href="#impl-PartialEq%3CTripEndpoint%3E">PartialEq<TripEndpoint></a><a href="#impl-PartialOrd%3CTripEndpoint%3E">PartialOrd<TripEndpoint></a><a href="#impl-Serialize">Serialize</a><a href="#impl-StructuralEq">StructuralEq</a><a href="#impl-StructuralPartialEq">StructuralPartialEq</a></div><h3 class="sidebar-title"><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><h3 class="sidebar-title"><a href="#blanket-implementations">Blanket Implementations</a></h3><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-DeserializeOwned">DeserializeOwned</a><a href="#impl-Equivalent%3CK%3E">Equivalent<K></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-Same%3CT%3E">Same<T></a><a href="#impl-ToOwned">ToOwned</a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><h2 class="location">Other items in<br><a href="index.html">synthpop</a></h2><div id="sidebar-vars" data-name="TripEndpoint" data-ty="enum" data-relpath=""></div><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" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../brush.svg"></button><div id="theme-choices" role="menu"></div></div><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" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../wheel.svg"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Enum <a href="index.html">synthpop</a>::<wbr><a class="enum" href="#">TripEndpoint</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span><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/synthpop/endpoint.rs.html#9-14" title="goto source code">[src]</a></span></h1><div class="docblock item-decl"><pre class="rust enum"><code>pub enum TripEndpoint {
|
||||
Bldg(<a class="struct" href="../map_model/objects/building/struct.BuildingID.html" title="struct map_model::objects::building::BuildingID">BuildingID</a>),
|
||||
<noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../favicon.svg"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc enum"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">☰</div><a href='../synthpop/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><h2 class="location">Enum TripEndpoint</h2><div class="sidebar-elems"><div class="block items"><h3 class="sidebar-title"><a href="#variants">Variants</a></h3><div class="sidebar-links"><a href="#variant.Border">Border</a><a href="#variant.Building">Building</a><a href="#variant.SuddenlyAppear">SuddenlyAppear</a></div><h3 class="sidebar-title"><a href="#implementations">Methods</a></h3><div class="sidebar-links"><a href="#method.end_walking_at_border">end_walking_at_border</a><a href="#method.path_req">path_req</a><a href="#method.pos">pos</a><a href="#method.pt">pt</a><a href="#method.sidewalk_pos">sidewalk_pos</a><a href="#method.start_walking_at_border">start_walking_at_border</a></div><h3 class="sidebar-title"><a href="#trait-implementations">Trait Implementations</a></h3><div class="sidebar-links"><a href="#impl-Clone">Clone</a><a href="#impl-Copy">Copy</a><a href="#impl-Debug">Debug</a><a href="#impl-Deserialize%3C%27de%3E">Deserialize<'de></a><a href="#impl-Eq">Eq</a><a href="#impl-Ord">Ord</a><a href="#impl-PartialEq%3CTripEndpoint%3E">PartialEq<TripEndpoint></a><a href="#impl-PartialOrd%3CTripEndpoint%3E">PartialOrd<TripEndpoint></a><a href="#impl-Serialize">Serialize</a><a href="#impl-StructuralEq">StructuralEq</a><a href="#impl-StructuralPartialEq">StructuralPartialEq</a></div><h3 class="sidebar-title"><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><h3 class="sidebar-title"><a href="#blanket-implementations">Blanket Implementations</a></h3><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-DeserializeOwned">DeserializeOwned</a><a href="#impl-Equivalent%3CK%3E">Equivalent<K></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-Same%3CT%3E">Same<T></a><a href="#impl-ToOwned">ToOwned</a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><h2 class="location">Other items in<br><a href="index.html">synthpop</a></h2><div id="sidebar-vars" data-name="TripEndpoint" data-ty="enum" data-relpath=""></div><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" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../brush.svg"></button><div id="theme-choices" role="menu"></div></div><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" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../wheel.svg"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Enum <a href="index.html">synthpop</a>::<wbr><a class="enum" href="#">TripEndpoint</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span><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/synthpop/endpoint.rs.html#9-14" title="goto source code">[src]</a></span></h1><div class="docblock item-decl"><pre class="rust enum"><code>pub enum TripEndpoint {
|
||||
Building(<a class="struct" href="../map_model/objects/building/struct.BuildingID.html" title="struct map_model::objects::building::BuildingID">BuildingID</a>),
|
||||
Border(<a class="struct" href="../map_model/objects/intersection/struct.IntersectionID.html" title="struct map_model::objects::intersection::IntersectionID">IntersectionID</a>),
|
||||
SuddenlyAppear(<a class="struct" href="../map_model/traversable/struct.Position.html" title="struct map_model::traversable::Position">Position</a>),
|
||||
}</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Specifies where a trip begins or ends.</p>
|
||||
</div></details><h2 id="variants" class="variants small-section-header">Variants<a href="#variants" class="anchor"></a></h2><h3 id="variant.Bldg" class="variant small-section-header"><a href="#variant.Bldg" class="anchor field"></a><code>Bldg(<a class="struct" href="../map_model/objects/building/struct.BuildingID.html" title="struct map_model::objects::building::BuildingID">BuildingID</a>)</code></h3><div class="sub-variant" id="variant.Bldg.fields"><h4>Tuple Fields</h4><div class="sub-variant-field"><span id="variant.Bldg.field.0" class="variant small-section-header"><a href="#variant.Bldg.field.0" class="anchor field"></a><code>0: <a class="struct" href="../map_model/objects/building/struct.BuildingID.html" title="struct map_model::objects::building::BuildingID">BuildingID</a></code></span></div></div><h3 id="variant.Border" class="variant small-section-header"><a href="#variant.Border" class="anchor field"></a><code>Border(<a class="struct" href="../map_model/objects/intersection/struct.IntersectionID.html" title="struct map_model::objects::intersection::IntersectionID">IntersectionID</a>)</code></h3><div class="sub-variant" id="variant.Border.fields"><h4>Tuple Fields</h4><div class="sub-variant-field"><span id="variant.Border.field.0" class="variant small-section-header"><a href="#variant.Border.field.0" class="anchor field"></a><code>0: <a class="struct" href="../map_model/objects/intersection/struct.IntersectionID.html" title="struct map_model::objects::intersection::IntersectionID">IntersectionID</a></code></span></div></div><h3 id="variant.SuddenlyAppear" class="variant small-section-header"><a href="#variant.SuddenlyAppear" class="anchor field"></a><code>SuddenlyAppear(<a class="struct" href="../map_model/traversable/struct.Position.html" title="struct map_model::traversable::Position">Position</a>)</code></h3><div class="sub-variant" id="variant.SuddenlyAppear.fields"><h4>Tuple Fields</h4><div class="sub-variant-field"><span id="variant.SuddenlyAppear.field.0" class="variant small-section-header"><a href="#variant.SuddenlyAppear.field.0" class="anchor field"></a><code>0: <a class="struct" href="../map_model/traversable/struct.Position.html" title="struct map_model::traversable::Position">Position</a></code></span></div></div><div class="docblock"><p>Used for interactive spawning, tests, etc. For now, only valid as a trip’s start.</p>
|
||||
</div></details><h2 id="variants" class="variants small-section-header">Variants<a href="#variants" class="anchor"></a></h2><h3 id="variant.Building" class="variant small-section-header"><a href="#variant.Building" class="anchor field"></a><code>Building(<a class="struct" href="../map_model/objects/building/struct.BuildingID.html" title="struct map_model::objects::building::BuildingID">BuildingID</a>)</code></h3><div class="sub-variant" id="variant.Building.fields"><h4>Tuple Fields</h4><div class="sub-variant-field"><span id="variant.Building.field.0" class="variant small-section-header"><a href="#variant.Building.field.0" class="anchor field"></a><code>0: <a class="struct" href="../map_model/objects/building/struct.BuildingID.html" title="struct map_model::objects::building::BuildingID">BuildingID</a></code></span></div></div><h3 id="variant.Border" class="variant small-section-header"><a href="#variant.Border" class="anchor field"></a><code>Border(<a class="struct" href="../map_model/objects/intersection/struct.IntersectionID.html" title="struct map_model::objects::intersection::IntersectionID">IntersectionID</a>)</code></h3><div class="sub-variant" id="variant.Border.fields"><h4>Tuple Fields</h4><div class="sub-variant-field"><span id="variant.Border.field.0" class="variant small-section-header"><a href="#variant.Border.field.0" class="anchor field"></a><code>0: <a class="struct" href="../map_model/objects/intersection/struct.IntersectionID.html" title="struct map_model::objects::intersection::IntersectionID">IntersectionID</a></code></span></div></div><h3 id="variant.SuddenlyAppear" class="variant small-section-header"><a href="#variant.SuddenlyAppear" class="anchor field"></a><code>SuddenlyAppear(<a class="struct" href="../map_model/traversable/struct.Position.html" title="struct map_model::traversable::Position">Position</a>)</code></h3><div class="sub-variant" id="variant.SuddenlyAppear.fields"><h4>Tuple Fields</h4><div class="sub-variant-field"><span id="variant.SuddenlyAppear.field.0" class="variant small-section-header"><a href="#variant.SuddenlyAppear.field.0" class="anchor field"></a><code>0: <a class="struct" href="../map_model/traversable/struct.Position.html" title="struct map_model::traversable::Position">Position</a></code></span></div></div><div class="docblock"><p>Used for interactive spawning, tests, etc. For now, only valid as a trip’s start.</p>
|
||||
</div><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../src/synthpop/endpoint.rs.html#16-154" title="goto source code">[src]</a></div><a href="#impl" class="anchor"></a><h3 class="code-header in-band">impl <a class="enum" href="endpoint/enum.TripEndpoint.html" title="enum synthpop::endpoint::TripEndpoint">TripEndpoint</a></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.pt" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/synthpop/endpoint.rs.html#18-24" title="goto source code">[src]</a></div><a href="#method.pt" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.pt" class="fnname">pt</a>(self, map: &<a class="struct" href="../map_model/struct.Map.html" title="struct map_model::Map">Map</a>) -> <a class="struct" href="../geom/pt/struct.Pt2D.html" title="struct geom::pt::Pt2D">Pt2D</a></h4></div></summary><div class="docblock"><p>Returns a point representing where this endpoint is.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.path_req" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/synthpop/endpoint.rs.html#30-50" title="goto source code">[src]</a></div><a href="#method.path_req" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.path_req" class="fnname">path_req</a>(<br> from: <a class="enum" href="endpoint/enum.TripEndpoint.html" title="enum synthpop::endpoint::TripEndpoint">TripEndpoint</a>, <br> to: <a class="enum" href="endpoint/enum.TripEndpoint.html" title="enum synthpop::endpoint::TripEndpoint">TripEndpoint</a>, <br> mode: <a class="enum" href="enum.TripMode.html" title="enum synthpop::TripMode">TripMode</a>, <br> map: &<a class="struct" href="../map_model/struct.Map.html" title="struct map_model::Map">Map</a><br>) -> <a class="enum" href="https://doc.rust-lang.org/1.58.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../map_model/pathfind/v1/struct.PathRequest.html" title="struct map_model::pathfind::v1::PathRequest">PathRequest</a>></h4></div></summary><div class="docblock"><p>Figure out a single PathRequest that goes between two TripEndpoints. Assume a single mode
|
||||
the entire time – no walking to a car before driving, for instance. The result probably
|
||||
|
Loading…
Reference in New Issue
Block a user