{'fraction_non_alphanumeric': 0.03577112018266104, 'fraction_numerical': 0.008026015360132845, 'mean_word_length': 4.452282157676349, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Recommendations for Using QPN Formalism for Preparation of Incoming Request Stream Generator in Modeled System

Simulation models are elements of science that use software tools to solve complex mathematical problems. They are beneficial in areas such as performance engineering and communications systems. Nevertheless, to achieve more accurate results, researchers should use more detailed models. Having an analysis of the system operations in the early modeling phases could help one make better decisions relating to the solution. In this paper, we introduce the use of the QPME tool, based on queueing Petri nets, to model the system stream generator. This formalism was not considered during the first tool development. As a result of the analysis, an alternative design model is proposed. By comparing the behavior of the proposed generator against the one already developed, a better adjustment of the stream to the customer’s needs was obtained. The study results show that appropriately adjusting queueing Petri net models can help produce better streams of data (tokens).


Related Work
Performance evaluation is applied in communications system development and assessment. In recent years, most of the works focused on systems that were very efficient, and able to handle numerous incoming requests. The topic of stream preparation was omitted.
Usually some kind of workload generator is applied to analyze the behavior of the modeled system. A survey of such generators for general purpose web-based systems is presented in [14]. Specialized traffic models may be considered for different systems, e.g., for industrial networks [15] or streaming video data, both for input [16] and output streams [17]. In such models, an input stream generator is usually a part of the workload generator. Such an arrival stream generator produces a stream of random input data according to the expected distribution. Petri net models of the system typically are built based on predefined structures-patterns [18,19]; in such an approach, a stream generator is one of the integral components.
We created a stream generator (SG) client model using queueing Petri nets (QPNs), which guarantee performance analysis [12]. QPNs provide greater modeling power than queueing net (QN) and Petri net (PN) models. We used two types of formal models that were exploited in one model. Queueing Petri nets have the advantages of queueing nets (e.g., the network efficiency and evaluation of the system performance) and Petri nets (e.g., logical assessment of the system correctness). To the best of our knowledge, none of the existing techniques presented in the literature enable the preparation of such a stream. Falko Bause et al. in [20] describe these kinds of Petri nets, named QPNs. Kounev et al. [21] provide an introduction to QPNs.
The modeling approach presented in this paper differs from that of previous works [9], in regard to performance analysis, because we modeled different stream behaviors; they are similar to [7], but we prepared the SG based on another formalism. This approach could be treated as an extension of the paper [7].
In [7], colored Petri nets (CPNs) were used to model the SG. Two different ways were considered to impose restrictions on mapping between users and resources-transition guards or arc expressions. In this paper, QPNs are used instead of CPNs. Appropriate mapping in the output stream was achieved by means of transition modes and firing weights.

QPNs
QPNs can be seen as an extension of stochastic PNs. The main idea of QPNs is to add queueing and timing aspects to the net places and timed transitions. QPNs allow queues to be integrated into the places of a PN. Places (QPN) are divided into two types: ordinary and queued. A place that contains an integrated queue is called a queueing place. Queueing places contain two components: the queue and the depository of tokens that complete their service at a queue. Tokens are used to model requests and enter the queueing place through the firing of input transitions. The different possibilities of firing a transition are referred to as modes. Modes have firing weights (probabilities) that influence which mode is chosen. Tokens are inserted into a queueing place according to the queue's scheduling strategy. Timed queueing places have service distributions. In the queueing place, if a server is available, arriving tokens are first serviced. If a server is not available, the tokens have to wait in the waiting area. The time it takes to service a token is defined through a statistical distribution. After service, the tokens are immediately moved to a depository, where they become available for output transitions. When a transition fires, tokens are removed from some places and new tokens are created at others. Figure 1 shows the notation used for ordinary places and queueing places. For more details, refer to [5]. To analyze any QPN it is necessary to determine: • Set of places; • Set of queueing places with scheduling strategy; • Set of immediate or timed transitions (QPNs allow transitions to fire in different modes (transition colors)); • Initial marking (number of tokens); • Incidence function (routing probability) is defined per color/mode basis; • Arcs with firing weights as relative firing frequency of the mode; • Token color function specifies the types of tokens that can reside in the place and allows transitions to fire in different modes.
The color function assigns a set of colors to each transition. Incidence functions are defined on a per color basis.
QPN model was used to check the behavior of the token and it was developed using the QPME tool [22].

Mathematical Model of QPN
In [23], the general model of QPN was defined and some symbols were introduced. This is briefly summarized in this subsection.
Queueing Petri nets have the advantages of QNs (e.g., evaluation of the system performance, the network efficiency) and PNs (e.g., logical assessment of the system correctness). The main idea of QPNs is to add queueing and timing aspects to the net places. QPN is a tuple (1). where: . . , p k } is a finite and non-empty set of places; • TR = {t 1 , t 2 , . . . , t l } is a finite and non-empty set of transitions; CO is a color function defined from PL ∪ TR into finite and non-empty sets (specify the types of tokens that can reside in the place and allow transitions to fire in different modes); • I N(p, t) are the backward and forward incidence functions defined in PL × TR, such that I N(p, t) ∈ [CO(t) −→ CO(p) MS ], ∀(p, t) ∈ PL × TR (specify the interconnections between places and transitions; the subscript MS denotes multisets. CO(p) MS denotes the set of all finite multisets of CO(p)); • MA(p) is an initial marking defined on PL, such that MA(p) ∈ CO(p), ∀p ∈ PL (specify how many tokens are contained in each place). • QU = (QU 1 , QU 2 , (q 1 , . . . , q |PL| )), where: is an array with a description of places (if p i is a queueing place, q i denotes the description of a queue with all colors of CO(p i ) into consideration, or if p i is the ordinary place (p i ) equals null).
• WE = (WE 1 , WE 2 , (w 1 , . . . , w |TR| )), where: * rate of a negative exponential distribution specifying the firing delay due to color c ∈ CO(t j ), if t j ∈ WE 1 ; * firing weight specifying the relative firing frequency due to color c ∈ CO(t j ), if t j ∈ WE 2 .

