Struct map_model::pathfind::pathfinder::Pathfinder
source · [−]pub struct Pathfinder {
car_graph: VehiclePathfinder,
bike_graph: VehiclePathfinder,
bus_graph: VehiclePathfinder,
train_graph: VehiclePathfinder,
walking_graph: SidewalkPathfinder,
walking_with_transit_graph: SidewalkPathfinder,
params: RoutingParams,
cached_alternatives: ThreadLocal<RefCell<VecMap<(PathConstraints, RoutingParams), Pathfinder>>>,
}
Fields
car_graph: VehiclePathfinder
bike_graph: VehiclePathfinder
bus_graph: VehiclePathfinder
train_graph: VehiclePathfinder
walking_graph: SidewalkPathfinder
walking_with_transit_graph: SidewalkPathfinder
params: RoutingParams
cached_alternatives: ThreadLocal<RefCell<VecMap<(PathConstraints, RoutingParams), Pathfinder>>>
Implementations
sourceimpl Pathfinder
impl Pathfinder
sourcepub fn empty() -> Pathfinder
pub fn empty() -> Pathfinder
Quickly create an invalid pathfinder, just to make borrow checking / initialization order work.
pub(crate) fn new(
map: &Map,
params: RoutingParams,
engine: &CreateEngine<'_>,
timer: &mut Timer<'_>
) -> Pathfinder
sourcepub fn new_dijkstra(
map: &Map,
params: RoutingParams,
modes: Vec<PathConstraints>,
timer: &mut Timer<'_>
) -> Self
pub fn new_dijkstra(
map: &Map,
params: RoutingParams,
modes: Vec<PathConstraints>,
timer: &mut Timer<'_>
) -> Self
Create a new Pathfinder with custom routing params that can only serve some modes. Fast to create, slow to use.
sourcepub fn new_ch(
map: &Map,
params: RoutingParams,
modes: Vec<PathConstraints>,
timer: &mut Timer<'_>
) -> Self
pub fn new_ch(
map: &Map,
params: RoutingParams,
modes: Vec<PathConstraints>,
timer: &mut Timer<'_>
) -> Self
Create a new Pathfinder with custom routing params that can only serve some modes. Slow to create, fast to use. Doesn’t re-use the node ordering when building the CH.
sourcepub(crate) fn new_limited(
map: &Map,
params: RoutingParams,
engine: CreateEngine<'_>,
modes: Vec<PathConstraints>,
timer: &mut Timer<'_>
) -> Pathfinder
pub(crate) fn new_limited(
map: &Map,
params: RoutingParams,
engine: CreateEngine<'_>,
modes: Vec<PathConstraints>,
timer: &mut Timer<'_>
) -> Pathfinder
Create a new Pathfinder with custom routing params that can only serve some modes.
pub(crate) fn finalize_transit(&mut self, map: &Map, engine: &CreateEngine<'_>)
sourcepub fn pathfind(&self, req: PathRequest, map: &Map) -> Option<PathV2>
pub fn pathfind(&self, req: PathRequest, map: &Map) -> Option<PathV2>
Finds a path from a start to an end for a certain type of agent.
sourcepub fn pathfind_v2(&self, req: PathRequest, map: &Map) -> Option<PathV2>
pub fn pathfind_v2(&self, req: PathRequest, map: &Map) -> Option<PathV2>
Finds a path from a start to an end for a certain type of agent. Uses the RoutingParams built into this Pathfinder.
sourcepub fn pathfind_with_params(
&self,
req: PathRequest,
params: &RoutingParams,
cache_custom: PathfinderCaching,
map: &Map
) -> Option<PathV2>
pub fn pathfind_with_params(
&self,
req: PathRequest,
params: &RoutingParams,
cache_custom: PathfinderCaching,
map: &Map
) -> Option<PathV2>
Finds a path from a start to an end for a certain type of agent. May use custom routing parameters. If caching is requested and custom routing parameters are used, then the intermediate graph is saved to speed up future calls with the same routing parameters.
pub fn all_costs_from(
&self,
req: PathRequest,
map: &Map
) -> Option<(Duration, HashMap<DirectedRoadID, Duration>)>
pub fn should_use_transit(
&self,
map: &Map,
start: Position,
end: Position
) -> Option<(TransitStopID, Option<TransitStopID>, TransitRouteID)>
pub(crate) fn apply_edits(&mut self, map: &Map, timer: &mut Timer<'_>)
Trait Implementations
sourceimpl Clone for Pathfinder
impl Clone for Pathfinder
sourceimpl<'de> Deserialize<'de> for Pathfinder
impl<'de> Deserialize<'de> for Pathfinder
sourcefn 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>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl Serialize for Pathfinder
impl Serialize for Pathfinder
Auto Trait Implementations
impl RefUnwindSafe for Pathfinder
impl Send for Pathfinder
impl Sync for Pathfinder
impl Unpin for Pathfinder
impl UnwindSafe for Pathfinder
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more