From f519de7b147e73620689d350d6ab504566558ed9 Mon Sep 17 00:00:00 2001 From: Karl Schrab Date: Fri, 3 Nov 2023 09:24:47 +0100 Subject: [PATCH] clean: re-added valuable comment about virtual edges Signed-off-by: Karl Schrab --- .../mosaic/lib/routing/graphhopper/GraphHopperRouting.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/mosaic-routing/src/main/java/org/eclipse/mosaic/lib/routing/graphhopper/GraphHopperRouting.java b/lib/mosaic-routing/src/main/java/org/eclipse/mosaic/lib/routing/graphhopper/GraphHopperRouting.java index 87788f781..9c4ed0a02 100644 --- a/lib/mosaic-routing/src/main/java/org/eclipse/mosaic/lib/routing/graphhopper/GraphHopperRouting.java +++ b/lib/mosaic-routing/src/main/java/org/eclipse/mosaic/lib/routing/graphhopper/GraphHopperRouting.java @@ -375,6 +375,11 @@ private CandidateRoute convertPath(Graph graph, Path newPath, RoutingPosition ta EdgeIteratorState origEdge = edgesIt.next(); EdgeIteratorState currEdge = origEdge; + /* + * If the requested source or target point is in the middle of the road, an artificial node + * (and artificial edges) is created in the QueryGraph. As a consequence, the first + * and/or last edge of the route might be such virtual edge, which must be converted to its original edge. + */ if (currEdge instanceof VirtualEdgeIteratorState) { currEdge = graph.getEdgeIteratorStateForKey(((VirtualEdgeIteratorState) origEdge).getOriginalEdgeKey()); }