Visually, APNs can be considered as a hybrid of Markov chains and Petri nets. Similar to Markov chains, it is a state-space representation where (a finite) number of possible states is represented as circles, and transitions from one state to another are denoted with directed arcs. However, in contrast to Markov chains where states of a system as a whole is modeled, the states of individual entities that comprise the system are modeled instead.
To implement component-based representation, we borrow the notations from Petri nets (a popular tool in computer science) and introduce smaller filled circles (tokens) that represent individual parts of the system and can move between particular larger circles (states) that are referred to as places. There are two advantages to this approach:
Fundamentlly, in traditional Petri nets (and Stochastic Petri Nets in particular), system components are represented by places. In contrast, in APN components are usually represented by tokens. As a consequence, these tokens are more persistent that their equivalents in SPNs, they have "memory" remembering their past (including their identities). In particular, the state changes in standard Petri nets are interpreted as taking tokens from all incoming places and depositing tokens to the outgoing places. In contrast, APNs merges those two actions into one "movement" of a token from an input place to an output place. As long as tokens are all the same (indistinguishable), both interpretations are equivalent. However, for distinguishable (color) tokens the difference is significant.
In traditional SPNs, transitions represent a separate type of objects that is used to connect places. Transitions are denoted with rectangles, and they serve as transient stops or junctures between the places: in order for a token to move from one place to another it has to pass through a transition. In graph theory the resulting construction is referred to as a bi-partite graph: there are two types of nodes (places and transitions) and links (arcs) always go from one kind of node to the other (an arc cannot go from a place to a place, or from a transition to a transition). There is no restriction on the number of links that can connect the nodes, so a transition can have two (or more) incoming link and only one out going link, which can model merging, or we can have the opposite situation (forking or splitting). This leads to a great modeling flexibility, but this freedom leads to complex routing routes for different colors.
For example, let us consider a common scenario workflow when two activities are executed in parallel for each case. The figure shows an SPN model for this scenario. Transition T1 effectively splits (duplicates) the token into two, and only when both tasks are completed, transition T4 is enabled and fires the token into the "Out" place, indicating that the case is completed. Here we use the standard notation for SPNs where filled rectangles represent timed transitions (T2 and T3), while narrow bars represent immediate transitions that fire as soon as their enabled (T1 and T4). This model is suitable for treating a single case. However, if we have multiple cases, as shown in the figure, the challenge is tracking tokens from a particular case, and avoiding the merging of tokens that represent different cases (modeled by different "colors" - token's discreet labels). There are two existing approaches to this challenge:
Effectively, when the tokens are distinguished, transitions serve two distinct roles:
As a result, the lack of limitations on the number of inputs and outputs to a transition leads to the choice between large number of dedicated duplicate subnets or complex inscriptions that take into account complex permutations and must be done programmatically
APNs consider default behavior as parallel (independent), and therefore focus on the coupling (interactions) in clearly defined fashion. There are multiple mechanisms that either implicitly or explicitly imply interactions in traditional SPNs. Three of those mechanisms are NOT used in APN:
Instead there are are specific mechanisms for modeling two types of interactions:
Routing role is considered to be separate from interaction, as the routing concerns individual tokens. So in APNs transitions (directed arcs) can link place nodes directly, similar to state space diagrams for Markov chains, and those transition can have color-specific policies, thus serving the routing role as well.
Let us show how the challenges of coordination are handled as a result. First we look at the execution of two tasks in parallel for several cases. The resulting model is shown in the figure "APN model for two parallel tasks" and one can see that the logic of the model simply mimics the idealized SPN models with joints serving the splitting and merging role, and the transitions T2 and T3 depicted using directed arcs (without separate transition nodes). The merging joint has policy "I" (see Merging Joints) that ensures that only tokens with the same ID are merged. APN provides an option to use IDs as visualized token labels, as shown in the figure.
The second scenario with handling the resources is inherently more complex. We will show here a specific solution that implies that the duration of the task is independent on the type of utilized resources (but can depend on the type of customer). An alternative model where the resource does impact the task duration is also possible. The model is certainly more complex than the idealized version for SPN (see Figure "SPN model for two parallel tasks"). However, the SPN model is only valid for a non-distinguishable resources, unless complex inscriptions are utilized. Otherwise, each resource requires a dedicated subnet that are fused together in the shared pool place.
APN model is organized as follows. When a case token appears in the "In" place it is duplicated first. One of the copies is used to initiate the resource request. If the resource is available, the merging joint is fired, and the merged token is deposited into the "Resource seized" place. The resulting token inherits resource properties (this is ensured by selecting as dominant the upper input branch into the joint, as visualized by the thicker line of the dominant arc). The ID from the task token is inherited as a shadow or recessive ID for the token (it will be used later). The joint type is "Any" as here no requirement to the type of resource is specified. This model can be further refined if only some of the resources are suitable for the task (in this case colored policy can be selected for the joint). The resulting token is duplicated next to keep a resource copy. The other copy is merged with the copy of the task token, where the recessive ID merging option "R" is utilized (since the recessive or shadow ID of that token matches the task's ID). After the task is completed and the token moves to the "Task end" place it gets duplicated with one copy used to indicate the completion of the task (the "Out" place), while the other copy is used to merge with the copy of the resource and release the resource. Here the dominant input is from the "Resource copy" place, and "R" matching policy is utilized.V.Volovoi "Abridged Petri Nets", ArXiv: 1312.2865 [cs.OH](2013);. The current version of the paper is here.
Aging Tokens present another distinguishing feature of this SPN extension, as they provide a compact means to model transition rates that are time-dependent. Effectively "age" of a token is a continuous label with the value from [0,1]. The value of this label can be affected in a continuous fashion as the token stays in the same place, or in a discrete fashion upon firing of a transition. The concept of "aging" corresponds to the former. However, transitions can be either aging or not. In the current version, each place can be an input to no more than one aging transition. If there are no aging transitions, tokens don't age (that is, their ages remain unchanged). There can be more that one transition for a given place that will affect the age in a discrete fashion (there is no conflict, since this effect is realized only when firing occurs). These concepts were first introduced in the following paper:
V.V. Volovoi, “Modeling of System Reliability Using Petri Nets with Aging Tokens,” Reliability Engineering and System Safety, 84, no. 2 (2004): 149161(PDF)