Token-based replay
Token-based replay technique is a conformance checking algorithm [1] that checks how well a process conforms with its model by replaying each trace on the model (in Petri net notation ).[2] Using the four counters produced tokens, consumed tokens, missing tokens, and remaining tokens, it records the situations where a transition is forced to fire and the remaining tokens after the replay ends. Based on the count at each counter, we can compute the fitness value between the trace and the model.
The algorithm [2]
The token-replay technique uses four counters to keep track of a trace during the replaying:
- p: Produced tokens
- c: Consumed tokens
- m: Missing tokens (consumed while not there)
- r: Remaining tokens (produced but not consumed)
Invariants:
- At any time: [math]\displaystyle{ p+m \ge c \ge m }[/math]
- At the end: [math]\displaystyle{ r = p + m - c }[/math]
At the beginning, a token is produced for the source place (p = 1) and at the end, a token is consumed from the sink place (c' = c + 1). When the replay ends, the fitness value can be computed as follows:
[math]\displaystyle{ \frac{1}{2}(1 - \frac{m}{c}) + \frac{1}{2}(1 - \frac{r}{p}) }[/math]
Example
Suppose there is a process model in Petri net notation as follows:
Example 1: Replay the trace (a, b, c, d) on the model M
- Step 1: A token is initiated. There is one produced token ([math]\displaystyle{ p = 1 }[/math]).
- Step 2: The activity [math]\displaystyle{ \mathbf{a} }[/math] consumes 1 token to be fired and produces 2 tokens ([math]\displaystyle{ p = 1 + 2 = 3 }[/math] and [math]\displaystyle{ c = 1 }[/math]).
- Step 3: The activity [math]\displaystyle{ \mathbf{b} }[/math] consumes 1 token and produces 1 token ([math]\displaystyle{ p = 3 + 1 = 4 }[/math] and [math]\displaystyle{ c = 1 + 1 = 2 }[/math]).
- Step 4: The activity [math]\displaystyle{ \mathbf{c} }[/math] consumes 1 token and produces 1 token ([math]\displaystyle{ p = 4 + 1 = 5 }[/math] and [math]\displaystyle{ c = 2 + 1 = 3 }[/math]).
- Step 5: The activity [math]\displaystyle{ \mathbf{d} }[/math] consumes 2 tokens and produces 1 token ([math]\displaystyle{ p = 5 + 1 = 6 }[/math], [math]\displaystyle{ c = 3 + 2 = 5 }[/math]).
- Step 6: The token at the end place is consumed ([math]\displaystyle{ c = 5 + 1 = 6 }[/math]). The trace is complete.
The fitness of the trace ([math]\displaystyle{ \mathbf{a, b, c, d} }[/math]) on the model [math]\displaystyle{ \mathbf{M} }[/math] is:
[math]\displaystyle{ \frac{1}{2}(1 - \frac{m}{c}) + \frac{1}{2}(1 - \frac{r}{p}) = \frac{1}{2}(1 - \frac{0}{6}) + \frac{1}{2}(1 - \frac{0}{6}) = 1 }[/math]
Example 2: Replay the trace (a, b, d) on the model M
- Step 1: A token is initiated. There is one produced token ([math]\displaystyle{ p = 1 }[/math]).
- Step 2: The activity [math]\displaystyle{ \mathbf{a} }[/math] consumes 1 token to be fired and produces 2 tokens ([math]\displaystyle{ p = 1 + 2 = 3 }[/math] and [math]\displaystyle{ c = 1 }[/math]).
- Step 3: The activity [math]\displaystyle{ \mathbf{b} }[/math] consumes 1 token and produces 1 token ([math]\displaystyle{ p = 3 + 1 = 4 }[/math] and [math]\displaystyle{ c = 1 + 1 = 2 }[/math]).
- Step 4: The activity [math]\displaystyle{ \mathbf{d} }[/math] needs to be fired but there are not enough tokens. One artificial token was produced and the missing token counter is increased by one ([math]\displaystyle{ m = 1 }[/math]). The artificial token and the token at place [math]\displaystyle{ [\mathbf{b, d}] }[/math] are consumed ([math]\displaystyle{ c = 2 + 2 = 4 }[/math]) and one token is produced at place end ([math]\displaystyle{ p = 4 + 1 = 5 }[/math]).
- Step 5: The token in the end place is consumed ([math]\displaystyle{ c = 4 + 1 = 5 }[/math]). The trace is complete. There is one remaining token at place [math]\displaystyle{ [\mathbf{a, c}] }[/math] ([math]\displaystyle{ r = 1 }[/math]).
The fitness of the trace ([math]\displaystyle{ \mathbf{a, b, d} }[/math]) on the model [math]\displaystyle{ \mathbf{M} }[/math] is:
[math]\displaystyle{ \frac{1}{2}(1 - \frac{m}{c}) + \frac{1}{2}(1 - \frac{r}{p}) = \frac{1}{2}(1 - \frac{1}{5}) + \frac{1}{2}(1 - \frac{1}{5}) = 0.8 }[/math]
References
- ↑ van der Aalst, Wil (2016), van der Aalst, Wil, ed., "Data Science in Action" (in en), Process Mining: Data Science in Action (Berlin, Heidelberg: Springer): pp. 3–23, doi:10.1007/978-3-662-49851-4_1, ISBN 978-3-662-49851-4, https://doi.org/10.1007/978-3-662-49851-4_1, retrieved 2021-11-16
- ↑ 2.0 2.1 Rozinat, A.; van der Aalst, W.M.P. (March 2008). "Conformance checking of processes based on monitoring real behavior". Information Systems 33 (1): 64–95. doi:10.1016/j.is.2007.07.001. ISSN 0306-4379. http://dx.doi.org/10.1016/j.is.2007.07.001.
Original source: https://en.wikipedia.org/wiki/Token-based replay.
Read more |