Skip to content

Commit

Permalink
rm start_time & is_start params from trace_one_transfer for #88
Browse files Browse the repository at this point in the history
Those parameters aren't needed; the solution is to entirely prevent initial transfers
  • Loading branch information
mpadge committed Aug 17, 2022
1 parent 83f178d commit 2cfafab
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 35 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: gtfsrouter
Title: Routing with GTFS (General Transit Feed Specification) Data
Version: 0.0.5.094
Version: 0.0.5.095
Authors@R: c(
person("Mark", "Padgham", , "[email protected]", role = c("aut", "cre")),
person("Marcin", "Stepniak", , "[email protected]", role = "aut",
Expand Down
2 changes: 1 addition & 1 deletion codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"codeRepository": "https://github.com/ATFutures/gtfs-router",
"issueTracker": "https://github.com/ATFutures/gtfs-router/issues",
"license": "https://spdx.org/licenses/GPL-3.0",
"version": "0.0.5.094",
"version": "0.0.5.095",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "R",
Expand Down
34 changes: 1 addition & 33 deletions src/traveltimes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ void iso::trace_forward_iso (
trans_dest,
trans_duration,
minimise_transfers,
start_time,
false, // !is_start
iso);
}

Expand Down Expand Up @@ -287,28 +285,6 @@ void iso::trace_forward_traveltimes (
for (size_t a: arrival_station)
stations.emplace (std::make_pair (a, false));

// Fill initial transfers from start station:
for (auto s: start_stations_set)
{
for (auto t: transfer_map.at (s))
{
const size_t trans_dest = t.first;
const int trans_duration = t.second;

iso::fill_one_transfer (
INFINITE_INT, // departure_station param
s, // arrival_station param
start_time_min, // arrival_time param
trans_dest,
trans_duration,
minimise_transfers,
start_time_min,
true, // is_start
iso);

} // end for t over transfer map
} // end for s over start_stations_set

for (size_t i = 0; i < nrows; i++)
{
if (departure_time [i] < start_time_min)
Expand Down Expand Up @@ -352,8 +328,6 @@ void iso::trace_forward_traveltimes (
trans_dest,
trans_duration,
minimise_transfers,
start_time_min,
false, // !is_start
iso);

if (stations.find (trans_dest) !=
Expand Down Expand Up @@ -385,8 +359,6 @@ void iso::fill_one_transfer (
const size_t &trans_dest,
const int &trans_duration,
const bool &minimise_transfers,
const int &start_time,
const bool &is_start,
Iso &iso)
{
const int trans_time = arrival_time + trans_duration;
Expand All @@ -400,7 +372,7 @@ void iso::fill_one_transfer (
insert_transfer = iso::is_transfer_in_isochrone (
iso, arrival_station, trans_time);

if (!insert_transfer && !is_start)
if (!insert_transfer)
return;

if (iso.earliest_departure [trans_dest] == INFINITE_INT ||
Expand Down Expand Up @@ -445,10 +417,6 @@ void iso::fill_one_transfer (
}

iso.connections [trans_dest].convec [s].ntransfers = ntransfers + 1;
if (is_start)
{
latest_initial = start_time;
}
iso.connections [trans_dest].convec [s].initial_depart = latest_initial;

DEBUGMSGTR("---TR: (" << arrival_station << " -> " <<
Expand Down

0 comments on commit 2cfafab

Please sign in to comment.