/**
   * @param logs
   * @param firstOrg
   * @param secondOrg
   * @return
   */
  private ProMTable additionalDependencyTableCreator(
      OrganizationalLogs logs, int firstOrg, int secondOrg) {

    List<DifferentDependencyUnit> ddus =
        logs.mismatchPatterns.getDifferentDependencies(firstOrg, secondOrg);

    String[][] data = new String[ddus.size()][3];

    int i = 0;
    for (DifferentDependencyUnit ddu : ddus) {
      if (ddu.additionalDependencyFlag) {
        data[i][0] = ddu.dependencyUnit_1.activityName;
        data[i][1] = Arrays.toString(ddu.dependencyUnit_1.previousActivities.toArray());
        data[i][2] = Arrays.toString(ddu.dependencyUnit_2.previousActivities.toArray());
        i++;
      }
    }
    if (data.length == 0) return null;

    DefaultTableModel tbModel =
        new NonEditableModel(
            data, new String[] {"Activity", "Dependency Set (Selected)", "Dependency Set (Other)"});
    ProMTable table = new ProMTable(tbModel);
    return table;
  }
Ejemplo n.º 2
0
  @Override
  public void update(final ModelEvent event) {

    super.update(event);

    if (event.part == ModelPart.SELECTED_NODE) {
      if (model.getSelectedNode() != null) {
        toolbar.setRedraw(false);
        labelSelected.setText(
            Resources.getMessage("MainToolBar.3")
                + //$NON-NLS-1$
                Arrays.toString(model.getSelectedNode().getTransformation()));
        labelSelected.pack();
        layout();
        toolbar.setRedraw(true);
      }
    } else if (event.part == ModelPart.OUTPUT) {
      if (model.getOutputNode() != null) {

        // Update tool tip
        SearchSpaceStatistics stats = new SearchSpaceStatistics(model.getResult());
        setToolTip(stats);

        // Update labels
        toolbar.setRedraw(false);
        labelTransformations.setText(
            Resources.getMessage("MainToolBar.6")
                + //$NON-NLS-1$
                SWTUtil.getPrettyString(stats.numTransformationsInSearchSpace));
        labelTransformations.pack();

        labelApplied.setText(
            Resources.getMessage("MainToolBar.4")
                + //$NON-NLS-1$
                Arrays.toString(model.getOutputNode().getTransformation()));
        labelApplied.pack();

        layout();

        toolbar.setRedraw(true);
      } else {
        reset();
      }
    } else if (event.part == ModelPart.RESULT) {
      if (model.getResult() != null) {

        // Update tool tip
        SearchSpaceStatistics stats = new SearchSpaceStatistics(model.getResult());
        setToolTip(stats);

        // Update labels
        toolbar.setRedraw(false);
        labelTransformations.setText(
            Resources.getMessage("MainToolBar.6")
                + //$NON-NLS-1$
                SWTUtil.getPrettyString(stats.numTransformationsInSearchSpace));
        labelTransformations.pack();

        labelSelected.setText(Resources.getMessage("MainToolBar.7")); // $NON-NLS-1$
        labelSelected.pack();

        labelApplied.setText(Resources.getMessage("MainToolBar.8")); // $NON-NLS-1$
        labelApplied.pack();

        layout();

        toolbar.setRedraw(true);
      }
    } else if (event.part == ModelPart.SELECTED_ATTRIBUTE) {
      String attribute = (String) event.data;

      // Update label
      toolbar.setRedraw(false);
      labelAttribute.setText(
          Resources.getMessage("MainToolBar.50") + trim(attribute)); // $NON-NLS-1$
      labelAttribute.pack();
      layout();
      toolbar.setRedraw(true);
    } else if (event.part == ModelPart.MODEL) {
      model = (Model) event.data;
    }
  }
