Package org.woped.quantana.model

Examples of org.woped.quantana.model.ServerTableModel


      for (int i = 1; i <= numServers; i++) {
        serverTableMatrix[i][0] = servNames[i-1];
      }

      serverTableModel = new ServerTableModel(colServers,
          serverTableMatrix);
      serverTableModel.addTableModelListener(new TableModelListener() {
        public void tableChanged(TableModelEvent e) {
        }
      });
View Full Code Here


    lambda = Double.parseDouble(txtLambda.getText());
    periodIndex = cboTimeUnits.getSelectedIndex();
    period = tm.cv(periodIndex, Double.parseDouble(txtPeriod.getText()));
   
    if (serverTableModel.getValueAt(0, 2) != null){
      ServerTableModel stm = serverTableModel;
     
      for (int i = 0; i < stm.getRowCount(); i++){
        try{
        double val;
        for(int k=2;k<5;k++){
          Object o = stm.getValueAt(i, k);
          if (o instanceof String)
            val = Double.parseDouble(((String)o));
          else
            val = ((Double)o).doubleValue();
          val = tm.cv(timeUnit, val);
          stm.setValueAt(val, i, k);
        }       
        }catch(Exception 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);
View Full Code Here

TOP

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

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.