Struct map_model::Map [−][src]
pub struct Map {}Show fields
roads: Vec<Road>, lanes: BTreeMap<LaneID, Lane>, lane_id_counter: usize, intersections: Vec<Intersection>, buildings: Vec<Building>, bus_stops: BTreeMap<BusStopID, BusStop>, bus_routes: Vec<BusRoute>, areas: Vec<Area>, parking_lots: Vec<ParkingLot>, boundary_polygon: Polygon, stop_signs: BTreeMap<IntersectionID, ControlStopSign>, traffic_signals: BTreeMap<IntersectionID, ControlTrafficSignal>, gps_bounds: GPSBounds, bounds: Bounds, config: MapConfig, pathfinder: Pathfinder, pathfinder_dirty: bool, routing_params: RoutingParams, zones: Vec<Zone>, name: MapName, edits: MapEdits,
Fields
roads: Vec<Road>
lanes: BTreeMap<LaneID, Lane>
lane_id_counter: usize
intersections: Vec<Intersection>
buildings: Vec<Building>
bus_stops: BTreeMap<BusStopID, BusStop>
bus_routes: Vec<BusRoute>
areas: Vec<Area>
parking_lots: Vec<ParkingLot>
boundary_polygon: Polygon
stop_signs: BTreeMap<IntersectionID, ControlStopSign>
traffic_signals: BTreeMap<IntersectionID, ControlTrafficSignal>
gps_bounds: GPSBounds
bounds: Bounds
config: MapConfig
pathfinder: Pathfinder
pathfinder_dirty: bool
routing_params: RoutingParams
zones: Vec<Zone>
name: MapName
edits: MapEdits
Implementations
impl Map
[src]
impl Map
[src]pub fn new_edits(&self) -> MapEdits
[src]
pub fn get_edits(&self) -> &MapEdits
[src]
pub fn unsaved_edits(&self) -> bool
[src]
pub fn get_r_edit(&self, r: RoadID) -> EditRoad
[src]
pub fn edit_road_cmd<F: Fn(&mut EditRoad)>(&self, r: RoadID, f: F) -> EditCmd
[src]
pub fn get_i_edit(&self, i: IntersectionID) -> EditIntersection
[src]
Panics on borders
pub fn save_edits(&self)
[src]
pub fn must_apply_edits(&mut self, new_edits: MapEdits) -> EditEffects
[src]
Returns (changed_roads, deleted_lanes, deleted_turns, added_turns, changed_intersections)
pub fn try_apply_edits(&mut self, new_edits: MapEdits)
[src]
fn apply_edits(
&mut self,
new_edits: MapEdits,
enforce_valid: bool
) -> EditEffects
[src]
&mut self,
new_edits: MapEdits,
enforce_valid: bool
) -> EditEffects
pub fn recalculate_pathfinding_after_edits(&mut self, timer: &mut Timer<'_>)
[src]
This can expensive, so don’t constantly do it while editing in the UI. But this must happen before the simulation resumes.
pub fn incremental_edit_traffic_signal(&mut self, signal: ControlTrafficSignal)
[src]
Since the player is in the middle of editing, the signal may not be valid. Don’t go through the entire apply_edits flow.
impl Map
[src]
impl Map
[src]pub fn create_from_raw(
raw: RawMap,
opts: RawToMapOptions,
timer: &mut Timer<'_>
) -> Map
[src]
raw: RawMap,
opts: RawToMapOptions,
timer: &mut Timer<'_>
) -> Map
impl Map
[src]
impl Map
[src]impl Map
[src]
impl Map
[src]pub fn load_synchronously(path: String, timer: &mut Timer<'_>) -> Map
[src]
Load a map from a local serialized Map or RawMap. Note this won’t work on web. This should only be used by non-UI tools.
pub fn map_loaded_directly(&mut self)
[src]
After deserializing a map directly, call this after.
pub fn blank() -> Map
[src]
Just for temporary std::mem::replace tricks.
pub fn all_roads(&self) -> &Vec<Road>
[src]
pub fn all_lanes(&self) -> &BTreeMap<LaneID, Lane>
[src]
pub fn all_intersections(&self) -> &Vec<Intersection>
[src]
pub fn all_turns(&self) -> impl Iterator<Item = &Turn>
[src]
pub fn all_buildings(&self) -> &Vec<Building>
[src]
pub fn all_areas(&self) -> &Vec<Area>
[src]
pub fn all_parking_lots(&self) -> &Vec<ParkingLot>
[src]
pub fn all_zones(&self) -> &Vec<Zone>
[src]
pub fn maybe_get_r(&self, id: RoadID) -> Option<&Road>
[src]
pub fn maybe_get_l(&self, id: LaneID) -> Option<&Lane>
[src]
pub fn maybe_get_i(&self, id: IntersectionID) -> Option<&Intersection>
[src]
pub fn maybe_get_t(&self, id: TurnID) -> Option<&Turn>
[src]
pub fn maybe_get_b(&self, id: BuildingID) -> Option<&Building>
[src]
pub fn maybe_get_pl(&self, id: ParkingLotID) -> Option<&ParkingLot>
[src]
pub fn maybe_get_a(&self, id: AreaID) -> Option<&Area>
[src]
pub fn maybe_get_bs(&self, id: BusStopID) -> Option<&BusStop>
[src]
pub fn maybe_get_stop_sign(
&self,
id: IntersectionID
) -> Option<&ControlStopSign>
[src]
&self,
id: IntersectionID
) -> Option<&ControlStopSign>
pub fn maybe_get_traffic_signal(
&self,
id: IntersectionID
) -> Option<&ControlTrafficSignal>
[src]
&self,
id: IntersectionID
) -> Option<&ControlTrafficSignal>
pub fn maybe_get_br(&self, route: BusRouteID) -> Option<&BusRoute>
[src]
pub fn get_r(&self, id: RoadID) -> &Road
[src]
pub fn get_l(&self, id: LaneID) -> &Lane
[src]
pub fn get_i(&self, id: IntersectionID) -> &Intersection
[src]
pub fn get_t(&self, id: TurnID) -> &Turn
[src]
pub fn get_b(&self, id: BuildingID) -> &Building
[src]
pub fn get_a(&self, id: AreaID) -> &Area
[src]
pub fn get_pl(&self, id: ParkingLotID) -> &ParkingLot
[src]
pub fn get_stop_sign(&self, id: IntersectionID) -> &ControlStopSign
[src]
pub fn get_traffic_signal(&self, id: IntersectionID) -> &ControlTrafficSignal
[src]
pub fn get_turns_in_intersection(&self, id: IntersectionID) -> &Vec<Turn>
[src]
pub fn get_turns_from_lane(&self, l: LaneID) -> Vec<&Turn>
[src]
The turns may belong to two different intersections!
pub fn get_turns_to_lane(&self, l: LaneID) -> Vec<&Turn>
[src]
pub fn get_turn_between(
&self,
from: LaneID,
to: LaneID,
parent: IntersectionID
) -> Option<&Turn>
[src]
&self,
from: LaneID,
to: LaneID,
parent: IntersectionID
) -> Option<&Turn>
pub fn get_next_turns_and_lanes(
&self,
from: LaneID,
parent: IntersectionID
) -> Vec<(&Turn, &Lane)>
[src]
&self,
from: LaneID,
parent: IntersectionID
) -> Vec<(&Turn, &Lane)>
pub fn get_turns_for(
&self,
from: LaneID,
constraints: PathConstraints
) -> Vec<&Turn>
[src]
&self,
from: LaneID,
constraints: PathConstraints
) -> Vec<&Turn>
pub fn get_movements_for(
&self,
from: DirectedRoadID,
constraints: PathConstraints
) -> Vec<MovementID>
[src]
&self,
from: DirectedRoadID,
constraints: PathConstraints
) -> Vec<MovementID>
Find all movements from one road to another that’re usable by someone.
pub fn get_next_roads(&self, from: RoadID) -> BTreeSet<RoadID>
[src]
pub fn get_parent(&self, id: LaneID) -> &Road
[src]
pub fn get_gps_bounds(&self) -> &GPSBounds
[src]
pub fn get_bounds(&self) -> &Bounds
[src]
pub fn get_city_name(&self) -> &CityName
[src]
pub fn get_name(&self) -> &MapName
[src]
pub fn all_bus_stops(&self) -> &BTreeMap<BusStopID, BusStop>
[src]
pub fn get_bs(&self, stop: BusStopID) -> &BusStop
[src]
pub fn get_br(&self, route: BusRouteID) -> &BusRoute
[src]
pub fn all_bus_routes(&self) -> &Vec<BusRoute>
[src]
pub fn get_bus_route(&self, name: &str) -> Option<&BusRoute>
[src]
pub fn get_routes_serving_stop(&self, stop: BusStopID) -> Vec<&BusRoute>
[src]
pub fn building_to_road(&self, id: BuildingID) -> &Road
[src]
pub fn all_incoming_borders(&self) -> Vec<&Intersection>
[src]
This and all_outgoing_borders are expensive to constantly repeat
pub fn all_outgoing_borders(&self) -> Vec<&Intersection>
[src]
pub fn save(&self)
[src]
pub fn find_driving_lane_near_building(&self, b: BuildingID) -> LaneID
[src]
Cars trying to park near this building should head for the driving lane returned here, then start their search. Some parking lanes are connected to driving lanes that’re “parking blackholes” – if there are no free spots on that lane, then the roads force cars to a border.
pub fn get_boundary_polygon(&self) -> &Polygon
[src]
pub fn pathfind(&self, req: PathRequest) -> Result<Path>
[src]
pub fn pathfind_with_params(
&self,
req: PathRequest,
params: &RoutingParams
) -> Result<Path>
[src]
&self,
req: PathRequest,
params: &RoutingParams
) -> Result<Path>
pub fn should_use_transit(
&self,
start: Position,
end: Position
) -> Option<(BusStopID, Option<BusStopID>, BusRouteID)>
[src]
&self,
start: Position,
end: Position
) -> Option<(BusStopID, Option<BusStopID>, BusRouteID)>
pub fn all_costs_from(
&self,
req: PathRequest
) -> Option<(Duration, HashMap<DirectedRoadID, Duration>)>
[src]
&self,
req: PathRequest
) -> Option<(Duration, HashMap<DirectedRoadID, Duration>)>
Return the cost of a single path, and also a mapping from every directed road to the cost of getting there from the same start. This can be used to understand why an alternative route wasn’t chosen.
pub fn get_movement(&self, t: TurnID) -> Option<MovementID>
[src]
pub fn find_r_by_osm_id(&self, id: OriginalRoad) -> Result<RoadID>
[src]
pub fn find_i_by_osm_id(&self, id: NodeID) -> Result<IntersectionID>
[src]
pub fn find_b_by_osm_id(&self, id: OsmID) -> Option<BuildingID>
[src]
pub fn find_br(&self, id: RelationID) -> Option<BusRouteID>
[src]
pub fn hack_override_offstreet_spots(&mut self, spots_per_bldg: usize)
[src]
pub fn hack_override_offstreet_spots_individ(
&mut self,
b: BuildingID,
spots: usize
)
[src]
&mut self,
b: BuildingID,
spots: usize
)
pub fn hack_override_bldg_type(
&mut self,
b: BuildingID,
bldg_type: BuildingType
)
[src]
&mut self,
b: BuildingID,
bldg_type: BuildingType
)
pub fn hack_override_orig_spawn_times(
&mut self,
br: BusRouteID,
times: Vec<Time>
)
[src]
&mut self,
br: BusRouteID,
times: Vec<Time>
)
pub fn hack_add_area(
&mut self,
area_type: AreaType,
polygon: Polygon,
osm_tags: Tags
)
[src]
&mut self,
area_type: AreaType,
polygon: Polygon,
osm_tags: Tags
)
pub fn hack_override_routing_params(
&mut self,
routing_params: RoutingParams,
timer: &mut Timer<'_>
)
[src]
&mut self,
routing_params: RoutingParams,
timer: &mut Timer<'_>
)
pub fn get_languages(&self) -> BTreeSet<&str>
[src]
pub fn get_config(&self) -> &MapConfig
[src]
pub fn simple_path_btwn(
&self,
i1: IntersectionID,
i2: IntersectionID
) -> Option<Vec<RoadID>>
[src]
&self,
i1: IntersectionID,
i2: IntersectionID
) -> Option<Vec<RoadID>>
Simple search along undirected roads
pub fn routing_params(&self) -> &RoutingParams
[src]
Returns the routing params baked into the map.
Trait Implementations
impl<'de> Deserialize<'de> for Map
[src]
impl<'de> Deserialize<'de> for Map
[src]fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
Auto Trait Implementations
impl RefUnwindSafe for Map
impl Send for Map
impl Sync for Map
impl Unpin for Map
impl UnwindSafe for Map
Blanket Implementations
impl<T> Instrument for T
[src]
impl<T> Instrument for T
[src]pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
pub fn vzip(self) -> V
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,