コード例 #1
0
ファイル: ResultsPanel.java プロジェクト: huangwen87/mdrill
  /** Carries out a t-test using the current configuration. */
  protected void performTest() {

    String sigStr = m_SigTex.getText();
    if (sigStr.length() != 0) {
      m_TTester.setSignificanceLevel((new Double(sigStr)).doubleValue());
    } else {
      m_TTester.setSignificanceLevel(ExperimenterDefaults.getSignificance());
    }

    // Carry out the test chosen and biff the results to the output area
    m_TTester.setShowStdDevs(m_ShowStdDevs.isSelected());
    if (m_Instances.attribute(m_SortCombo.getSelectedItem().toString()) != null)
      m_TTester.setSortColumn(
          m_Instances.attribute(m_SortCombo.getSelectedItem().toString()).index());
    else m_TTester.setSortColumn(-1);
    int compareCol = m_CompareCombo.getSelectedIndex();
    int tType = m_TestsList.getSelectedIndex();

    String name =
        (new SimpleDateFormat("HH:mm:ss - ")).format(new Date())
            + (String) m_CompareCombo.getSelectedItem()
            + " - "
            + (String) m_TestsList.getSelectedValue();
    StringBuffer outBuff = new StringBuffer();
    outBuff.append(m_TTester.header(compareCol));
    outBuff.append("\n");
    m_History.addResult(name, outBuff);
    m_History.setSingle(name);
    m_TTester.setDisplayedResultsets(m_DisplayedList.getSelectedIndices());
    m_TTester.setResultMatrix(m_ResultMatrix);
    try {
      if (tType < m_TTester.getNumResultsets()) {
        outBuff.append(m_TTester.multiResultsetFull(tType, compareCol));
      } else if (tType == m_TTester.getNumResultsets()) {
        outBuff.append(m_TTester.multiResultsetSummary(compareCol));
      } else {
        outBuff.append(m_TTester.multiResultsetRanking(compareCol));
      }
      outBuff.append("\n");
    } catch (Exception ex) {
      outBuff.append(ex.getMessage() + "\n");
    }
    m_History.updateResult(name);
  }
コード例 #2
0
ファイル: ResultsPanel.java プロジェクト: huangwen87/mdrill
  /** Updates the test chooser with possible tests. */
  protected void setTTester() {

    // default is to display all columns
    m_TTester.setDisplayedResultsets(null);

    String name = (new SimpleDateFormat("HH:mm:ss - ")).format(new Date()) + "Available resultsets";
    StringBuffer outBuff = new StringBuffer();
    outBuff.append("Available resultsets\n" + m_TTester.resultsetKey() + "\n\n");
    m_History.addResult(name, outBuff);
    m_History.setSingle(name);

    m_TestsModel.removeAllElements();
    for (int i = 0; i < m_TTester.getNumResultsets(); i++) {
      String tname = m_TTester.getResultsetName(i);
      /*      if (tname.length() > 20) {
      tname = tname.substring(0, 20);
      } */
      m_TestsModel.addElement(tname);
    }

    m_DisplayedModel.removeAllElements();
    for (int i = 0; i < m_TestsModel.size(); i++)
      m_DisplayedModel.addElement(m_TestsModel.elementAt(i));

    m_TestsModel.addElement("Summary");
    m_TestsModel.addElement("Ranking");

    m_TestsList.setSelectedIndex(0);
    m_DisplayedList.setSelectionInterval(0, m_DisplayedModel.size() - 1);

    m_TestsButton.setEnabled(true);
    m_DisplayedButton.setEnabled(true);
    m_ShowStdDevs.setEnabled(true);
    m_OutputFormatButton.setEnabled(true);
    m_PerformBut.setEnabled(true);
  }