© SCS AGENT-BASED DISTRIBUTED EXECUTION OF COLOURED PETRI NETS G. Fortino, L. Nigro, F. Pupo, W. Russo Laboratorio di Ingegneria del Software Dipartimento di Elettronica Informatica e Sistemistica Università della Calabria, I-87036 Rende (CS) - Italy E-mail: {g.fortino, l.nigro, f.pupo, w.russo}@unical.it KEYWORDS Coloured Petri nets, distributed simulation, agents, Java. ABSTRACT This paper introduces jCPN, a Java toolset which enables visual modelling and distributed execution of complex Coloured Petri Net models. jCPN relies on Java for net annotations and kernel implementation. Distribution support depends on agents which facilitate partitioning and execution of a large model on a parallel virtual machine built over Internet. The paper describes the design of jCPN and illustrates its concrete use through examples. INTRODUCTION Petri nets (Murata 1989) represent a simple, yet powerful visual formalism for modelling systems with concurrency, synchronization and non determinism aspects. Certain properties of Petri nets can be verified relating to some theoretical results, e.g., structural and reachability analysis allows answering about liveness or boundedness of a modelled system, and can be performed by applying linear algebra techniques or by investigating the set of reachable states. Besides formal analysis opportunities, a Petri net system specification represents a good starting point for another important development activity: simulation and prototype generation. Simulating a Petri net helps obtaining basic intuition about the behaviour of the modelled system and enables experimental analysis and (empirical) validation of the model. Implementing a Petri net means providing an executable system prototype that behaves exactly as the specification. Coloured Petri Nets (Jensen 1992-98) combine the strength of Petri nets with the facilities of high-level programming languages which allow the definition of powerful data types and permit the manipulation of their values. Places of a CP- net are typed and tokens carry data values (colours). Transition enabling can be made dependent on the token values which in turn can be modified by transition firing. CP-nets can be used to evaluate properties of real systems (e.g., Nigro and Pupo 2001). In general, the high modelling power of Coloured Petri Nets is only partially exploitable, due to the exponential complexity of analytic evaluation techniques. Complex CPN models are very costly to be formally analysed and simulation often remains the only practical testing technique. In order to cope with computational hardness of realistic CPNs execution, distributed execution can be considered along with an exploitation of structural properties of Petri nets which facilitate the decomposition of an entire model into a collection of loosely coupled distributed simulation tasks (Chiola and Ferscha 1993) (Ferscha 1994) where, for instance, transition enabling/firing have a local semantics. This paper reports about a research project whose original contribution is the development in Java of a toolset (jCPN) supporting CP-nets visual modelling and agent-based distributed execution (Holvoet and Verbaeten 1997) (Kiniry and Zimmerman 1997) (Agha et al. 2001). Java is also used for net inscriptions and declarations and for the implementation of the runtime distributed control engine. The choice of Java makes jCPN highly portable and neutral with respect to the execution platforms and the interconnection infrastructure. jCPN consists of an integrated graphical environment which enables a Petri net model to be executed on a heterogeneous parallel virtual machine built over Internet. COLOURED PETRI NETS CP-nets (Jensen 1992-98) are a class of high level nets that extend ordinary Petri nets: tokens can carry arbitrarily complex data, arcs can be annotated with input predicates (influencing the enabling of a transition) or output functions (stating the production rule of tokens when a transition fires). In the definition of CP-nets, the concrete syntax in which net expressions can be written is not fixed; indeed declarations and net inscriptions can possibly be expressed in many different languages, e.g., by means of standard mathematical notations or by means of ordinary high-level programming languages. In the formal definition of CP-nets it is only assumed that such a syntax exists together with a well defined semantics. Then, given the following notations: a) T: the elements of a type T (the set of all elements in T is denoted by the type name T itself) b) T*: the multiset of elements of type T c) Type(v): the type of a variable v d) Type(expr) the type of an expression expr