Stream Generator
In this article, we present the modified version of the SG model shown in [7], which is based on QPNs. This is a simple way to model a user stream, who generates requests transferred to the system.
The model allows us to freely join the u1 or u2 user tokens with the r1 or r2 resource tokens. Thus, any distribution in Stream can be obtained in this way.
The logic lies in the firing of transitions with weights and handling of the token colors. The following cases are considered: • In a simple SG, any user can use any resource in the stream generation process. • In other cases, any stream can be generated based on a predetermined weight value.
The stream preparation technique presented here provides a framework for a model that can be used in system performance modeling. For technical details on the simulation tool, we refer the reader to [22].

Testing in QPME Tool
Every system model could be divided into parts: the client and the system [9]. We started modeling the first part, called SG.

Mathematical Model of SG in QPN
Based on the definition in Section 2.1, we define the following QPN model (2) where: • Set of places PL = {Res, Stream}. -

Simulation Model
The SG model is shown in Figure 2. SG is represented in the model by a set of places (Res and Stream), queueing place (Users), and immediate transition Generator (All transition cases of the model are shown in Table 1). Table 2 provides details on the places used in the model. Requests and resources are modeled by tokens of different colors. Users generates tokens of user requests u1 and u2 at the given rate. Res generates different available resources as r1 or r2 tokens. Every request goes to the system. After acquiring a resource r1 or r2 from the Res place, the requests are placed into the Stream place of the model. The Stream place consists of r1u1, r1u2, r2u1, and r2u2 tokens. In Table 1 we concentrate only on the Stream place and generated new tokens. Table 3 defines the token colors that we use.

Transition Mode Action
Generator  First user second resource u2r1 Second user and first resource u2r2 Second user and second resource The used queue is described by Kendall notation (A/B/K/L), where A denotes the probability distribution function that specifies the interarrival time of tokens (−means different requests interarrival time), B is the probability distribution function of a service time (M means exponential (Markovian) distribution of the request service time), K determines the maximum number of requests that can arrive in a queue (in this case, it is ∞) and L-scheduling strategy (in this case, it is the infinite server).
Users has an infinite server queue with an initial population of request tokens. The transition Generator is configured to fire these tokens into the system (modeled as Stream place). Firing the Generator transition ( Figure 3) creates a token in the Stream place, assigns one of the resources to one of the users. Stream is an ordinary place that contains the resulting stream of the mean token population. The method used to model restrictions of the user/resource mapping involves the appropriate selection of firing weights (Figure 4). In this model, Stream tokens are generated based on this value. We assign different firing weights to the prepared modes of these transitions so that they have various probabilities of being fired when multiples of them are enabled at the same time. We use the notation (3) to denote firing modes ( Table 1) (The symbols input and output are used here to refer to the input and output places of transitions, respectively). After the token is destroyed in an input place by the transition Generator, a new token is created in an output place. where: • A c token is removed from place p i ; • A c token is deposited in place p i+1 .
The modeling approach was tested with different input firing weight values to demonstrate its effectiveness and practical applicability.

Stream Generator Results
In this section, we present an evaluation of our modeling approach. In many models, it is typical to distribute the data in random order. However, we need predefined distributions in some cases. The modeling approach was described in the previous section, and it allows simulating any input data distribution. The QPME tool generates a report showing the predicted SG population for the individual model configuration.
Tables 4 and 5 present the results for each token in Stream place. We can find the mean token population for Stream place. Table 4 shows the token population for a simple case with firing weights equal 1.0 for every mode (mode 1 , mode 2 , mode 3 , mode 4 ). We observe that, as expected, the mean token population is evenly distributed for tokens (u1r1, u1r2, u2r1, u2r2). The first four lines of Table 5 show the token population for the case with firing weights equal to 1.0, 2.0, 3.0, and 4.0 for individual modes. Other examples can be found in the following lines of Table 5. In all cases, the sum of all tokens in Stream place is about 100,000, as shown in Tables 4 and 5.
It can be observed that the quantities of the generated tokens in the Stream place for each mode i are consistent with the appropriate firing weights w. This relation for n modes can be denoted as follows (4).
Thus, various distributions of the tokens in the stream can easily be modeled by appropriate changes in the firing weights, according to the designer's needs. The model is general and covers special cases where one of the users is not allowed to use a particular resource. This restriction is modeled by setting the appropriate firing weight to zero.

Conclusions
In this paper, we used queueing Petri net formalism as an analysis technique to prepare the SG of incoming requests in the early phases of system development. Performance engineering is a field of study that solves performance problems using simulators. This field suffers from a lack of guidelines and software solutions for client behavior modeling. Modeling a system and performance analysis in the early stages of system construction ensures the best performance. This approach is a complex modeling tool for a proper selection input stream to the modeled system.
Various models of SG in miscellaneous classes of Petri nets may be considered. Our approach gradually evolves from CPN into QPN. Transition modes and firing weights, which are distinctive elements of QPN formalism, are beneficial. They can be used to model the probability of choosing appropriate binding of the transition; thus, manifold distributions of the tokens in the output stream can be generated in a comprehensive, logical manner. The model of SG presented in Section 3 is simple but flexible, able to produce the stream according to the designer's needs, as shown in Section 4.
In this paper, the system client was taken into account. Its original design was performed using QPN models. Future research might confirm that the specific client behavior could be achieved by developing a model with a proposed SG.