@PluginVariant(
      requiredParameterLabels = {0, 1, 2},
      variantLabel = "PerformanceDetailsSettings")
  // @UITopiaVariant(affiliation = "Department of Computer Science University of Pisa", author =
  // "R.Guanciale,G.Spagnolo et al.", email = "*****@*****.**", pack =
  // "PetriNetReplayAnalysis")
  public TotalPerformanceResult getPerformanceDetails(
      PluginContext context, XLog log, Petrinet net, ReplayFitnessSetting setting) {

    Marking marking;

    try {
      InitialMarkingConnection connection =
          context
              .getConnectionManager()
              .getFirstConnection(InitialMarkingConnection.class, context, net);
      marking = connection.getObjectWithRole(InitialMarkingConnection.MARKING);
    } catch (ConnectionCannotBeObtained ex) {
      context.log("Petri net lacks initial marking");
      context.getFutureResult(0).cancel(true);
      return null;
    }

    map = null;
    return getPerformanceDetails(
        context, log, net, setting, marking, XLogInfoImpl.STANDARD_CLASSIFIER);
  }
Ejemplo n.º 2
0
  @Plugin(
      name = "Generate serialization updating object",
      level = PluginLevel.Local,
      parameterLabels = {},
      returnLabels = {"Test object"},
      returnTypes = {RefObject.class},
      userAccessible = true)
  @UITopiaVariant(
      affiliation = UITopiaVariant.EHV,
      author = "B.F. van Dongen",
      email = "*****@*****.**")
  public static Object testUpdating(PluginContext context) throws InterruptedException {
    String s = "Test object " + i++;
    context.getFutureResult(0).setLabel(s);

    RefObject o = new RefObject(null, s);

    ProvidedObjectID id =
        context.getProvidedObjectManager().createProvidedObject("Updating test object", o, context);
    int n = 15;
    context.getProgress().setMaximum(n);
    for (int j = 0; j < n; j++) {
      s = "Test object " + i++;
      try {
        o = new RefObject(new RefObject(o.ref, "Reference to o"), s);
        context.getProvidedObjectManager().changeProvidedObjectObject(id, o);
      } catch (ProvidedObjectDeletedException e) {
        break;
      }
      Thread.sleep(3000);
      context.getProgress().inc();
    }
    s = "Test object " + i++;
    return new RefObject(o, s);
  }
  @Plugin(
      name = "Add End Artificial Events",
      parameterLabels = {"Log"},
      returnLabels = {"Altered log"},
      returnTypes = {XLog.class},
      userAccessible = true,
      help = "Adds an artificial  end task to every trace in the log file")
  @UITopiaVariant(
      affiliation = "Department of Computer Science University of Pisa",
      author = "R.Guanciale,G.Spagnolo et al.",
      email = "*****@*****.**",
      pack = "PetriNetReplayAnalysis")
  public XLog addEvents(PluginContext context, XLog oldLog) {

    context.getFutureResult(0).setLabel(XConceptExtension.instance().extractName(oldLog));

    context.getProgress().setMinimum(0);
    context.getProgress().setMaximum(oldLog.size());
    context.getProgress().setIndeterminate(false);
    context.getProgress().setValue(0);

    XAttributeMap logattlist = copyAttMap(oldLog.getAttributes());
    XLog newLog = new XLogImpl(logattlist);
    for (int i = 0; i < oldLog.size(); i++) {
      XTrace oldTrace = oldLog.get(i);
      XTrace newTrace = new XTraceImpl(copyAttMap(oldTrace.getAttributes()));
      for (int j = 0; j < oldTrace.size(); j++) {
        XEvent oldEvent = oldTrace.get(j);
        XEvent newEvent = new XEventImpl(copyAttMap(oldEvent.getAttributes()));
        newTrace.add(newEvent);
      }

      Date time = new Date();
      try {
        time =
            ((XAttributeTimestampImpl)
                    oldTrace.get(oldTrace.size() - 1).getAttributes().get("time:timestamp"))
                .getValue();
        time.setTime(time.getTime() + 1);
      } catch (Exception ex) {
      }

      newTrace.add(makeEvent("ArtificialEnd", time));

      newLog.add(newTrace);
      context.getProgress().inc();
    }
    return newLog;
  }
Ejemplo n.º 4
0
 @Plugin(
     name = "Generate referencing test object",
     level = PluginLevel.Local,
     parameterLabels = {"References Object"},
     returnLabels = {"Test object"},
     returnTypes = {RefObject.class},
     userAccessible = true)
 @UITopiaVariant(
     affiliation = UITopiaVariant.EHV,
     author = "B.F. van Dongen",
     email = "*****@*****.**")
 public static Object testSerialization(PluginContext context, final RefObject toReference) {
   final String s = "Test object " + i++;
   context.getFutureResult(0).setLabel(s + " referencing: " + toReference.toString());
   return new RefObject(toReference, s);
 }