Package businesslogic

Examples of businesslogic.CentralityEntity


        //RInterface initialisieren
        //-----------------------------------------------
        m_rinterface = new RInterface(true);
        //-----------------------------------------------
       
        CentralityEntity t_ce = m_centralities.get(t_selection);
       
        try {
          m_rinterface.keyActorPlot(t_ce);
        } catch (Exception e1) {
          // TODO Auto-generated catch block
          e1.printStackTrace();
        }
      }
     

     
     
    }
    if(e.getActionCommand() == "b_start")
      { 
        int add_months = Integer.parseInt(((Row)cb_interval.getSelectedItem()).getId());
        long projectid = Long.parseLong(((Row)cb_choose_project.getSelectedItem()).getId());
       
        List <DateTime>l_dates = new ArrayList<DateTime>();
       
        //Fixed start and enddate with given interval
        if(chb_fix_date.isSelected() == true)
        {
         
          DateTime startdate = null, enddate = null;
 
          try {
            startdate = new DateTime(df.parse(t_begin_date.getText()));
            enddate = new DateTime(df.parse(t_end_date.getText()));
          } catch (ParseException e1) {
            JOptionPane.showMessageDialog(null, "Please check dates!", "Warning", JOptionPane.OK_OPTION);
            e1.printStackTrace();
            return;
          }
         
          while (startdate.isBefore(enddate))
          {
            l_dates.add(startdate);
            startdate = startdate.plusMonths(add_months);
          }
         
          l_dates.add(enddate);
        }
       
        //List with dates
        else if (chb_custom_date.isSelected() == true)
        {
            // Get number of items in the list
            int size = lb_dates.getModel().getSize();
           
            // Get all item objects
            for (int i=0; i<size; i++) {
                try {
              l_dates.add(new DateTime(df.parse((String)lb_dates.getModel().getElementAt(i))));
            } catch (ParseException e1) {
              // TODO Auto-generated catch block
              e1.printStackTrace();
            }
               
            }
        }
       
       
        //Calculate measures with given dates
        for(int i = 0; i < l_dates.size()-1; i++)
        {
          DateTime begin = l_dates.get(i);
          DateTime end = null;
          CentralityEntity l_ce = null;
         
         
          if (i == l_dates.size()-2)
            end = l_dates.get(i+1);
          else
            end = l_dates.get(i+1).minusDays(1);
         
          //Matchingtable is relevant to map ID's of vertices beginning with 0 and should be the same for analysis over period of time
//          if(m_matchingtable == null)
//          {
//            m_matchingtable = new Hashtable<Double, Double>();
//            l_ce = new CentralityEntity(begin, end, Long.parseLong(((Row)cb_choose_project.getSelectedItem()).getId()), m_keepmatrices, m_matchingtable);
//          }
//
//          else
          l_ce = new CentralityEntity(begin, end, Long.parseLong(((Row)cb_choose_project.getSelectedItem()).getId()), m_keepmatrices);
         
           //Bug Report List
          if(chb_scr_bugreports.isSelected() == true)
            l_ce.fillMatrixBugReports();
         
          //Forum
//          if(chb_src_forum.isSelected() == true)
//            l_ce.fillMatrixForum();
         
          //Sourceforge Checkins
          if(chb_scr_sourcforgecheckins.isSelected() == true)
            l_ce.fillMatrixSFCheckins();
         
          //RInterface initialisieren
          //-----------------------------------------------
          m_rinterface = new RInterface();
          //-----------------------------------------------
         
         
          //Calculate Centrality
          if(l_ce.calculateCentrality() == true)
          {
            m_centralities.add(l_ce);
           
          }
        }
       
       
        //prepare result panel
        main_panel.remove(getcurrentPanel());
        m_position = 4;
        get_b_back().setEnabled(false);
        get_b_next().setEnabled(false);
        get_l_step().setText(String.valueOf(projectid) + " " + ((Row)cb_choose_project.getSelectedItem()).getVal());
        main_panel.remove(l_title);
       
       
        Object [][] t_reselem = new Object[m_centralities.size()][5];
       
        for(int i = 0; i < m_centralities.size(); i++)
        {
          CentralityEntity t_ce = m_centralities.get(i);
          t_reselem[i][0] = df.format(t_ce.getM_begin().toDate());
          t_reselem[i][1] = df.format(t_ce.getM_end().toDate());
          t_reselem[i][2] = t_ce.getM_closeness();
          t_reselem[i][3] = t_ce.getM_betweenness();
          t_reselem[i][4] = t_ce.getM_degree();
        }
       
       
        t_resulttable = new JTable (new ResultTableModel(t_reselem));
        t_resulttable.getSelectionModel().setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
View Full Code Here


   
    out.write(df.format(today) + " - Generating measures for " + ((Row)cb_choose_project.getSelectedItem()).getVal() + "Projid: " + ((Row)cb_choose_project.getSelectedItem()).getId() + "\n");
   
    for(int i = 0; i < m_centralities.size(); i++)
    {
      CentralityEntity t_ce = m_centralities.get(i);
      out.write("Start: " + df.format(t_ce.getM_begin().toDate()) + " End: " + df.format(t_ce.getM_end().toDate()) + "\n closeness: " +  t_ce.getM_closeness() +
      " betweenness: " + t_ce.getM_betweenness() + " degree: " + t_ce.getM_degree() + "\n");
     
      out.write("\n\nActorcentrality:\n-------------\n\t");
      Hashtable<Double,Double> mappingt = t_ce.getM_mappingtable();
      Hashtable<Double,Double> mappingtgesp = new Hashtable<Double, Double>();
     
      double[]actordegree = t_ce.getM_actordegree();
      double[]actorcloseness = t_ce.getM_actorcloseness();
      double[]actorbetweenness = t_ce.getM_actorbetweenness();
     
      Enumeration e = mappingt.keys();
     
     
      while(e.hasMoreElements())
View Full Code Here

TOP

Related Classes of businesslogic.CentralityEntity

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.