Package org.woped.quantana.model

Examples of org.woped.quantana.model.ResUtilTableModel


      for (int i = 0; i < resObjNum; i++) {
        resUtilTableMatrix[i][0] = ((Resource) resObjNames[i])
            .getName();
      }

      resUtilTableModel = new ResUtilTableModel(colResUtil,
          resUtilTableMatrix);
      resUtilTableModel.addTableModelListener(new TableModelListener() {
        public void tableChanged(TableModelEvent e) {
        }
      });
View Full Code Here


  public void updContents() {
   
    
    ServerTableModel stm = serverTableModel;
    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);
    }
   
    if(ptk.isSelected()){
      // write the log into the text editor
      for (int i = 0; i < getSimulator().getLog().size(); i++) {
View Full Code Here

TOP

Related Classes of org.woped.quantana.model.ResUtilTableModel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.