diff --git a/rustdoc/ltn/route_planner/fn.card.html b/rustdoc/ltn/route_planner/fn.card.html index 2bff65878b..a192215a1b 100644 --- a/rustdoc/ltn/route_planner/fn.card.html +++ b/rustdoc/ltn/route_planner/fn.card.html @@ -1,4 +1,4 @@
top_panel: Panel
left_panel: Panel
waypoints: InputWaypoints
files: TripManagement<SimpleApp<Session>, RoutePlanner>
world: World<WaypointID>
draw_routes: ToggleZoomed
labels: DrawRoadLabels
pathfinder_cache: PathfinderCache
Respond to a UI event, such as input or time passing.
-Draw
+}top_panel: Panel
left_panel: Panel
waypoints: InputWaypoints
files: TripManagement<SimpleApp<Session>, RoutePlanner>
world: World<WaypointID>
draw_routes: ToggleZoomed
labels: DrawRoadLabels
pathfinder_cache: PathfinderCache
Respond to a UI event, such as input or time passing.
+Specifies what to draw before draw()
Before this state is popped or replaced, call this.
Gets the TypeId
of self
. Read more
pub const BUILT_TIME_UTC: &str = r"Wed, 23 Mar 2022 10:57:16 +0000";
The build time in RFC2822, UTC.
+pub const BUILT_TIME_UTC: &str = r"Wed, 23 Mar 2022 11:16:58 +0000";
The build time in RFC2822, UTC.
use geom::{Distance, Duration};
use map_gui::tools::{
DrawRoadLabels, InputWaypoints, TripManagement, TripManagementState, WaypointID,
@@ -520,20 +512,19 @@
params.main_road_penalty = app.session.main_road_penalty;
for pair in self.waypoints.get_waypoints().windows(2) {
- if let Some((path, pl)) =
- TripEndpoint::path_req(pair[0], pair[1], TripMode::Drive, map)
- .and_then(|req| {
- self.pathfinder_cache
- .pathfind_with_params(map, req, params.clone())
- })
- .and_then(|path| path.into_v1(map).ok())
- .and_then(|path| path.trace(map).map(|pl| (path, pl)))
+ if let Some(path) = TripEndpoint::path_req(pair[0], pair[1], TripMode::Drive, map)
+ .and_then(|req| {
+ self.pathfinder_cache
+ .pathfind_with_params(map, req, params.clone())
+ })
{
- let shape = pl.make_polygons(5.0 * NORMAL_LANE_THICKNESS);
- draw.unzoomed.push(color.alpha(0.8), shape.clone());
- draw.zoomed.push(color.alpha(0.5), shape);
-
- total_time += path.estimate_duration(map, None);
+ let cost = path.get_cost();
+ if let Some(pl) = path.into_v1(map).ok().and_then(|path| path.trace(map)) {
+ let shape = pl.make_polygons(5.0 * NORMAL_LANE_THICKNESS);
+ draw.unzoomed.push(color.alpha(0.8), shape.clone());
+ draw.zoomed.push(color.alpha(0.5), shape);
+ total_time += cost;
+ }
}
}
@@ -550,26 +541,19 @@
let mut draw_after = ToggleZoomed::builder();
let color = *colors::PLAN_ROUTE_AFTER;
for pair in self.waypoints.get_waypoints().windows(2) {
- if let Some((path, pl)) =
- TripEndpoint::path_req(pair[0], pair[1], TripMode::Drive, map)
- .and_then(|req| {
- self.pathfinder_cache
- .pathfind_with_params(map, req, params.clone())
- })
- .and_then(|path| path.into_v1(map).ok())
- .and_then(|path| path.trace(map).map(|pl| (path, pl)))
+ if let Some(path) = TripEndpoint::path_req(pair[0], pair[1], TripMode::Drive, map)
+ .and_then(|req| {
+ self.pathfinder_cache
+ .pathfind_with_params(map, req, params.clone())
+ })
{
- let shape = pl.make_polygons(5.0 * NORMAL_LANE_THICKNESS);
- draw_after.unzoomed.push(color.alpha(0.8), shape.clone());
- draw_after.zoomed.push(color.alpha(0.5), shape);
-
- // We use PathV1 (lane-based) for tracing. It doesn't preserve the cost
- // calculated while pathfinding, so just estimate_duration.
- //
- // The original reason for using estimate_duration here was to exclude the large
- // penalty if the route crossed a filter. But now that's impossible at the
- // pathfinding layer.
- total_time += path.estimate_duration(map, None);
+ let cost = path.get_cost();
+ if let Some(pl) = path.into_v1(map).ok().and_then(|path| path.trace(map)) {
+ let shape = pl.make_polygons(5.0 * NORMAL_LANE_THICKNESS);
+ draw_after.unzoomed.push(color.alpha(0.8), shape.clone());
+ draw_after.zoomed.push(color.alpha(0.5), shape);
+ total_time += cost;
+ }
}
}
// To simplify colors, don't draw this path when it's the same as the baseline
diff --git a/rustdoc/src/map_gui/home/runner/work/abstreet/abstreet/target/debug/build/map_gui-49fc0ec202264eb2/out/built.rs.html b/rustdoc/src/map_gui/home/runner/work/abstreet/abstreet/target/debug/build/map_gui-49fc0ec202264eb2/out/built.rs.html
index c69bf484d8..24745de7e2 100644
--- a/rustdoc/src/map_gui/home/runner/work/abstreet/abstreet/target/debug/build/map_gui-49fc0ec202264eb2/out/built.rs.html
+++ b/rustdoc/src/map_gui/home/runner/work/abstreet/abstreet/target/debug/build/map_gui-49fc0ec202264eb2/out/built.rs.html
@@ -176,7 +176,7 @@
pub const RUSTDOC_VERSION: &str = r"rustdoc 1.59.0 (9d1b2106e 2022-02-23)";
#[doc=r#"The build time in RFC2822, UTC."#]
#[allow(dead_code)]
-pub const BUILT_TIME_UTC: &str = r"Wed, 23 Mar 2022 10:57:16 +0000";
+pub const BUILT_TIME_UTC: &str = r"Wed, 23 Mar 2022 11:16:58 +0000";
#[doc=r#"The target architecture, given by `CARGO_CFG_TARGET_ARCH`."#]
#[allow(dead_code)]
pub const CFG_TARGET_ARCH: &str = r"x86_64";