Skip to content

Commit 69e5406

Browse files
committed
count implicit traveltime transfers from same stop_id; fixes #88
1 parent 48eb2df commit 69e5406

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: gtfsrouter
22
Title: Routing with GTFS (General Transit Feed Specification) Data
3-
Version: 0.0.5.090
3+
Version: 0.0.5.091
44
Authors@R: c(
55
person("Mark", "Padgham", , "[email protected]", role = c("aut", "cre")),
66
person("Marcin", "Stepniak", , "[email protected]", role = "aut",

codemeta.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"codeRepository": "https://github.com/ATFutures/gtfs-router",
88
"issueTracker": "https://github.com/ATFutures/gtfs-router/issues",
99
"license": "https://spdx.org/licenses/GPL-3.0",
10-
"version": "0.0.5.090",
10+
"version": "0.0.5.091",
1111
"programmingLanguage": {
1212
"@type": "ComputerLanguage",
1313
"name": "R",

src/traveltimes.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,10 @@ bool iso::fill_one_iso (
9393
Iso &iso) {
9494

9595
bool fill_vals = false, is_end_stn = false, same_trip = false;
96+
bool is_transfer = false;
97+
// is_transfer is used to increment "implicit" transfers to different
98+
// services from same stop_id, which do not otherwise appear as transfers.
99+
96100
int prev_trip = -1L; // int to allow -1L flag
97101
int ntransfers = INFINITE_INT;
98102
int latest_initial = -1L;
@@ -192,6 +196,7 @@ bool iso::fill_one_iso (
192196
latest_initial = st.initial_depart;
193197
prev_trip = static_cast <int> (st.trip);
194198
ntransfers = st.ntransfers;
199+
is_transfer = st.is_transfer;
195200
}
196201
}
197202

@@ -246,6 +251,13 @@ bool iso::fill_one_iso (
246251
iso.earliest_departure [arrival_station] = departure_time;
247252
} else
248253
{
254+
if (!same_trip && !is_transfer)
255+
{
256+
// connections flagged with 'is_transfer' have already had transfers
257+
// incremented; this increments only "implicit" transfers from same
258+
// stop_id to different service (trip_id)
259+
ntransfers++;
260+
}
249261
iso.connections [arrival_station].convec [s].ntransfers = ntransfers;
250262
iso.connections [arrival_station].convec [s].initial_depart = latest_initial;
251263
}

0 commit comments

Comments
 (0)