public void writeOutParkingOccupancySumPng(Controler controler, int iteration) { String fileName = controler .getControlerIO() .getIterationFilename(iteration, "parkingOccupancyAllParking.png"); double matrix[][] = new double[96][1]; String title = "parked vehicles at all parkings in the simulation"; String xLabel = "time"; String yLabel = "number of vehicles parked"; String[] seriesLabels = {"all parking occupancy"}; double[] xValues = new double[96]; for (int i = 0; i < 96; i++) { xValues[i] = i * 0.25; } for (Id parkingFacilityId : parkingOccupancies.keySet()) { int[] occupancy = parkingOccupancies.get(parkingFacilityId).getOccupancy(); for (int i = 0; i < 96; i++) { matrix[i][0] += occupancy[i]; } } GeneralLib.writeGraphic(fileName, matrix, title, xLabel, yLabel, seriesLabels, xValues); }
/** * energyUsageStatistics[number of values][number of functions] * * @param fileName * @param matrix * @param title * @param xLabel * @param yLabel */ public static void writeHubGraphic( String fileName, double[][] matrix, String title, String xLabel, String yLabel) { int numberOfXValues = matrix.length; int numberOfFunctions = matrix[0].length; String[] seriesLabels = new String[numberOfFunctions]; double[] time = new double[numberOfXValues]; for (int i = 0; i < numberOfXValues; i++) { time[i] = i * 900; } for (int i = 0; i < numberOfFunctions; i++) { seriesLabels[i] = "hub-" + i; } writeGraphic(fileName, matrix, title, xLabel, yLabel, seriesLabels, time); }