Skip to content

Commit

Permalink
record in the Graph object whether it has frequency or scheduled serv…
Browse files Browse the repository at this point in the history
…ices

this should allow choosing the correct profile routing techniques
  • Loading branch information
abyrd committed Jan 28, 2015
1 parent 6ff957a commit d55b42c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,8 @@ public void run(Graph graph) {

} // end foreach TRIP
LOG.info("Added {} frequency-based and {} single-trip timetable entries.", freqCount, nonFreqCount);
graph.hasFrequencyService = graph.hasFrequencyService || freqCount > 0;
graph.hasScheduledService = graph.hasScheduledService || nonFreqCount > 0;

/* Generate unique human-readable names for all the TableTripPatterns. */
TripPattern.generateUniqueNames(tripPatterns.values());
Expand Down
6 changes: 6 additions & 0 deletions src/main/java/org/opentripplanner/routing/graph/Graph.java
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,12 @@ public class Graph implements Serializable {
/** True if direct single-edge transfers were generated between transit stops in this Graph. */
public boolean hasDirectTransfers = false;

/** True if frequency-based services exist in this Graph (GTFS frequencies with exact_times = 0). */
public boolean hasFrequencyService = false;

/** True if schedule-based services exist in this Graph (including GTFS frequencies with exact_times = 1). */
public boolean hasScheduledService = false;

public Graph(Graph basedOn) {
this();
this.bundle = basedOn.getBundle();
Expand Down

0 comments on commit d55b42c

Please sign in to comment.