Skip to content

Commit

Permalink
check at transit stops, not propagated to streets. disable dynamic ra…
Browse files Browse the repository at this point in the history
…nge-raptor
  • Loading branch information
abyrd committed Apr 21, 2015
1 parent 55cd58a commit b3261de
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
Expand Up @@ -4,15 +4,14 @@
import org.onebusaway.gtfs.model.AgencyAndId; import org.onebusaway.gtfs.model.AgencyAndId;
import org.onebusaway.gtfs.model.Stop; import org.onebusaway.gtfs.model.Stop;
import org.opentripplanner.analyst.SurfaceCache; import org.opentripplanner.analyst.SurfaceCache;
import org.opentripplanner.analyst.TimeSurface;
import org.opentripplanner.api.param.LatLon; import org.opentripplanner.api.param.LatLon;
import org.opentripplanner.api.parameter.QualifiedModeSet; import org.opentripplanner.api.parameter.QualifiedModeSet;
import org.opentripplanner.profile.ProfileRequest; import org.opentripplanner.profile.ProfileRequest;
import org.opentripplanner.profile.RepeatedRaptorProfileRouter; import org.opentripplanner.profile.RepeatedRaptorProfileRouter;
import org.opentripplanner.routing.core.TraverseModeSet; import org.opentripplanner.routing.core.TraverseModeSet;
import org.opentripplanner.routing.error.VertexNotFoundException; import org.opentripplanner.routing.error.VertexNotFoundException;
import org.opentripplanner.routing.graph.Graph; import org.opentripplanner.routing.graph.Graph;
import org.opentripplanner.routing.graph.Vertex; import org.opentripplanner.routing.vertextype.TransitStop;
import org.opentripplanner.standalone.OTPServer; import org.opentripplanner.standalone.OTPServer;
import org.opentripplanner.standalone.Router; import org.opentripplanner.standalone.Router;
import org.slf4j.Logger; import org.slf4j.Logger;
Expand Down Expand Up @@ -115,7 +114,7 @@ private void oneOrigin (double lat, double lon, AgencyAndId banRoute) {


System.out.printf("stop, min_a, min_b, min_diff, max_a, max_b, max_diff\n"); System.out.printf("stop, min_a, min_b, min_diff, max_a, max_b, max_diff\n");
boolean decreased = false; boolean decreased = false;
/*
for (TransitStop destVertex : graph.index.stopVertexForStop.values()) { for (TransitStop destVertex : graph.index.stopVertexForStop.values()) {
int min_a = router_a.mins.get(destVertex); int min_a = router_a.mins.get(destVertex);
int max_a = router_a.maxs.get(destVertex); int max_a = router_a.maxs.get(destVertex);
Expand Down Expand Up @@ -147,7 +146,8 @@ private void oneOrigin (double lat, double lon, AgencyAndId banRoute) {
LOG.error("Decreases happened at this origin!"); LOG.error("Decreases happened at this origin!");
} }
LOG.info("Stop Vertices: {} increased, {} decreased out of {} destinations total", n_increase, n_decrease, n_total); LOG.info("Stop Vertices: {} increased, {} decreased out of {} destinations total", n_increase, n_decrease, n_total);
*/
/*
// Now compare the propagated results // Now compare the propagated results
decreased = false; decreased = false;
TimeSurface.RangeSet timeSurfaces_a = router_a.timeSurfaceRangeSet; TimeSurface.RangeSet timeSurfaces_a = router_a.timeSurfaceRangeSet;
Expand Down Expand Up @@ -183,5 +183,6 @@ private void oneOrigin (double lat, double lon, AgencyAndId banRoute) {
if (decreased) { if (decreased) {
LOG.error("Decreases happened at this origin!"); LOG.error("Decreases happened at this origin!");
} }
*/
} }
} }
Expand Up @@ -98,14 +98,14 @@ public void route () {
LOG.info("Removed {} patterns.", n); LOG.info("Removed {} patterns.", n);
} }


/** Iterate over all minutes in the time window, running a RAPTOR search at each minute. */
for (int startTime = request.toTime - 60; startTime >= request.fromTime; startTime -= 60) {

// Create a state store which will be reused calling RAPTOR with each departure time in reverse order. // Create a state store which will be reused calling RAPTOR with each departure time in reverse order.
// This causes portions of the solution that do not change to be reused and should provide some speedup // This causes portions of the solution that do not change to be reused and should provide some speedup
// over naively creating a new, empty state store for each minute. // over naively creating a new, empty state store for each minute.
PathDiscardingRaptorStateStore rss = new PathDiscardingRaptorStateStore(MAX_TRANSFERS + 2); PathDiscardingRaptorStateStore rss = new PathDiscardingRaptorStateStore(MAX_TRANSFERS + 2);


/** Iterate over all minutes in the time window, running a RAPTOR search at each minute. */
for (int startTime = request.toTime - 60; startTime >= request.fromTime; startTime -= 60) {

// Log progress every thirty minutes (iterations) // Log progress every thirty minutes (iterations)
if (++i % 30 == 0) { if (++i % 30 == 0) {
LOG.info("Completed {} RAPTOR searches", i); LOG.info("Completed {} RAPTOR searches", i);
Expand Down Expand Up @@ -157,8 +157,8 @@ public void route () {
} }


// Disabled until we're sure transit routing works right // Disabled until we're sure transit routing works right
LOG.info("Profile request complete, propagating to the street network"); // LOG.info("Profile request complete, propagating to the street network");
makeSurfaces(); // makeSurfaces();


LOG.info("Profile request finished in {} seconds", (System.currentTimeMillis() - computationStartTime) / 1000.0); LOG.info("Profile request finished in {} seconds", (System.currentTimeMillis() - computationStartTime) / 1000.0);
} }
Expand Down

0 comments on commit b3261de

Please sign in to comment.