Ejemplo n.º 3
0
    @Override
    public String toString() {

      // Prepare
      double prunedPercentage =
          (double) this.numTransformationsPruned
              / (double) this.numMaterializedTransformations
              * 100d;

      double materializedPercentage =
          (double) this.numMaterializedTransformations
              / (double) this.numTransformationsInSearchSpace
              * 100d;

      // Render statistics about the solution space
      StringBuilder sb = new StringBuilder();
      sb.append(Resources.getMessage("MainToolBar.1")); // $NON-NLS-1$
      sb.append(Resources.getMessage("MainToolBar.2")) // $NON-NLS-1$
          .append(this.numTransformationsInSearchSpace)
          .append("\n"); // $NON-NLS-1$

      sb.append(Resources.getMessage("MainToolBar.41")) // $NON-NLS-1$
          .append(this.numMaterializedTransformations);
      sb.append(" [") // $NON-NLS-1$
          .append(SWTUtil.getPrettyString(materializedPercentage))
          .append("%]\n"); // $NON-NLS-1$

      sb.append(Resources.getMessage("MainToolBar.12")) // $NON-NLS-1$
          .append(this.numTransformationsPruned);
      sb.append(" [") // $NON-NLS-1$
          .append(SWTUtil.getPrettyString(prunedPercentage))
          .append("%]\n"); // $NON-NLS-1$

      sb.append(Resources.getMessage("MainToolBar.18")) // $NON-NLS-1$
          .append(SWTUtil.getPrettyString(this.executionTime))
          .append("s\n"); // $NON-NLS-1$

      if (this.numTransformationsAnonymous != 0
          || this.numTransformationsNotAnonymous != 0
          || this.numTransformationsProbablyAnonymous != 0
          || this.numTransformationsProbablyNotAnonymous != 0
          || this.numTransformationsAnonymityUnknown != 0
          || this.numTransformationsInfolossAvailable != 0) {

        // Render the classification result
        sb.append(Resources.getMessage("MainToolBar.22")); // $NON-NLS-1$
        if (this.numTransformationsAnonymous != 0) {
          sb.append(Resources.getMessage("MainToolBar.24")) // $NON-NLS-1$
              .append(this.numTransformationsAnonymous);
        }
        if (this.numTransformationsNotAnonymous != 0) {
          sb.append(Resources.getMessage("MainToolBar.26")) // $NON-NLS-1$
              .append(this.numTransformationsNotAnonymous);
        }
        if (this.numTransformationsProbablyAnonymous != 0) {
          sb.append(Resources.getMessage("MainToolBar.28")) // $NON-NLS-1$
              .append(this.numTransformationsProbablyAnonymous);
        }
        if (this.numTransformationsProbablyNotAnonymous != 0) {
          sb.append(Resources.getMessage("MainToolBar.30")) // $NON-NLS-1$
              .append(this.numTransformationsProbablyNotAnonymous);
        }
        if (this.numTransformationsAnonymityUnknown != 0) {
          sb.append(Resources.getMessage("MainToolBar.34")) // $NON-NLS-1$
              .append(this.numTransformationsAnonymityUnknown);
        }
        if (this.numTransformationsInfolossAvailable != 0) {
          sb.append(Resources.getMessage("MainToolBar.35")) // $NON-NLS-1$
              .append(this.numTransformationsInfolossAvailable);
        }
        sb.append("\n");
      }
      // Render information about the optimum
      if (this.optimum != null) {
        sb.append(Resources.getMessage("MainToolBar.36")) // $NON-NLS-1$
            .append(Resources.getMessage("MainToolBar.39")) // $NON-NLS-1$
            .append(
                heuristic
                    ? Resources.getMessage("MainToolBar.60")
                    : Resources.getMessage("MainToolBar.61")) // $NON-NLS-1$ //$NON-NLS-2$
            .append(Resources.getMessage("MainToolBar.37")) // $NON-NLS-1$
            .append(Arrays.toString(optimum.getTransformation()));
        sb.append(Resources.getMessage("MainToolBar.38")) // $NON-NLS-1$
            .append(optimum.getMaximumInformationLoss().toString());
      }

      // Return
      return sb.toString();
    }
Ejemplo n.º 4
0
 /**
  * Returns a string representation of the receiver, containing the String representation of each
  * element.
  */
 public String toString() {
   return cern.colt.Arrays.toString(partFromTo(0, size() - 1).elements());
 }