Struct map_model::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§
source§impl 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.