ResUtilTableModel rtm = resUtilTableModel;
HashMap<String, SimServer> serv = sim.getServerList();
HashMap<String, Resource> res = resAlloc.getResources();
simStatistics = sim.getRunStats();
SimRunStats rs = simStatistics.get(simStatistics.size() - 1);
double l_ = lambda / period;
stm.setValueAt(String.format("%.2f", rs.getProcCompTime()*l_), 0, 1);
stm.setValueAt(String.format("%.1f",lambda), 0, 2);
stm.setValueAt(String.format("%.2f", rs.getProcCompTime()), 0, 3);
stm.setValueAt(String.format("%.2f", rs.getProcCompTime()-rs.getProcWaitTime()), 0, 4);
stm.setValueAt(String.format("%.2f", rs.getProcWaitTime()), 0, 5);
for (int i = 1; i <= numServers; i++) {
String id = produceID((String) stm.getValueAt(i, 0));
SimServer s = serv.get(id);
try{
SimReportServerStats sst = (SimReportServerStats)rs.getServStats().get(s);
stm.setValueAt(String.format("%.2f", sst.getAvgQLength()+sst.getAvgResNumber()), i, 1);
stm.setValueAt(String.format("%.1f",lambda*(getUnfoldedSum(id)*l_)), i, 2);
stm.setValueAt(String.format("%.2f", sst.getAvgServTime()+sst.getAvgWaitTime()), i, 3);
stm.setValueAt(String.format("%.2f", sst.getAvgServTime()), i, 4);
stm.setValueAt(String.format("%.2f", sst.getAvgWaitTime()), i, 5);
}catch(Exception e){
stm.setValueAt("", i, 1);
stm.setValueAt("", i, 2);
stm.setValueAt("", i, 3);
stm.setValueAt("", i, 4);
stm.setValueAt("", i, 5);
}
}
for (int i = 0; i < resObjNum; i++) {
String name = (String) rtm.getValueAt(i, 0);
Resource r = res.get(name);
ResourceStats rst = rs.getResStats().get(r);
String util = String.format("%,.2f", rst.getUtilizationRatio()*100);
rtm.setValueAt(util, i, 1);
}