pub fn max_speed_and_incline_along(
        &self,
        max_speed_on_flat_ground: Option<Speed>,
        constraints: PathConstraints,
        map: &Map,
    ) -> (Speed, f64) {
        match self {
            PathStep::Lane(l) => Traversable::max_speed_along_road(
                map.get_l(*l).get_directed_parent(),
                max_speed_on_flat_ground,
                constraints,
                map,
            ),
            PathStep::ContraflowLane(l) => Traversable::max_speed_along_road(
                {
                    let mut dr = map.get_l(*l).get_directed_parent();
                    dr.dir = dr.dir.opposite();
                    dr
                },
                max_speed_on_flat_ground,
                constraints,
                map,
            ),
            PathStep::Turn(t) => (
                Traversable::max_speed_along_movement(
                    t.to_movement(map),
                    max_speed_on_flat_ground,
                    constraints,
                    map,
                ),
                0.0,
            ),
        }
    }
/// The single definitive place to determine how fast somebody could go along a single road or
/// turn. This should be used for pathfinding and simulation. Returns (speed, percent incline).
The single definitive place to determine how fast somebody could go along a single road or
turn. This should be used for pathfinding and simulation. Returns (speed, percent incline).
The single definitive place to determine how fast somebody could go along a single road or turn . This should be used for pathfinding and simulation . Returns ( speed percent incline ) .
pub fn max_speed_and_incline_along(
        &self,
        max_speed_on_flat_ground: Option<Speed>,
        constraints: PathConstraints,
        map: &Map,
    ) -> (Speed, f64) {
        match self {
            PathStep::Lane(l) => Traversable::max_speed_along_road(
                map.get_l(*l).get_directed_parent(),
                max_speed_on_flat_ground,
                constraints,
                map,
            ),
            PathStep::ContraflowLane(l) => Traversable::max_speed_along_road(
                {
                    let mut dr = map.get_l(*l).get_directed_parent();
                    dr.dir = dr.dir.opposite();
                    dr
                },
                max_speed_on_flat_ground,
                constraints,
                map,
            ),
            PathStep::Turn(t) => (
                Traversable::max_speed_along_movement(
                    t.to_movement(map),
                    max_speed_on_flat_ground,
                    constraints,
                    map,
                ),
                0.0,
            ),
        }
    }
pub fn max_speed_and_incline_along ( & self , max_speed_on_flat_ground : Option < Speed > , constraints : PathConstraints , map : & Map , ) -> ( Speed , f64 ) { match self { PathStep :: Lane ( l ) => Traversable :: max_speed_along_road ( map . get_l ( * l ) . get_directed_parent ( ) , max_speed_on_flat_ground , constraints , map , ) , PathStep :: ContraflowLane ( l ) => Traversable :: max_speed_along_road ( { let mut dr = map . get_l ( * l ) . get_directed_parent ( ) ; dr . dir = dr . dir . opposite ( ) ; dr } , max_speed_on_flat_ground , constraints , map , ) , PathStep :: Turn ( t ) => ( Traversable :: max_speed_along_movement ( t . to_movement ( map ) , max_speed_on_flat_ground , constraints , map , ) , 0.0 , ) , } }
The single definitive place to determine how fast somebody could go along a single road or
turn.
The single definitive place to determine how fast somebody could go along a single road or turn .
&self
max_speed_on_flat_ground
Option<Speed>
constraints
PathConstraints
map
&Map