mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-12-01 02:33:54 +03:00
81 lines
20 KiB
HTML
81 lines
20 KiB
HTML
<!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 `map_model` crate."><meta name="keywords" content="rust, rustlang, rust-lang, map_model"><title>map_model - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script src="../storage.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="shortcut icon" href="../favicon.ico"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../map_model/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><p class='location'>Crate map_model</p><div class='block version'><p>Version 0.1.0</p></div><div class="sidebar-elems"><a id='all-types' href='all.html'><p>See all map_model's items</p></a><div class="block items"><ul><li><a href="#modules">Modules</a></li><li><a href="#structs">Structs</a></li><li><a href="#enums">Enums</a></li><li><a href="#constants">Constants</a></li></ul></div><p class='location'></p><script>window.sidebarCurrent = {name: 'map_model', ty: 'mod', relpath: '../'};</script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><span class="help-button">?</span>
|
||
<a id="settings-menu" href="../settings.html"><img src="../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../src/map_model/lib.rs.html#1-118' title='goto source code'>[src]</a></span><span class='in-band'>Crate <a class="mod" href=''>map_model</a></span></h1><div class='docblock'><p><code>map_model</code> describes the world where simulations occur. Importing a map from OSM partly happens
|
||
in <code>convert_osm</code> and here.</p>
|
||
<p>Helpful terminology:</p>
|
||
<ul>
|
||
<li>ch = contraction hierarchy, for speeding up pathfinding</li>
|
||
<li>degenerate intersection = only has 2 roads connected, so why is it an intersection at all?</li>
|
||
<li>lc = lane-change (which is modelled very strangely: <a href="https://dabreegster.github.io/abstreet/trafficsim/discrete_event.html#lane-changing">https://dabreegster.github.io/abstreet/trafficsim/discrete_event.html#lane-changing</a>)</li>
|
||
<li>ltr = left-to-right, the order of lanes for a road</li>
|
||
<li>osm = OpenStreetMap</li>
|
||
</ul>
|
||
<p>Map objects are usually abbreviated in method names:</p>
|
||
<ul>
|
||
<li>a = area</li>
|
||
<li>b = building</li>
|
||
<li>br = bus route</li>
|
||
<li>bs = bus stop</li>
|
||
<li>i = intersection</li>
|
||
<li>l = lane</li>
|
||
<li>pl = parking lot</li>
|
||
<li>r = road</li>
|
||
<li>ss = stop sign</li>
|
||
<li>t = turn</li>
|
||
<li>ts = traffic signal</li>
|
||
</ul>
|
||
</div><h2 id='modules' class='section-header'><a href="#modules">Modules</a></h2>
|
||
<table><tr class='module-item'><td><a class="mod" href="city/index.html" title='map_model::city mod'>city</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="mod" href="connectivity/index.html" title='map_model::connectivity mod'>connectivity</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="mod" href="edits/index.html" title='map_model::edits mod'>edits</a></td><td class='docblock-short'><p>Once a Map exists, the player can edit it in the UI (producing <code>MapEdits</code> in-memory), then save
|
||
the changes to a file (as <code>PermanentMapEdits</code>). See
|
||
<a href="https://dabreegster.github.io/abstreet/map/edits.html">https://dabreegster.github.io/abstreet/map/edits.html</a>.</p>
|
||
</td></tr><tr class='module-item'><td><a class="mod" href="make/index.html" title='map_model::make mod'>make</a></td><td class='docblock-short'><p>See <a href="https://dabreegster.github.io/abstreet/map/importing/index.html">https://dabreegster.github.io/abstreet/map/importing/index.html</a> for an overview. This module
|
||
covers the RawMap->Map stage.</p>
|
||
</td></tr><tr class='module-item'><td><a class="mod" href="map/index.html" title='map_model::map mod'>map</a></td><td class='docblock-short'><p>A bunch of (mostly read-only) queries on a Map.</p>
|
||
</td></tr><tr class='module-item'><td><a class="mod" href="objects/index.html" title='map_model::objects mod'>objects</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="mod" href="osm/index.html" title='map_model::osm mod'>osm</a></td><td class='docblock-short'><p>Useful utilities for working with OpenStreetMap.</p>
|
||
</td></tr><tr class='module-item'><td><a class="mod" href="pathfind/index.html" title='map_model::pathfind mod'>pathfind</a></td><td class='docblock-short'><p>Everything related to pathfinding through a map for different types of agents.</p>
|
||
</td></tr><tr class='module-item'><td><a class="mod" href="raw/index.html" title='map_model::raw mod'>raw</a></td><td class='docblock-short'><p>The convert_osm crate produces a RawMap from OSM and other data. Storing this intermediate
|
||
structure is useful to iterate quickly on parts of the map importing pipeline without having to
|
||
constantly read .osm files, and to visualize the intermediate state with map_editor.</p>
|
||
</td></tr><tr class='module-item'><td><a class="mod" href="traversable/index.html" title='map_model::traversable mod'>traversable</a></td><td class='docblock-short'></td></tr></table><h2 id='structs' class='section-header'><a href="#structs">Structs</a></h2>
|
||
<table><tr class='module-item'><td><a class="struct" href="struct.AccessRestrictions.html" title='map_model::AccessRestrictions struct'>AccessRestrictions</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.Area.html" title='map_model::Area struct'>Area</a></td><td class='docblock-short'><p>Areas are just used for drawing.</p>
|
||
</td></tr><tr class='module-item'><td><a class="struct" href="struct.AreaID.html" title='map_model::AreaID struct'>AreaID</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.Building.html" title='map_model::Building struct'>Building</a></td><td class='docblock-short'><p>A building has connections to the road and sidewalk, may contain commercial amenities, and have
|
||
off-street parking.</p>
|
||
</td></tr><tr class='module-item'><td><a class="struct" href="struct.BuildingID.html" title='map_model::BuildingID struct'>BuildingID</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.BusRoute.html" title='map_model::BusRoute struct'>BusRoute</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.BusRouteID.html" title='map_model::BusRouteID struct'>BusRouteID</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.BusStop.html" title='map_model::BusStop struct'>BusStop</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.BusStopID.html" title='map_model::BusStopID struct'>BusStopID</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.City.html" title='map_model::City struct'>City</a></td><td class='docblock-short'><p>A single city (like Seattle) can be broken down into multiple boundary polygons (udistrict,
|
||
ballard, downtown, etc). The load map screen uses this struct to display the entire city.</p>
|
||
</td></tr><tr class='module-item'><td><a class="struct" href="struct.CompressedMovementID.html" title='map_model::CompressedMovementID struct'>CompressedMovementID</a></td><td class='docblock-short'><p>This is cheaper to store than a MovementID. It simply indexes into the list of movements.</p>
|
||
</td></tr><tr class='module-item'><td><a class="struct" href="struct.ControlStopSign.html" title='map_model::ControlStopSign struct'>ControlStopSign</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.ControlTrafficSignal.html" title='map_model::ControlTrafficSignal struct'>ControlTrafficSignal</a></td><td class='docblock-short'><p>A traffic signal consists of a sequence of Stages that repeat in a cycle. Most Stages last for a
|
||
fixed duration. During a single Stage, some movements are protected (can proceed with the
|
||
highest priority), while others are permitted (have to yield before proceeding).</p>
|
||
</td></tr><tr class='module-item'><td><a class="struct" href="struct.DirectedRoadID.html" title='map_model::DirectedRoadID struct'>DirectedRoadID</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.EditEffects.html" title='map_model::EditEffects struct'>EditEffects</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.EditRoad.html" title='map_model::EditRoad struct'>EditRoad</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.Intersection.html" title='map_model::Intersection struct'>Intersection</a></td><td class='docblock-short'><p>An intersection connects roads. Most have >2 roads and are controlled by stop signs or traffic
|
||
signals. Roads that lead to the boundary of the map end at border intersections, with only that
|
||
one road attached.</p>
|
||
</td></tr><tr class='module-item'><td><a class="struct" href="struct.IntersectionCluster.html" title='map_model::IntersectionCluster struct'>IntersectionCluster</a></td><td class='docblock-short'><p>This only applies to VehiclePathfinder; walking through these intersections is nothing special.</p>
|
||
</td></tr><tr class='module-item'><td><a class="struct" href="struct.IntersectionID.html" title='map_model::IntersectionID struct'>IntersectionID</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.Lane.html" title='map_model::Lane struct'>Lane</a></td><td class='docblock-short'><p>A road segment is broken down into individual lanes, which have a LaneType.</p>
|
||
</td></tr><tr class='module-item'><td><a class="struct" href="struct.LaneID.html" title='map_model::LaneID struct'>LaneID</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.Map.html" title='map_model::Map struct'>Map</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.MapConfig.html" title='map_model::MapConfig struct'>MapConfig</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.MapEdits.html" title='map_model::MapEdits struct'>MapEdits</a></td><td class='docblock-short'><p>Represents changes to a map. Note this isn't serializable -- that's what <code>PermanentMapEdits</code>
|
||
does.</p>
|
||
</td></tr><tr class='module-item'><td><a class="struct" href="struct.Movement.html" title='map_model::Movement struct'>Movement</a></td><td class='docblock-short'><p>A Movement groups all turns from one road to another, letting traffic signals operate at a
|
||
higher level of abstraction.
|
||
This is only useful for traffic signals currently.</p>
|
||
</td></tr><tr class='module-item'><td><a class="struct" href="struct.MovementID.html" title='map_model::MovementID struct'>MovementID</a></td><td class='docblock-short'><p>One road usually has 4 crosswalks, each a singleton Movement. We need all of the information
|
||
here to keep each crosswalk separate.</p>
|
||
</td></tr><tr class='module-item'><td><a class="struct" href="struct.NamePerLanguage.html" title='map_model::NamePerLanguage struct'>NamePerLanguage</a></td><td class='docblock-short'><p>None corresponds to the native name</p>
|
||
</td></tr><tr class='module-item'><td><a class="struct" href="struct.ParkingLot.html" title='map_model::ParkingLot struct'>ParkingLot</a></td><td class='docblock-short'><p>Parking lots have some fixed capacity for cars, and are connected to a sidewalk and road.</p>
|
||
</td></tr><tr class='module-item'><td><a class="struct" href="struct.ParkingLotID.html" title='map_model::ParkingLotID struct'>ParkingLotID</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.Path.html" title='map_model::Path struct'>Path</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.PathRequest.html" title='map_model::PathRequest struct'>PathRequest</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.PermanentMapEdits.html" title='map_model::PermanentMapEdits struct'>PermanentMapEdits</a></td><td class='docblock-short'><p>MapEdits are converted to this before serializing. Referencing things like LaneID in a Map won't
|
||
work if the basemap is rebuilt from new OSM data, so instead we use stabler OSM IDs that're less
|
||
likely to change.</p>
|
||
</td></tr><tr class='module-item'><td><a class="struct" href="struct.Position.html" title='map_model::Position struct'>Position</a></td><td class='docblock-short'><p>Represents a specific point some distance along a lane.</p>
|
||
</td></tr><tr class='module-item'><td><a class="struct" href="struct.Road.html" title='map_model::Road struct'>Road</a></td><td class='docblock-short'><p>A Road represents a segment between exactly two Intersections. It contains Lanes as children.</p>
|
||
</td></tr><tr class='module-item'><td><a class="struct" href="struct.RoadID.html" title='map_model::RoadID struct'>RoadID</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.RoadWithStopSign.html" title='map_model::RoadWithStopSign struct'>RoadWithStopSign</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.Stage.html" title='map_model::Stage struct'>Stage</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.Turn.html" title='map_model::Turn struct'>Turn</a></td><td class='docblock-short'><p>A Turn leads from the end of one Lane to the start of another. (Except for pedestrians;
|
||
sidewalks are bidirectional.)</p>
|
||
</td></tr><tr class='module-item'><td><a class="struct" href="struct.TurnID.html" title='map_model::TurnID struct'>TurnID</a></td><td class='docblock-short'><p>Turns are uniquely identified by their (src, dst) lanes and their parent intersection.
|
||
Intersection is needed to distinguish crosswalks that exist at two ends of a sidewalk.</p>
|
||
</td></tr><tr class='module-item'><td><a class="struct" href="struct.UberTurn.html" title='map_model::UberTurn struct'>UberTurn</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.UberTurnGroup.html" title='map_model::UberTurnGroup struct'>UberTurnGroup</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.Zone.html" title='map_model::Zone struct'>Zone</a></td><td class='docblock-short'><p>A contiguous set of roads with access restrictions. This is derived from all the map's roads and
|
||
kept cached for performance.</p>
|
||
</td></tr></table><h2 id='enums' class='section-header'><a href="#enums">Enums</a></h2>
|
||
<table><tr class='module-item'><td><a class="enum" href="enum.AreaType.html" title='map_model::AreaType enum'>AreaType</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="enum" href="enum.BuildingType.html" title='map_model::BuildingType enum'>BuildingType</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="enum" href="enum.Direction.html" title='map_model::Direction enum'>Direction</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="enum" href="enum.DrivingSide.html" title='map_model::DrivingSide enum'>DrivingSide</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="enum" href="enum.EditCmd.html" title='map_model::EditCmd enum'>EditCmd</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="enum" href="enum.EditIntersection.html" title='map_model::EditIntersection enum'>EditIntersection</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="enum" href="enum.IntersectionType.html" title='map_model::IntersectionType enum'>IntersectionType</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="enum" href="enum.LaneType.html" title='map_model::LaneType enum'>LaneType</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="enum" href="enum.OffstreetParking.html" title='map_model::OffstreetParking enum'>OffstreetParking</a></td><td class='docblock-short'><p>Represent no parking as Private(0, false).</p>
|
||
</td></tr><tr class='module-item'><td><a class="enum" href="enum.PathConstraints.html" title='map_model::PathConstraints enum'>PathConstraints</a></td><td class='docblock-short'><p>Who's asking for a path?</p>
|
||
</td></tr><tr class='module-item'><td><a class="enum" href="enum.PathStep.html" title='map_model::PathStep enum'>PathStep</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="enum" href="enum.PhaseType.html" title='map_model::PhaseType enum'>PhaseType</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="enum" href="enum.Traversable.html" title='map_model::Traversable enum'>Traversable</a></td><td class='docblock-short'><p>Either a lane or a turn, where most movement happens.</p>
|
||
</td></tr><tr class='module-item'><td><a class="enum" href="enum.TurnPriority.html" title='map_model::TurnPriority enum'>TurnPriority</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="enum" href="enum.TurnType.html" title='map_model::TurnType enum'>TurnType</a></td><td class='docblock-short'></td></tr></table><h2 id='constants' class='section-header'><a href="#constants">Constants</a></h2>
|
||
<table><tr class='module-item'><td><a class="constant" href="constant.NORMAL_LANE_THICKNESS.html" title='map_model::NORMAL_LANE_THICKNESS constant'>NORMAL_LANE_THICKNESS</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="constant" href="constant.PARKING_LOT_SPOT_LENGTH.html" title='map_model::PARKING_LOT_SPOT_LENGTH constant'>PARKING_LOT_SPOT_LENGTH</a></td><td class='docblock-short'><p>The full PARKING_SPOT_LENGTH used for on-street is looking too conservative for some manually
|
||
audited cases in Seattle. This is 0.8 of above</p>
|
||
</td></tr><tr class='module-item'><td><a class="constant" href="constant.PARKING_SPOT_LENGTH.html" title='map_model::PARKING_SPOT_LENGTH constant'>PARKING_SPOT_LENGTH</a></td><td class='docblock-short'><p>Bit longer than the longest car.</p>
|
||
</td></tr><tr class='module-item'><td><a class="constant" href="constant.SERVICE_ROAD_LANE_THICKNESS.html" title='map_model::SERVICE_ROAD_LANE_THICKNESS constant'>SERVICE_ROAD_LANE_THICKNESS</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="constant" href="constant.SHOULDER_THICKNESS.html" title='map_model::SHOULDER_THICKNESS constant'>SHOULDER_THICKNESS</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="constant" href="constant.SIDEWALK_THICKNESS.html" title='map_model::SIDEWALK_THICKNESS constant'>SIDEWALK_THICKNESS</a></td><td class='docblock-short'></td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../";window.currentCrate = "map_model";</script><script src="../main.js"></script><script defer src="../search-index.js"></script></body></html> |