changed routingAPI to return variable speed/tolls

This commit is contained in:
Fennel Kora 2024-04-13 18:41:44 -04:00
parent 9a9fd30554
commit 27d69cecd5

View file

@ -26,23 +26,25 @@ public class HelperFunctions {
if (tollsFlag && hwyFlag) { //provides a result that both avoid tolls and major highways
routeArray[0] = startCoords;
routeArray[1] = destinationCoords;
routeArray[0][2] = 45;
routeArray[1][2] = 45;
routeArray[0][2] = 45; //avg speed leg 1
routeArray[0][3] = 0; //tolls leg 1
routeArray[1][2] = 45; //avg speed leg 2
routeArray[1][3] = 0; //tolls leg 2
} else if (tollsFlag && !hwyFlag) { //provides a result that avoids tolls but not major highways
routeArray[0] = startCoords;
routeArray[1] = destinationCoords;
routeArray[0][2] = 45;
routeArray[1][2] = 45;
routeArray[0][2] = 60; //avg speed leg 1
routeArray[0][3] = 0; //tolls leg 1
routeArray[1][2] = 45; //avg speed leg 2
routeArray[1][3] = 0; //tolls leg 2
} else if (!tollsFlag && hwyFlag) { //provides a result that does not avoid tolls and does avoid major highways
routeArray[0] = startCoords;
routeArray[1] = destinationCoords;
routeArray[0][2] = 45;
routeArray[1][2] = 45;
routeArray[0][2] = 45; //avg speed leg 1
routeArray[0][3] = 1.50; //tolls leg 1
routeArray[1][2] = 45; //avg speed leg 2
routeArray[1][3] = 0; //tolls leg 2
} else if (!tollsFlag && !hwyFlag) { //provides a result that does not avoid tolls or major highways
routeArray[0] = startCoords;
routeArray[1] = destinationCoords;
routeArray[0][2] = 45;
routeArray[1][2] = 45;
routeArray[0][2] = 60; //avg speed leg 1
routeArray[0][3] = 1.50; //tolls leg 1
routeArray[1][2] = 45; //avg speed leg 2
routeArray[1][3] = 0; //tolls leg 2
}
return routeArray;
}