Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
TTC Subway/RT Travel Times
/* Stations on the Yonge/Spadina/Sheppard Subway Line */
static const char* stationNamesYongeSpadinaSheppard =
[
"Bayview", "Bessarion", "BloorYonge", "College", "Davisville", "DonMills",
"Downsview", "Dundas", "Dupont", "Eglinton", "EglintonWest", "Finch",
"Glencairn", "King", "Lawrence", "LawrenceWest", "Leslie", "Museum",
"NorthYorkCentre", "Osgoode", "Queen", "Queen'sPark", "Rosedale",
"SheppardYonge", "Spadina", "StAndrew", "StClair", "StClairWest",
"StGeorge", "StPatrick", "Summerhill", "Union", "Wellesley", "Wilson",
"YorkMills", "Yorkdale"
];
/* travelTimeYongeSpadinaSheppard[X][Y] is the time in minutes to travel from
* station X to station Y. Indexed by station name in alphabetical order.
*/
static const int travelTimeYongeSpadinaSheppard[][] =
{
{ 0, 2, 24, 26, 18, 6, 59, 28, 42, 16, 48, 11, 49, 30, 12, 51, 3, 38, 8, 34, 29, 36, 22, 3, 41, 33, 20, 44, 39, 35, 21, 31, 25, 55, 10, 53 },
{ 2, 0, 26, 28, 20, 4, 61, 30, 44, 18, 50, 13, 51, 32, 14, 53, 2, 40, 10, 36, 31, 38, 24, 5, 43, 35, 22, 46, 41, 37, 23, 33, 27, 57, 12, 55 },
{ 24, 26, 0, 2, 6, 29, 34, 3, 18, 8, 24, 21, 25, 6, 11, 27, 27, 13, 19, 10, 5, 12, 1, 17, 17, 9, 4, 20, 15, 11, 3, 7, 1, 31, 14, 29 },
{ 26, 28, 2, 0, 9, 31, 32, 1, 15, 11, 21, 23, 23, 3, 14, 24, 29, 11, 21, 7, 2, 9, 4, 19, 14, 6, 7, 17, 12, 8, 5, 5, 1, 29, 17, 26 },
{ 18, 20, 6, 9, 0, 23, 41, 10, 24, 2, 30, 15, 31, 12, 5, 33, 21, 20, 12, 16, 11, 18, 4, 11, 23, 15, 2, 26, 21, 17, 3, 13, 7, 37, 8, 35 },
{ 6, 4, 29, 31, 23, 0, 64, 33, 47, 21, 53, 16, 54, 35, 17, 56, 2, 43, 13, 39, 34, 41, 27, 8, 46, 38, 25, 49, 44, 40, 26, 36, 30, 60, 15, 58 },
{ 59, 61, 34, 32, 41, 64, 0, 31, 16, 43, 10, 56, 9, 28, 46, 7, 62, 21, 53, 25, 30, 22, 36, 52, 17, 26, 39, 14, 19, 23, 37, 27, 33, 3, 49, 5 },
{ 28, 30, 3, 1, 10, 33, 31, 0, 14, 12, 20, 25, 21, 2, 15, 23, 31, 10, 22, 6, 1, 8, 5, 21, 13, 5, 8, 16, 11, 7, 6, 3, 2, 27, 18, 25 },
{ 42, 44, 18, 15, 24, 47, 16, 14, 0, 26, 6, 39, 7, 12, 29, 9, 45, 4, 37, 8, 13, 6, 20, 35, 1, 9, 22, 2, 3, 7, 21, 11, 17, 13, 32, 11 },
{ 16, 18, 8, 11, 2, 21, 43, 12, 26, 0, 32, 13, 33, 14, 3, 35, 19, 22, 10, 18, 13, 20, 6, 9, 25, 17, 4, 28, 23, 19, 5, 15, 9, 39, 6, 37 },
{ 48, 50, 24, 21, 30, 53, 10, 20, 6, 32, 0, 45, 1, 18, 35, 3, 51, 10, 43, 14, 19, 11, 25, 41, 7, 15, 28, 3, 8, 13, 27, 16, 22, 7, 38, 5 },
{ 11, 13, 21, 23, 15, 16, 56, 25, 39, 13, 45, 0, 46, 27, 9, 48, 14, 35, 2, 31, 26, 33, 19, 4, 38, 30, 17, 41, 36, 32, 18, 28, 22, 52, 7, 50 },
{ 49, 51, 25, 23, 31, 54, 9, 21, 7, 33, 1, 46, 0, 19, 37, 1, 52, 11, 44, 15, 20, 13, 27, 42, 8, 16, 29, 5, 10, 14, 28, 18, 24, 6, 39, 3 },
{ 30, 32, 6, 3, 12, 35, 28, 2, 12, 14, 18, 27, 19, 0, 17, 21, 33, 7, 25, 4, 1, 6, 8, 23, 11, 3, 10, 14, 9, 5, 9, 1, 5, 25, 20, 23 },
{ 12, 14, 11, 14, 5, 17, 46, 15, 29, 3, 35, 9, 37, 17, 0, 38, 15, 25, 7, 21, 16, 23, 10, 5, 28, 20, 7, 31, 27, 22, 8, 19, 13, 43, 2, 40 },
{ 51, 53, 27, 24, 33, 56, 7, 23, 9, 35, 3, 48, 1, 21, 38, 0, 54, 13, 46, 17, 22, 15, 28, 44, 10, 18, 31, 7, 11, 16, 30, 19, 25, 4, 41, 2 },
{ 3, 2, 27, 29, 21, 2, 62, 31, 45, 19, 51, 14, 52, 33, 15, 54, 0, 41, 11, 37, 32, 39, 25, 6, 44, 36, 23, 47, 42, 38, 24, 34, 28, 58, 13, 56 },
{ 38, 40, 13, 11, 20, 43, 21, 10, 4, 22, 10, 35, 11, 7, 25, 13, 41, 0, 32, 4, 9, 1, 15, 31, 3, 5, 18, 6, 1, 2, 16, 6, 12, 17, 28, 15 },
{ 8, 10, 19, 21, 12, 13, 53, 22, 37, 10, 43, 2, 44, 25, 7, 46, 11, 32, 0, 29, 23, 31, 17, 1, 36, 27, 14, 39, 34, 30, 16, 26, 20, 50, 4, 48 },
{ 34, 36, 10, 7, 16, 39, 25, 6, 8, 18, 14, 31, 15, 4, 21, 17, 37, 4, 29, 0, 5, 2, 11, 27, 7, 1, 14, 10, 5, 1, 13, 2, 8, 21, 24, 19 },
{ 29, 31, 5, 2, 11, 34, 30, 1, 13, 13, 19, 26, 20, 1, 16, 22, 32, 9, 23, 5, 0, 7, 6, 22, 12, 4, 9, 15, 10, 6, 7, 2, 3, 26, 19, 24 },
{ 36, 38, 12, 9, 18, 41, 22, 8, 6, 20, 11, 33, 13, 6, 23, 15, 39, 1, 31, 2, 7, 0, 14, 29, 5, 3, 16, 8, 3, 1, 15, 5, 11, 19, 26, 17 },
{ 22, 24, 1, 4, 4, 27, 36, 5, 20, 6, 25, 19, 27, 8, 10, 28, 25, 15, 17, 11, 6, 14, 0, 15, 18, 10, 2, 22, 17, 12, 1, 9, 3, 33, 12, 31 },
{ 3, 5, 17, 19, 11, 8, 52, 21, 35, 9, 41, 4, 42, 23, 5, 44, 6, 31, 1, 27, 22, 29, 15, 0, 34, 26, 13, 37, 32, 28, 14, 24, 18, 48, 3, 46 },
{ 41, 43, 17, 14, 23, 46, 17, 13, 1, 25, 7, 38, 8, 11, 28, 10, 44, 3, 36, 7, 12, 5, 18, 34, 0, 8, 21, 3, 1, 6, 20, 9, 15, 14, 31, 12 },
{ 33, 35, 9, 6, 15, 38, 26, 5, 9, 17, 15, 30, 16, 3, 20, 18, 36, 5, 27, 1, 4, 3, 10, 26, 8, 0, 13, 11, 6, 2, 11, 1, 7, 22, 23, 20 },
{ 20, 22, 4, 7, 2, 25, 39, 8, 22, 4, 28, 17, 29, 10, 7, 31, 23, 18, 14, 14, 9, 16, 2, 13, 21, 13, 0, 24, 19, 15, 1, 11, 5, 35, 10, 33 },
{ 44, 46, 20, 17, 26, 49, 14, 16, 2, 28, 3, 41, 5, 14, 31, 7, 47, 6, 39, 10, 15, 8, 22, 37, 3, 11, 24, 0, 5, 9, 23, 13, 19, 11, 34, 9 },
{ 39, 41, 15, 12, 21, 44, 19, 11, 3, 23, 8, 36, 10, 9, 27, 11, 42, 1, 34, 5, 10, 3, 17, 32, 1, 6, 19, 5, 0, 4, 18, 8, 14, 16, 29, 14 },
{ 35, 37, 11, 8, 17, 40, 23, 7, 7, 19, 13, 32, 14, 5, 22, 16, 38, 2, 30, 1, 6, 1, 12, 28, 6, 2, 15, 9, 4, 0, 14, 3, 9, 20, 25, 18 },
{ 21, 23, 3, 5, 3, 26, 37, 6, 21, 5, 27, 18, 28, 9, 8, 30, 24, 16, 16, 13, 7, 15, 1, 14, 20, 11, 1, 23, 18, 14, 0, 10, 4, 34, 11, 32 },
{ 31, 33, 7, 5, 13, 36, 27, 3, 11, 15, 16, 28, 18, 1, 19, 19, 34, 6, 26, 2, 2, 5, 9, 24, 9, 1, 11, 13, 8, 3, 10, 0, 6, 24, 21, 21 },
{ 25, 27, 1, 1, 7, 30, 33, 2, 17, 9, 22, 22, 24, 5, 13, 25, 28, 12, 20, 8, 3, 11, 3, 18, 15, 7, 5, 19, 14, 9, 4, 6, 0, 30, 15, 28 },
{ 55, 57, 31, 29, 37, 60, 3, 27, 13, 39, 7, 52, 6, 25, 43, 4, 58, 17, 50, 21, 26, 19, 33, 48, 14, 22, 35, 11, 16, 20, 34, 24, 30, 0, 45, 2 },
{ 10, 12, 14, 17, 8, 15, 49, 18, 32, 6, 38, 7, 39, 20, 2, 41, 13, 28, 4, 24, 19, 26, 12, 3, 31, 23, 10, 34, 29, 25, 11, 21, 15, 45, 0, 43 },
{ 53, 55, 29, 26, 35, 58, 5, 25, 11, 37, 5, 50, 3, 23, 40, 2, 56, 15, 48, 19, 24, 17, 31, 46, 12, 20, 33, 9, 14, 18, 32, 21, 28, 2, 43, 0 },
};
static const char* stationNamesBloorDanforthScarboroughRT =
[
"Bathurst", "Bay", "BloorYonge", "Broadview", "CastleFrank", "Chester",
"Christie", "Coxwell", "Donlands", "Dufferin", "DundasWest", "Ellesmere",
"Greenwood", "HighPark", "Islington", "Jane", "Keele", "Kennedy", "Kipling",
"Lansdowne", "LawrenceEast", "MainStreet", "McCowan", "Midland", "OldMill",
"Ossington", "Pape", "RoyalYork", "Runnymede", "ScarboroughCentre", "Sherbourne",
"Spadina", "StGeorge", "VictoriaPark", "Warden", "Woodbine"
];
/* travelTimeBloorDanforthScarboroughRT[X][Y] is the time in minutes to travel from
* station X to station Y. Indexed by station name in alphabetical order.
*/
static const int travelTimeBloorDanforthScarboroughRT =
{
{ 0, 4, 5, 10, 8, 11, 1, 17, 14, 4, 6, 38, 15, 9, 17, 11, 8, 28, 20, 5, 35, 20, 42, 39, 13, 2, 12, 15, 10, 41, 7, 1, 2, 21, 24, 18 },
{ 4, 0, 1, 6, 4, 7, 5, 13, 10, 8, 10, 34, 11, 13, 21, 15, 12, 24, 24, 9, 31, 16, 38, 35, 17, 6, 8, 19, 14, 37, 3, 2, 1, 17, 20, 14 },
{ 5, 1, 0, 4, 3, 6, 6, 12, 8, 9, 11, 32, 10, 14, 23, 17, 13, 22, 26, 10, 29, 15, 36, 33, 18, 7, 7, 21, 15, 35, 1, 3, 2, 16, 19, 13 },
{ 10, 6, 4, 0, 1, 1, 11, 7, 4, 14, 16, 28, 5, 19, 27, 21, 18, 18, 30, 15, 25, 10, 32, 29, 23, 12, 2, 25, 20, 31, 3, 8, 7, 12, 14, 8 },
{ 8, 4, 3, 1, 0, 3, 9, 9, 5, 12, 14, 30, 7, 17, 26, 20, 16, 20, 29, 13, 27, 12, 34, 31, 21, 10, 4, 24, 18, 33, 1, 6, 5, 13, 16, 10 },
{ 11, 7, 6, 1, 3, 0, 12, 5, 2, 15, 18, 26, 4, 20, 29, 23, 19, 16, 32, 16, 23, 9, 30, 27, 24, 13, 1, 27, 21, 29, 4, 9, 8, 10, 13, 7 },
{ 1, 5, 6, 11, 9, 12, 0, 18, 15, 3, 5, 39, 16, 8, 16, 10, 7, 29, 19, 4, 36, 21, 43, 40, 12, 1, 13, 14, 9, 42, 8, 2, 3, 22, 25, 19 },
{ 17, 13, 12, 7, 9, 5, 18, 0, 3, 21, 23, 21, 2, 26, 34, 29, 25, 11, 37, 22, 18, 3, 25, 22, 30, 19, 4, 32, 27, 24, 10, 15, 14, 4, 7, 1 },
{ 14, 10, 8, 4, 5, 2, 15, 3, 0, 17, 20, 24, 1, 23, 31, 25, 21, 14, 34, 19, 21, 6, 28, 25, 27, 16, 1, 29, 24, 27, 7, 12, 11, 8, 10, 4 },
{ 4, 8, 9, 14, 12, 15, 3, 21, 17, 0, 2, 42, 19, 5, 14, 8, 4, 32, 16, 1, 39, 24, 46, 43, 9, 1, 16, 11, 6, 45, 10, 5, 6, 25, 28, 22 },
{ 6, 10, 11, 16, 14, 18, 5, 23, 20, 2, 0, 44, 21, 2, 11, 5, 1, 34, 14, 1, 41, 26, 48, 45, 7, 4, 19, 9, 4, 47, 13, 8, 9, 28, 31, 25 },
{ 38, 34, 32, 28, 30, 26, 39, 21, 24, 42, 44, 0, 23, 47, 55, 49, 46, 6, 58, 43, 2, 18, 4, 1, 51, 40, 25, 53, 48, 3, 31, 36, 35, 16, 13, 19 },
{ 15, 11, 10, 5, 7, 4, 16, 2, 1, 19, 21, 23, 0, 25, 32, 27, 23, 13, 35, 20, 20, 5, 27, 24, 28, 17, 2, 30, 25, 26, 8, 13, 12, 6, 9, 3 },
{ 9, 13, 14, 19, 17, 20, 8, 26, 23, 5, 2, 47, 25, 0, 8, 2, 1, 37, 11, 4, 44, 29, 51, 48, 4, 6, 21, 6, 1, 50, 16, 11, 12, 31, 33, 27 },
{ 17, 21, 23, 27, 26, 29, 16, 34, 31, 14, 11, 55, 32, 8, 0, 6, 9, 45, 3, 12, 52, 37, 59, 56, 4, 15, 30, 2, 7, 58, 24, 19, 20, 39, 42, 36 },
{ 11, 15, 17, 21, 20, 23, 10, 29, 25, 8, 5, 49, 27, 2, 6, 0, 4, 39, 9, 6, 46, 31, 53, 50, 1, 9, 24, 4, 1, 52, 18, 13, 14, 33, 36, 30 },
{ 8, 12, 13, 18, 16, 19, 7, 25, 21, 4, 1, 46, 23, 1, 9, 4, 0, 36, 12, 3, 43, 28, 50, 47, 5, 5, 20, 7, 2, 49, 15, 9, 10, 29, 32, 26 },
{ 28, 24, 22, 18, 20, 16, 29, 11, 14, 32, 34, 6, 13, 37, 45, 39, 36, 0, 48, 33, 3, 8, 10, 7, 41, 30, 15, 43, 38, 9, 21, 26, 25, 6, 3, 9 },
{ 20, 24, 26, 30, 29, 32, 19, 37, 34, 16, 14, 58, 35, 11, 3, 9, 12, 48, 0, 15, 55, 40, 62, 59, 7, 18, 33, 5, 10, 61, 27, 22, 23, 42, 45, 39 },
{ 5, 9, 10, 15, 13, 16, 4, 22, 19, 1, 1, 43, 20, 4, 12, 6, 3, 33, 15, 0, 40, 25, 47, 44, 8, 2, 17, 10, 5, 46, 12, 6, 7, 26, 29, 23 },
{ 35, 31, 29, 25, 27, 23, 36, 18, 21, 39, 41, 2, 20, 44, 52, 46, 43, 3, 55, 40, 0, 15, 7, 4, 48, 37, 22, 50, 45, 5, 28, 33, 32, 13, 10, 16 },
{ 20, 16, 15, 10, 12, 9, 21, 3, 6, 24, 26, 18, 5, 29, 37, 31, 28, 8, 40, 25, 15, 0, 22, 19, 33, 22, 7, 35, 30, 21, 13, 18, 17, 1, 4, 1 },
{ 42, 38, 36, 32, 34, 30, 43, 25, 28, 46, 48, 4, 27, 51, 59, 53, 50, 10, 62, 47, 7, 22, 0, 3, 55, 44, 29, 57, 52, 1, 35, 40, 39, 20, 17, 23 },
{ 39, 35, 33, 29, 31, 27, 40, 22, 25, 43, 45, 1, 24, 48, 56, 50, 47, 7, 59, 44, 4, 19, 3, 0, 52, 41, 26, 54, 49, 1, 32, 37, 36, 17, 14, 20 },
{ 13, 17, 18, 23, 21, 24, 12, 30, 27, 9, 7, 51, 28, 4, 4, 1, 5, 41, 7, 8, 48, 33, 55, 52, 0, 11, 26, 2, 3, 54, 20, 15, 16, 34, 37, 31 },
{ 2, 6, 7, 12, 10, 13, 1, 19, 16, 1, 4, 40, 17, 6, 15, 9, 5, 30, 18, 2, 37, 22, 44, 41, 11, 0, 15, 13, 8, 43, 9, 4, 5, 24, 27, 21 },
{ 12, 8, 7, 2, 4, 1, 13, 4, 1, 16, 19, 25, 2, 21, 30, 24, 20, 15, 33, 17, 22, 7, 29, 26, 26, 15, 0, 28, 23, 28, 5, 11, 10, 9, 12, 6 },
{ 15, 19, 21, 25, 24, 27, 14, 32, 29, 11, 9, 53, 30, 6, 2, 4, 7, 43, 5, 10, 50, 35, 57, 54, 2, 13, 28, 0, 5, 56, 22, 17, 18, 37, 40, 34 },
{ 10, 14, 15, 20, 18, 21, 9, 27, 24, 6, 4, 48, 25, 1, 7, 1, 2, 38, 10, 5, 45, 30, 52, 49, 3, 8, 23, 5, 0, 51, 17, 12, 13, 32, 35, 29 },
{ 41, 37, 35, 31, 33, 29, 42, 24, 27, 45, 47, 3, 26, 50, 58, 52, 49, 9, 61, 46, 5, 21, 1, 1, 54, 43, 28, 56, 51, 0, 34, 39, 38, 19, 16, 22 },
{ 7, 3, 1, 3, 1, 4, 8, 10, 7, 10, 13, 31, 8, 16, 24, 18, 15, 21, 27, 12, 28, 13, 35, 32, 20, 9, 5, 22, 17, 34, 0, 5, 4, 14, 17, 11 },
{ 1, 2, 3, 8, 6, 9, 2, 15, 12, 5, 8, 36, 13, 11, 19, 13, 9, 26, 22, 6, 33, 18, 40, 37, 15, 4, 11, 17, 12, 39, 5, 0, 1, 20, 23, 17 },
{ 2, 1, 2, 7, 5, 8, 3, 14, 11, 6, 9, 35, 12, 12, 20, 14, 10, 25, 23, 7, 32, 17, 39, 36, 16, 5, 10, 18, 13, 38, 4, 1, 0, 19, 21, 16 },
{ 21, 17, 16, 12, 13, 10, 22, 4, 8, 25, 28, 16, 6, 31, 39, 33, 29, 6, 42, 26, 13, 1, 20, 17, 34, 24, 9, 37, 32, 19, 14, 20, 19, 0, 2, 3 },
{ 24, 20, 19, 14, 16, 13, 25, 7, 10, 28, 31, 13, 9, 33, 42, 36, 32, 3, 45, 29, 10, 4, 17, 14, 37, 27, 12, 40, 35, 16, 17, 23, 21, 2, 0, 6 },
{ 18, 14, 13, 8, 10, 7, 19, 1, 4, 22, 25, 19, 3, 27, 36, 30, 26, 9, 39, 23, 16, 1, 23, 20, 31, 21, 6, 34, 29, 22, 11, 17, 16, 3, 6, 0 },
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.