Struct map_model::pathfind::v1::PathRequest
source · pub struct PathRequest {
pub start: Position,
pub end: Position,
pub constraints: PathConstraints,
pub(crate) alt_start: Option<(Position, Duration)>,
}
Fields§
§start: Position
§end: Position
§constraints: PathConstraints
§alt_start: Option<(Position, Duration)>
Implementations§
source§impl PathRequest
impl PathRequest
sourcepub fn between_buildings(
map: &Map,
from: BuildingID,
to: BuildingID,
constraints: PathConstraints
) -> Option<PathRequest>
pub fn between_buildings( map: &Map, from: BuildingID, to: BuildingID, constraints: PathConstraints ) -> Option<PathRequest>
Determines the start and end position to travel between two buildings for a certain mode. The path won’t cover modality transfers – if somebody has to walk between the building and a parking spot or bikeable position, that won’t be captured here.
sourcepub fn walking(start: Position, end: Position) -> PathRequest
pub fn walking(start: Position, end: Position) -> PathRequest
The caller must pass in two valid sidewalk positions. This isn’t verified.
sourcepub fn vehicle(
start: Position,
end: Position,
constraints: PathConstraints
) -> PathRequest
pub fn vehicle( start: Position, end: Position, constraints: PathConstraints ) -> PathRequest
The caller must pass in two valid positions for the vehicle type. This isn’t verified. No off-side turns from driveways happen; the exact start position is used.
sourcepub fn leave_from_driveway(
start: Position,
end: Position,
constraints: PathConstraints,
map: &Map
) -> PathRequest
pub fn leave_from_driveway( start: Position, end: Position, constraints: PathConstraints, map: &Map ) -> PathRequest
The caller must pass in two valid positions for the vehicle type. This isn’t verified. TODO The vehicle may cut exit the driveway onto the off-side of the road.
sourcepub fn between_directed_roads(
map: &Map,
from: DirectedRoadID,
to: DirectedRoadID,
constraints: PathConstraints
) -> Option<PathRequest>
pub fn between_directed_roads( map: &Map, from: DirectedRoadID, to: DirectedRoadID, constraints: PathConstraints ) -> Option<PathRequest>
Create a request from the beginning of one road to the end of another. Picks an arbitrary start and end lane from the available ones.
sourcepub fn deduplicate(
map: &Map,
requests: Vec<PathRequest>
) -> Vec<(PathRequest, usize)>
pub fn deduplicate( map: &Map, requests: Vec<PathRequest> ) -> Vec<(PathRequest, usize)>
Group similar requests together, returning the number of matches. This can be used to calculate less paths and multiply whatever’s being measured by the count.
Note this throws away detail. It only groups by the mode and from/to parent. Exact position and alternate starting points are lost.
Trait Implementations§
source§impl Clone for PathRequest
impl Clone for PathRequest
source§fn clone(&self) -> PathRequest
fn clone(&self) -> PathRequest
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for PathRequest
impl Debug for PathRequest
source§impl<'de> Deserialize<'de> for PathRequest
impl<'de> Deserialize<'de> for PathRequest
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl Display for PathRequest
impl Display for PathRequest
source§impl PartialEq for PathRequest
impl PartialEq for PathRequest
source§fn eq(&self, other: &PathRequest) -> bool
fn eq(&self, other: &PathRequest) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for PathRequest
impl Serialize for PathRequest
impl Eq for PathRequest
impl StructuralPartialEq for PathRequest
Auto Trait Implementations§
impl Freeze for PathRequest
impl RefUnwindSafe for PathRequest
impl Send for PathRequest
impl Sync for PathRequest
impl Unpin for PathRequest
impl UnwindSafe for PathRequest
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.