public static void writeArrayToFile(double[] array, String fileName, String headerLine) { double matrix[][] = new double[array.length][1]; for (int i = 0; i < array.length; i++) { matrix[i][0] = array[i]; } GeneralLib.writeMatrix(matrix, fileName, headerLine); }
public static void writeHashMapToFile(HashMap hm, String headerLine, String fileName) { ArrayList<String> list = new ArrayList<String>(); list.add(headerLine); for (Object key : hm.keySet()) { StringBuffer stringBuffer = new StringBuffer(); stringBuffer.append(key.toString()); stringBuffer.append("\t"); stringBuffer.append(hm.get(key).toString()); list.add(stringBuffer.toString()); } GeneralLib.writeList(list, fileName); }
public static int getTimeBinIndex(double time, double binSizeInSeconds) { time = GeneralLib.projectTimeWithin24Hours(time); return Math.round((float) Math.floor(time / binSizeInSeconds)); }
public static double getDistance(Coord coord, Link link) { return GeneralLib.getDistance(coord, link.getCoord()); }