Professional Documents
Culture Documents
Introduction
There exists a wide range of software tools that permit the modelling and execution of Petri nets. Most of them are concerned with facilitating the process of
designing and editing a Petri net model and to make it as exible and convenient
as possible, but pay little attention to simulation features. However, improving
the user support for running simulations is imperative in certain circumstances.
As an example consider the simulation of quantitative Petri nets, such as continuous, stochastic, or hybrid Petri nets, which may become computationally very
expensive. For instance, consider the spatial modelling of planar cell polarity in
the drosophila wing via Petri nets [6]. This scalable model may contain about
1,000,000 places and 1,000,000 transitions, and the runtime may range from
several hours to days or even weeks, particularly when stochastic simulation is
involved. Therefore, such models call for sophisticated simulation environments
with exible features for model execution. Examples of such key features are:
remote simulation on powerful machines, on-the-y change of key simulation parameters, collaboration between peer users, or the exploration of one and the
same model by dierent simulation engines.
G. Ciardo and E. Kindler (Eds.): PETRI NETS 2014, LNCS 8489, pp. 374384, 2014.
c Springer International Publishing Switzerland 2014
375
High performance computers are usually hosted at central locations. Therefore, a software tool should allow users to run Petri net models remotely and control their execution via computer terminals. Moreover, such a feature is of great
importance to facilitate the sharing of computational resources. For instance,
computationally expensive simulations can run on powerful clusters, while the
monitoring of the results can be done from a laptop.
Traditionally, a simulation is restarted from the very beginning when a new
parameter set is required to be tested. However, for bigger models it consumes
a lot of time to restart the simulation from scratch each time when we notice
that the simulation goes in a wrong or undesirable direction. As an alternative
method, key simulation parameters should be changeable on-the-y, and the
simulation should just continue execution with the new values for these key
parameters [13]. By this way, users obtain more control over the model execution
which permits to amend errors or play with the model, e.g. to explore the kinetic
parameter space or try design alternatives.
Furthermore, it is useful to permit the collaboration between users with different backgrounds. Such interaction may promote the sharing of knowledge.
Besides, changes done by one user should also be propagated to the others.
Nonetheless, in some application domains of Petri nets it is important to
explore one and the same model denition using dierent simulation techniques.
For instance, systems biology often suggests to simulate a quantitative Petri net
using either the deterministic, stochastic or hybrid approach. This will render
it possible to compare results of the dierent modelling paradigms in order to
study which simulation method ts this type of model best.
In this paper we present a software tool called S 4 (Snoopy Steering and Simulation Server) that works as a stand-alone extension of Snoopy [20] and permits
to distribute, collaborate, share, and interactively steer Petri nets during a running simulation. S 4 is completely written in C++ in a platform-independent
manner. S 4 supports three main Petri net classes: stochastic [17], continuous [7],
and hybrid Petri nets [11]. The theory behind S 4 can be found in [13], and a
detailed technical documentation in [12]. S 4 was previously known as SSServer.
Functionality
Main Features
Remotely run and control a simulation. Users can run their simulation
at remote computers. This feature allows the access to machines with high
computational power from a local computer. The simulation will run at a
server machine while the visualization of the results is done at a dierent
machine, serving as graphical user interface (GUI) client.
376
Execution of one model using dierent simulation algorithms. Sometimes it is useful to study a model via dierent paradigms, i.e., stochastic,
continuous, or hybrid. Using S 4 , one and the same model denition can be
executed with dierent simulation algorithms.
Managing dierent models concurrently with possibly dierent
simulators. Dierent models can be simultaneously executed at the server
side. A separate simulator is assigned to each model and can be executed
independently from other running models. Moreover, running models can be
saved on the server side for future restore.
Dening dierent views to explore simulation results. Views provide
a quick means to explore simulation results from dierent perspectives. Each
view is dened by a set of data curves and their associated attributes. Several
dierent views can be dened for a model.
Exploring the running models on-the-y. By help of the steering graphical user interface (Steering GUI), users can easily navigate among dierent
models. The list of running models at the server side can be refreshed if
another user adds/deletes a model to/from the server.
Steering simulation parameters while a simulation is running. The
main goal of S 4 is to enable users to interact with their models during simulations. Users can change model parameters as well as the current marking
and immediately monitor the systems response to such changes. This is a
very useful tool since a user is allowed to ask what-if questions.
Controlling the simulation speed. The simulation speed can be set to an
appropriate level to facilitate the interaction with a running model during
its execution. This feature is especially important if simulation parameters
are allowed to be changed while the simulation is running.
Connecting to a simulation at any time from whatever place. S 4
is exible to let users connect/disconnect to/from running models without
aecting their execution. Moreover, users can connect to running models
from dierent places, for example from the oce or from home.
Collaborating with other people while simulating a model. More
than one user is permitted to connect to the same models. Users can collaborate by executing and steering a running simulation.
Platform-independent implementation. The core communication library
is written in standard C++, thus it can run on dierent platforms, among them
Windows, Mac OS X, and Linux. Clients and servers need not to run on the
same platform.
2.2
377
Dening a model via Snoopy. Snoopy is a powerful tool to design and edit
Petri nets. It supports many dierent Petri net classes. Thus, we sought to make
use of Snoopys capabilities as a way of conveniently dening a Petri net model,
and afterwards the model is communicated to S 4 . In a typical scenario, a user
constructs a Petri net and then asks Snoopy to execute it in the steering mode.
Snoopy then inquires the address of a running server on the local or a remote
computer. Snoopy knows how to communicate with S 4 as they are compatible
with each other.
Dening a model via API. Sometimes it may be more appropriate to
dene a Petri net model without using a graphical user interface. For instance, if
the model is automatically generated from another specication, or if the model
will be designed by other tools which are not close relatives of Snoopy. In these
cases, S 4 permits the denition and communication of the Petri net using API
calls [13]. Figure 1 gives an overview of the dierent classes supported by the
API. A complete documentation as well as some examples can be found in [12].
2.3
Model Exploration
Once a Petri net model has been dened and sent to S 4 , it can be further explored.
The initial exploration process is meant to provide basic information about the
model under study. This includes information about places, transitions, and the
connections between these two node types. Model exploration can be done either
on the server side or remotely through the graphical user interface.
2.4
During the execution of a Petri net model by help of S 4 , users can remotely
monitor the progress of the simulation results via Snoopys GUI. Moreover, users
can change key simulation parameters, and thus steer the simulation. In this case,
they will immediately get a feedback according to their changes; see Section 4
for a typical user scenario. Figure 2 presents a screenshot of Snoopys GUI. It is
worth mentioning that it is not a prerequisite to submit a model in order to be
able to monitor and steer it. One can also make use of an existing one, which
has been previously submitted by another user.
2.5
378
Fig. 1. Inheritance diagram of Snoopys steering APIs (SPSA). The Snoopy steering
API classes can be classied into four main functional categories: communication, data
structures, control commands, and end point components.
GHPN Generalised hybrid Petri nets combine all features of GSPN and
CPN into one net class. They permit the full interplay between the stochastic
and continuous components.
GSPN C , CPN C , GHPN C In addition to the low-level Petri nets, S 4 reads
the coloured counterparts; see [9] for more details re the relation between
these Petri net classes.
2.6
Available Simulators
Petri net models submitted to S 4 can be simulated via a wide range of simulation techniques. These simulators can be classied into three main categories:
deterministic, stochastic, and hybrid. Any simulation algorithm can be used to
execute a model independently of the original net type. For instance, a net that
has been originally designed as a continuous Petri net can be later simulated
using the stochastic approach. However, an alert will be issued at the beginning
of the simulation. Besides, S 4 permits the adaptation of external simulators, provided by the users, to produce the model dynamics. Furthermore, the simulation
library is structured in such a way that it can be used independently of S 4 .
Deterministic. One way to produce the model dynamics is to execute the
model deterministically. This simulation approach involves the transformation
of continuous Petri nets into a set of ordinary dierential equations (ODEs) [7].
The set of ODEs are then solved numerically using an ODE solver. S 4 supports
14 dierent ODE solver types (seven solvers for sti models and seven for solving non-sti models) ranging from simple xed step-size, explicit solvers (e.g.,
Runge Kutta) to variable step-size, variable order, implicit solvers (e.g., Backward dierentiation formula). For the latter solver types we deploy the numerical
integration library SUNDIAL CVODE [15].
Stochastic. Stochastic simulation applies a dierent approach to producing model dynamics. Unlike in the deterministic simulation, the uctuation
379
Fig. 2. Snoopys steering GUI: steering panel (left), output panel (middle), control
panel (bottom) and manipulation panel (right). The user can select a subset of the
model parameters to change their values on-the-y while the simulation is running.
The simulation results can be viewed as a table, xy plot, or histogram plot; they can
also be exported in csv or image format.
of tokens is captured when a model is simulated stochastically. Moreover, stochastic simulation provides a more convenient approach to permit the intervention
of user changes during a model execution. The steering action can be immediately carried out during the individual ring of a stochastic transition instead
of after each time step as it has to be done for deterministic simulations. S 4
currently supports one algorithm (the Gillespie stochastic simulation algorithm
[8]) to simulate Petri nets stochastically; alternative algorithms are scheduled
for further developments.
Hybrid. With the progress of modelling and simulation, it becomes crucial to
handle systems involving some degree of complexity. Such models can often not be
executed using exclusively either the deterministic or the stochastic paradigm. As
an example consider the model in [14]. Thus, a hybrid method that combines both
discrete and continuous places as well as stochastic and continuous transitions is required [11]. S 4 provides the ability to execute such a model via the hybrid approach
applying either static or dynamic partitioning [10,11]. In the former, place types
(discrete/continuous) and transition types (stochastic/continuous) are explicitly
specied by the modeller, while in the latter, place as well as transition types are
changed on-the-y during the simulation based on some dynamically determined
measures (e.g., the current values of the transition rates).
Other Simulators. For more exible functionality, S 4 allows advanced users
to adopt external solvers to produce the model dynamics. This feature is specifically useful if legacy code exists that has been maintained and debugged over a
long time.
#
#
#
!
"
380
Fig. 3. The S 4 architecture. The core components are the models, which consist of the
Petri net denition and the result views. Additionally, each model is associated with
an internal simulator. S 4 can communicate with an external simulator or GUI client
by an API library. Snoopy also adopts the API library to communicate with S 4 .
Architecture
Models
The basic building blocks inside S 4 are the models. Multiple models can reside
in the server memory, and they can run simultaneously. When a new Petri net
is submitted via the GUI or the API, a new model data structure is created. A
model consists of two main components: the Petri net denition and the model
result views.
The Petri net denition captures the main model components. It consists of
all necessary information that are related to places, transitions, and arcs.
Result views are elegant tools to view the simulation results from dierent
perspectives. They can be dened by a user and submitted to S 4 in order to
381
be shared by other users connected to the same model. Each model can contain
several, dierent views. Views are specied by selecting a set of places and/or
transitions for which the progress shall to be monitored. Additional information,
such as visualization methods and curve colours, can also be specied.
3.2
Internal Simulators
Each model is associated with an internal simulator to produce the model dynamics. Dierent simulators that are associated with dierent models can run
simultaneously by creating an individual thread for each running simulation. The
supported algorithms are sketched in Section 2.6.
3.3
Clients
Comparison
382
14000
20000
concentration
concentration
12000
10000
8000
15000
10000
6000
4000
5000
2000
0
0
100
200
300
time
(a)
400
500
100
200
300
400
500
time
(b)
Fig. 4. Simulation results of the GHPN model for circadian oscillation. (a) The same
key parameter values are used throughout the whole simulation time. (b) Dierent
values are used during the running simulation, fed by the steering feature.
Installation
383
Acknowledgements. The authors would like to thank Christian Rohr for his
valuable comments during the implementation of S 4 . We would also like to acknowledge the work of Fei Liu for implementing coloured Petri nets in Snoopy.
References
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
384
18. Matsuno, H., Nagasaki, M., Miyano, S.: Hybrid Petri net based modeling for biological pathway simulation. Natural Computing 10(3), 10991120 (2011)
19. Nagasaki, M., Saito, A., Jeong, E., Li, C., Kojima, K., Ikeda, E., Miyano, S.: Cell
Illustrator 4.0: a Computational Platform for Systems Biology. Silico Biology 10
(2010)
20. Rohr, C., Marwan, W., Heiner, M.: Snoopy - a unifying Petri net framework to investigate biomolecular networks. Bioinformatics 26(7), 974975 (2010) (Advanced
Access published February 7, 2010)