@Override public double getUtilization(double time) { if (getHistory().containsKey(time)) { return getHistory().get(time); } double utilization = getRandomGenerator().nextDouble(); getHistory().put(time, utilization); return utilization; }
/** * Save the utilization history to a file. * * @param filename the filename * @throws Exception the exception */ public void saveHistory(String filename) throws Exception { FileOutputStream fos = new FileOutputStream(filename); ObjectOutputStream oos = new ObjectOutputStream(fos); oos.writeObject(getHistory()); oos.close(); }