//a collection of helper functions to act as responses for otherwise //external calls in this implementation for demo purposes public class HelperFunctions { public double[] geocodingAPI(String inputAddress) { //simulates converting an input address into lat-long coordinates double[] coords = new double[2]; switch (inputAddress) { case "250 Community College Pkwy SE, Palm Bay, FL 32909": coords[0] = 27.993699393377653; coords[1] = -80.63006489971767; break; case "3865 N Wickham Rd, Melbourne, FL 32935": coords[0] = 28.17009584609403; coords[1] = -80.67083038806463; break; } double[] returnArray = coords; return returnArray; } public double[][] routingAPI(double[] startCoords, double[] destinationCoords, Boolean tollsFlag, Boolean hwyFlag) { //ideally this would return a series of coordinates, but for the sake of the demo it's just //going to concatenate the start and end into a 2x2 array with just those two steps //speed is also returned in MPH for the expected points as the third index in the array's second dimension double[][] routeArray = new double[2][3]; if (tollsFlag && hwyFlag) { //provides a result that both avoid tolls and major highways routeArray[0] = startCoords; routeArray[1] = destinationCoords; 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][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][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][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; } public int[] internalTempSensors() { int[] temps = {76, 74}; return temps; } public int externalTempSensors() { return 88; } }