• Aucun résultat trouvé

Simulating Place/Transition Nets by a Distributed, Web Based, Stateless Service

N/A
N/A
Protected

Academic year: 2022

Partager "Simulating Place/Transition Nets by a Distributed, Web Based, Stateless Service"

Copied!
2
0
0

Texte intégral

(1)

Simulating Place/Transition Nets

by a Distributed, Web Based, Stateless Service

Jan Henrik Röwekamp, Matthias Feldmann, Daniel Moldt, Michael Simon University of Hamburg, Faculty of Mathematics, Informatics and Natural Sciences,

Department of Informatics, http://www.informatik.uni-hamburg.de/TGI/

Abstract Executing Petri nets in a distributed manner is, in general, a non-trivial task. To achieve portability of the simulation, as a precondi- tion for scalability, it is desirable to keep the majority of the simulation components stateless. This paper presents a first approach to model dis- tributed Place/Transition nets (P/T nets) using stateless services and only a (stateful) database. The presented theory has been implemented in a web API based service. First tests look promising.

Keywords: P/T Nets, Distributed Systems, Scalability, Stateless Ar- chitecture, Tools, Container, Docker

Introduction

The astonishing growth of today’s systems allows for widespread use of compu- tational resources. The resulting complexity of distributed systems keeps rising.

Excellent formalisms to model this kind of systems are Petri nets and the diverse formalisms built on top of them. Petri net simulators, however, usually only focus on local execution of nets and less on distribution or scalability issues.

In this work, the basic idea of a Petri net simulator focused on distribution and scalable architecture is presented. It is important to note, that a distributed simulation of Petri nets is of interest, not the simulation of distributed Petri nets.

Related Work

Chiola and Ferscha studied distributed timed Petri nets in 1993 [1]. In the case of reference nets, some results for distributed simulation are available as a plug-in forRenew[3], using virtual machines and finally some ideas that form the basis of the simulator presented here [2].

Concept

To cope with the critical parts of a distributed Petri net simulation focus is put on the net partitioning, firing uniqueness and atomic token consumption. In regards to data storage transition firings and token consumption are both write operations. Write operations usually tend to be problematic in a concurrent environment.

(2)

Transition Firing and Token Consumption

As actively simulating transitions in a distributed fashion imposes severe difficul- ties in regards to the uniqueness of firing and/or self-concurrency, the presented approach focuses on simulating active tokens. Tokens, however, may also occur as passive entities. Actively simulated tokens will be referred to as main tokens.

Places are not modeled, but tokens and transitions hold them implicitly.

The simulation is organized in multiple infinite loops. A node selects a ran- dom token as the main token and loads all tokens of all presets of all attached transitions into memory. The node then iterates through all transitions and tries to fire a random active transition. Firing is done by issuing a transaction to the underlying data storage, that assures uniqueness.

If conflicts occur (two or more nodes handle the same token), the transaction will succeed, that is committed into the database first.

The Simulator Core and Technical Aspects

The simulator consists of an evaluation unit layer and a database service. The database service holds the current state of the net, while the evaluation layer only temporarily copies data, that is required to compute transition firings. As the evaluation layer is stateless and only communicates to the database, it is easily scalable. The database layer is harder to scale, but several well-engineered solutions exist and can be utilized.

The evaluation layer was implemented using Java Spring, with later appli- cation to colored nets and reference nets in mind, where transition firings and binding searches become more advanced in the order of magnitudes.

As scalability is one of the proposed main features, the simulator is designed to be used with container and PaaS solutions in mind, especially Docker and Kubernetes. Kubernetes offers excellent means to keep an application robust and scale it up to several replicas. Automatic scaling solutions (based on CPU load) also exist.

Next things to address are the incorporation of existing tools and formats (like PNML) and the evaluation of graph databases (like Neo4j), as well as the transition to higher level Petri net formalisms.

References

1. Chiola, G., Ferscha, A.: Distributed simulation of Petri nets. IEEE Parallel Distrib.

Technol.1(3), 33–50 (Aug 1993)

2. Röwekamp, J.H., Moldt, D., Feldmann, M.: Investigation of containerizing dis- tributed Petri net simulations. In: Applications and Theory of Petri Nets and Con- currency. pp. 133–142 (2018)

3. Simon, M., Moldt, D.: Extending Renew’s algorithms for distributed simulation. In:

Cabac, L., Kristensen, L.M., Rölke, H. (eds.) PNSE’16. CEUR Workshop Proceed- ings, vol. 1591, pp. 173–192. CEUR-WS.org (2016)

164 PNSE’19 – Petri Nets and Software Engineering

Références

Documents relatifs

Line 36, function synchro is used on the output arc in order to produce a copy of the net taken from the input place (as x) in which the transition "tToknet" has fired..

L’archive ouverte pluridisciplinaire HAL, est destinée au dépôt et à la diffusion de documents scientifiques de niveau recherche, publiés ou non, émanant des

For this thesis, a colored Petri net N is defined as N = (P, T, A, C, V, a) where: (P, T, A) is a Petri-net structure; C is a set of attributes called colors; V is a set of

Abstract – Place and transition refinements provide a convenient method of structuring complex net models by replacing single elements (places and transitions) at a ‘higher–level’

THROUGHPUT IN TIMED COLORED NETS Intuitively, throughput of a place color (p, c) in a timed net T is equal to the average number of (colored) tokens entering (or leaving) the place p

If the reachability graph of a Petri net (P, { a, b } , F, M 0 ) contains a g-cycle with a non-zero Parikh vector, it has one of the seven general shapes shown in Figures 1, 3, and 5

The concurrent execution of multiple modeling techniques in their original representation, using explicit model coupling, are promising in order to combine the advantages of

In this synthesis algorithm, different behavioral models result in different inequality systems describing valid places.. The run-time, as well as the size of the calculated Petri