To prevent spam users, you can only post on this forum after registration, which is by invitation. If you want to post on the forum, please send me a mail (h DOT m DOT w DOT verbeek AT tue DOT nl) and I'll send you an invitation in return for an account.

Generate event log for Petri net or BPMN model

Hi all,

I receive business models as Petri nets or BPMN (from a third-party modelling tool, I do not mine these models.) I have written a tool to check logs/traces for conformance against these models.

Now I would like to generate event logs to replay against these models, mainly for the purpose of performance testing the conformance check. The models can be quite complex, with lots of ambiguous transitions where multiple paths can be followed.

What are the best ways to generate event logs from such models? For example, are there tools that can enumerate all possible traces of a Petri net (note the models may have loops)?

This forum contains several old posts that make reference to CPN tools. However, I am on a recent build of Windows 10, and I have not been able to get any version of CPN tools to run. I can install it, but regardless of whether I start CPN normally or in safe mode, I only see the menu on the left hand side, but no action is executed regardless of where I click.

Quite apart from that technical issue, all links that I could find that explain the use of CPN tools for the purpose I have in mind seem to have expired, except for this presentation, which is not so helpful when you are starting with zero knowledge.

I am hoping for something easier, like a ProM 6 plugin that will take a Petri net or BPMN model and happily start listing traces. But really any advice that can get me started would be very welcome.


Answers

  • I have arrived at a more or less adequate solution, without resorting to extra tools. If anyone's interested, for me the following approach works quite well:

    Given an accepting Petri net
    • start with a randomly selected initial marking (there is usually only one, anyway)
    • cycle over the Petri net transitions in random order and fire any enabled transition that you encounter, updating the marking
    • at configurable intervals (e. g. every n events) reshuffle the transitions, so alternative transitions get a chance to fire
    • with configurable probability, if you encounter a non-enabled transition, add tokens to the marking that enable it (so you get some extra events, leading to non-conformity)
    • stop when a certain number of visible transitions have been replayed, or a final marking is reached.
    The labels of the fired visible transitions constitute a trace. Do this a few times, add case IDs and timestamps, and you're done.

    I'm sure there are ways to add bells and whistles, but it's simple and OK as a first shot at generating test data.

  • Hi Sebastian,

    I do something similar. Every time I need to fire a transition, I assign a random value to every enabled transition, and then fire the one with the highest value. I you really need one transition to have a higher probability. then you can add copies of the transition: The more copies, the higher the probability it gets fired. Of course, this pollutes the net a bit, but if the net is only there to generate a log, then this is OK.  This, I continue until a final marking is reached.

    Note that by adding additional tokens like you do, the final marking may become unreachable. As a result, a noisy trace will likely be truncated as well, as it can now only stop at the designated number of (visible) transitions.

    Noise is introduced later by removing an event, adding an event, or moving an event in the trace.

    Cheers,
    Eric.
  • Hi Eric,
    thanks, good point about the added tokens. I'll probably have to change that.
    Best Regards,
    Sebastian
Sign In or Register to comment.