Skip to content

Commit

Permalink
VGF-25 fix IBH so arrive-by new vertices get put in transit queue
Browse files Browse the repository at this point in the history
  • Loading branch information
sdjacobs committed Jun 23, 2017
1 parent bbc8d47 commit 869b83c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 32 deletions.
Expand Up @@ -331,11 +331,7 @@ private TObjectDoubleMap<Vertex> streetSearch (RoutingRequest rr, boolean fromTa
// We don't want to continue into the transit network yet, but when searching around the target
// place vertices on the transit queue so we can explore the transit network backward later.
if (fromTarget) {
double weight = s.getWeight();
transitQueue.insert(v, weight);
if (weight > maxWeightSeen) {
maxWeightSeen = weight;
}
insertIntoTransitQueue(s, v);
}
continue;
}
Expand Down Expand Up @@ -377,7 +373,7 @@ private TObjectDoubleMap<Vertex> streetSearch (RoutingRequest rr, boolean fromTa

if(s.getVertex() == initVertex){
//the origin/destination lies along a flag stop route
LOG.info("the origin/destination lies along a flag stop route. fromTarget={}, vertex={}", fromTarget, initVertex);
LOG.debug("the origin/destination lies along a flag stop route. fromTarget={}, vertex={}", fromTarget, initVertex);
v = initVertex;
}else{
v = rr.arriveBy ? s.getBackEdge().getToVertex() : s.getBackEdge().getFromVertex();
Expand All @@ -394,9 +390,12 @@ private TObjectDoubleMap<Vertex> streetSearch (RoutingRequest rr, boolean fromTa
TemporaryTransitStop flagTransitStop = new TemporaryTransitStop(graph, flagStop);
rr.rctx.temporaryVertices.add(flagTransitStop);

if (fromTarget) {
insertIntoTransitQueue(s, flagTransitStop);
}

if(rr.arriveBy) {
//reverse search
transitQueue.insert(flagTransitStop, s.getWeight());
TemporaryStreetTransitLink streetTransitLink = new TemporaryStreetTransitLink(flagTransitStop, (StreetVertex)v, true);
rr.rctx.temporaryEdges.add(streetTransitLink);

Expand Down Expand Up @@ -496,7 +495,15 @@ private TObjectDoubleMap<Vertex> streetSearch (RoutingRequest rr, boolean fromTa
LOG.debug("Heuristric street search hit {} transit stops.", transitQueue.size());
return vertices;
}


private void insertIntoTransitQueue(State s, Vertex v) {
double weight = s.getWeight();
transitQueue.insert(v, weight);
if (weight > maxWeightSeen) {
maxWeightSeen = weight;
}
}

/**
* Finds the closest coordinate along a line to the target, splices that point into the line, and returns
* a coordinate array containing either the partial array up to and including the target, or the target and all after
Expand Down

This file was deleted.

0 comments on commit 869b83c

Please sign in to comment.