pub fn pathfind_with_params(
        &self,
        req: PathRequest,
        params: &RoutingParams,
        map: &Map,
    ) -> Option<PathV2> {
        if params != &self.params {
            // If the params differ from the ones baked into the map, the CHs won't match. This
            // should only be happening from the debug UI; be very obnoxious if we start calling it
            // from the simulation or something else.
            warn!("Pathfinding slowly for {} with custom params", req);
            let tmp_pathfinder = Pathfinder::new(
                map,
                params.clone(),
                CreateEngine::Dijkstra,
                &mut Timer::throwaway(),
            );
            return tmp_pathfinder.pathfind_with_params(req, params, map);
        }

        match req.constraints {
            PathConstraints::Pedestrian => self.walking_graph.pathfind(req, map),
            PathConstraints::Car => self.car_graph.pathfind(req, map),
            PathConstraints::Bike => self.bike_graph.pathfind(req, map),
            PathConstraints::Bus => self.bus_graph.pathfind(req, map),
            PathConstraints::Train => self.train_graph.pathfind(req, map),
        }
    }
/// Finds a path from a start to an end for a certain type of agent. May use custom routing
/// parameters.
Finds a path from a start to an end for a certain type of agent. May use custom routing
parameters.
Finds a path from a start to an end for a certain type of agent . May use custom routing parameters .
pub fn pathfind_with_params(
        &self,
        req: PathRequest,
        params: &RoutingParams,
        map: &Map,
    ) -> Option<PathV2> {
        if params != &self.params {
            // If the params differ from the ones baked into the map, the CHs won't match. This
            // should only be happening from the debug UI; be very obnoxious if we start calling it
            // from the simulation or something else.
            warn!("Pathfinding slowly for {} with custom params", req);
            let tmp_pathfinder = Pathfinder::new(
                map,
                params.clone(),
                CreateEngine::Dijkstra,
                &mut Timer::throwaway(),
            );
            return tmp_pathfinder.pathfind_with_params(req, params, map);
        }
        match req.constraints {
            PathConstraints::Pedestrian => self.walking_graph.pathfind(req, map),
            PathConstraints::Car => self.car_graph.pathfind(req, map),
            PathConstraints::Bike => self.bike_graph.pathfind(req, map),
            PathConstraints::Bus => self.bus_graph.pathfind(req, map),
            PathConstraints::Train => self.train_graph.pathfind(req, map),
        }
    }
pub fn pathfind_with_params ( & self , req : PathRequest , params : & RoutingParams , map : & Map , ) -> Option < PathV2 > { if params != & self . params { // If the params differ from the ones baked into the map, the CHs won't match. This // should only be happening from the debug UI; be very obnoxious if we start calling it // from the simulation or something else. warn ! ( " " req ) ; let tmp_pathfinder = Pathfinder :: new ( map , params . clone ( ) , CreateEngine :: Dijkstra , & mut Timer :: throwaway ( ) , ) ; return tmp_pathfinder . pathfind_with_params ( req , params , map ) ; } match req . constraints { PathConstraints :: Pedestrian => self . walking_graph . pathfind ( req , map ) , PathConstraints :: Car => self . car_graph . pathfind ( req , map ) , PathConstraints :: Bike => self . bike_graph . pathfind ( req , map ) , PathConstraints :: Bus => self . bus_graph . pathfind ( req , map ) , PathConstraints :: Train => self . train_graph . pathfind ( req , map ) , } }
Finds a path from a start to an end for a certain type of agent.
Finds a path from a start to an end for a certain type of agent .
&self
req
PathRequest
params
&RoutingParams
map
&Map