A Brief Description of the PNtalk System
Contents
The OOPN formalism is characterized by a Smalltalk-based object-orientation
enriched with concurrency and polymorphic transition execution, which allow for
message sending, waiting for and accepting responses, creating new objects, and
performing primitive computations.
OOPNs are based on viewing objects as active servers which offer reentrant
services to other objects. Services provided by objects, as well as independent
activities of objects, are described by Petri nets -- services by method
nets, object activities by object nets. Tokens in nets represent
references to objects.
An OOPN consists of Petri nets organized in classes. Every class consists of an
object net describing the internal activity of objects of this class and a set
of dynamically instantiable method nets describing how these objects respond to
messages. All method nets of a given class share access to the appropriate
object net (places of the object net are accessible for transitions of method
nets). Each method net has parameter places and a return place. Class
inheritance is defined by the inheritance of object nets (Inherited
transitions and places identified by their names can be redefined and new
places or transitions can be added.), together with sets of method nets
(The implementation of inherited methods can be changed and new methods can
be added.). Classes can also contain predicate methods which allow for
atomic testing their objects' states without any side-effects.
Every object is either trivial (e.g. a number or a string) or it is an instance
of some Petri net-described class consisting of one instance of the appropriate
object net and several currently running instances of method nets. When an
object receives a message, a new instance of the corresponding method net is
created, parameters are put into the parameter places and the instance of the
method net is being executed concurrently with all other net instances until
the return place receives a token. Then the value of the token in the return
place is passed to the message sender as the result of the requested service,
and the instance of the method net is deleted. Message sending and object
creations are specified as actions attached to transitions. Execution of
transitions is polymorphic -- invoked methods depend on classes of message
receivers which are unknown at the compile time.
The basic notion of OOPNs is demonstrated by this
simple OOPN class, further
examples in the form of files which can be loaded into PNtalk can be found at
this URL. Similarly, next information about OOPNs can be obtained from the
articles which can be downloaded from the homepage of the
The Petri Net Research Group at the DCSE TU Brno, eventually from the
homepages of its members.
To obtain and install the PNtalk system, please perform the
following steps:
- Download the license agreement form, fill
it in and send it back to
vojnar@dcse.fee.vutbr.cz.
- Download the encrypted and compressed PNtalk image for Solaris or Windows
(about 2 MB).
- If you are using Solaris, decrypt the file pntalk.tar.gz.pgp by means of
the pgp utility (pgp -d pntalk.tar.gz.pgp), and uncompress the resulting file
by means of the standard gunzip and tar utilities (gunzip pntalk.tar.gz, tar
xvf pntalk.tar). If you are using Windows, uncompress and decrypt the file
pntalk.zip by means of pkunzip (pkunzip -s pntalk.zip). For decrypting use
the password which will be sent to you by e-mail after finishing the first
step.
- If you do not have the object engine, you can download it for using
together with PNtalk in Solaris or
Windows. After having downloaded it, you can decrypt
and uncompress it in the same as the image in the previuos step. In Solaris,
perform "chmod a+x oe20" to make the engine executable.
As for the new (free) version of VisualWorks (3.0), see the remark in the
section describing the PNtalk launcher ...
- Start the VisualWorks system using the command "oe20 pntalk.im" provided
that you are in the directory where there is the pntalk.im file stored and
that the system knows where to look for oe20 (if it is not in the same
directory). Subsequently you can adjust some parameters of the Smalltalk
environment (such as the amount of the initially allocated memory space --
default is 64MB in Solaris and 32MB in Windows). For further information see
the section Managing PNtalk.
- Start the PNtalk system from the VisualWorks Launcher by pressing the
button PNtalk (all other buttons and menu items do not concern PNtalk but
Smalltalk - see the section
Managing PNtalk).
In this section, there is described working with the Smalltalk environment in
which PNtalk runs (i.e. starting it, adjusting the initial memory consumption,
finishing it) and about the PNtalk Launcher which is a central tool of PNtalk.
A Minimum Information about Working with the Smalltalk System
- Starting the Smalltalk Environment
- Let us suppose that the system knows where the object engine oe20 is
installed. Then simply type oe20 pntalk.im in the directory where pntalk.im is
stored.
- Adjusting the Amount of Consumed Memory
- You can use the lines written in the window of the
VisualWorks system. Find a line with a suitable
amount of memory, use your mouse to highlight the appropriate command
ObjectMemory sizesAtStartup: #(....) (push down the left button, move
along the text, and release the button), use the middle button of the
mouse to launch a menu and perform the ``Do It'' action. Subsequently, perform
``File|Exit VisualWorks...'' with saving the image. Restart the system. If
there is no amount of memory suitable for your needs, you can create your own
line by means of suitably multiplying/diving numbers in some existing line
with some constant.
Note that you specify only the initial amount of memory, Smalltalk can
later occupy some additional memory space. The currently occupied amount of
memory can be find out by highlighting the prepared command
ObjectMemory dynamicallyAllocatedFootprint and performing ``Print It''
on it.
- Further Adjusting Smalltalk Parameters
- Use the menu item ``File|Settings''.
- Performing Garbage Collecting
- Before starting a simulation run, it is good to perform garbage collecting
-- use the menu item ``File|Collect all Garbage''.
- Exiting the Smalltalk Environment
- Use the menu item ``File|Exit VisualWorks...''. Choose ``Exit'' if you
have not created any code in Smalltalk, otherwise choose ``Save and Exit'' --
be beware, in this the size of image quickly increases, so do not use this
option unless it is necessary.
The PNtalk Launcher
The PNtalk system is an additional tool incorporated into the ParcPlace
VisualWorks Smalltalk environment. This environment allows us to write
Smalltalk classes, create graphical interfaces, communicate with databases,
etc. All these features can be used from the object oriented Petri nets as well
-- in this case, it is good to install the whole Smalltalk system and not only
the object engine oe20.
Nevertheless, it is of course possible to work with Petri nets only. In this
case, the VisualWorks system is used only for
launching the PNtalk system -- this can be done simple by clicking on the large
button with logo of PNtalk.
A new version of the whole VisualWorks system (VisualWorks 3.0) can be
obtained for free (Linux and M$ Windows version) from the WWW site of
ObjectShare which is a new name for
ParcPlace. However, it is impossible to run the current version of PNtalk under
the object engine (visualnc) from this version of VisualWorks because of
binary incompatibility of images for VW 2.0 and 3.0. Currently, we are trying
to import source files of PNtalk into VisualWorks 3.0 and produce the
appropriate image file but it seems that this will take some time because
there have been some (from our point of view) serious changes in the new
object engine :-(. Nevertheless, interested users can use VW 3.0 for developing
their own Smalltalk classes to be used within OOPNs. These classes can then be
``filed out'' from VW3.0 and ``filed in'' into VW2.0 and used within OOPNs.
The so called PNtalk Launcher is used as a control
panel of PNtalk -- it is possible to start all other tools from here. In
particular, a user can launch a browser, a debugger or a tool for manipulation
with breakpoints. It is also possible to start multiple browsers or debuggers
for working with various parts of the modelled system.
The launcher also contains buttons for OOPN class system compiling, for
adjusting various simulation options, and, of course, for
starting and terminating simulation runs. Before starting a
particular simulation run, the user must specify the main (primary)
class in the launcher. This will be used when starting the simulation in
such a way, that the simulator will automatically create one instance of the
main class.
Further, the PNtalk launcher is used for displaying the current status
of the PNtalk system, and also for displaying the current simulation
time during simulation runs. It also contains the so called
transcript which is used for displaying various system messages, computed
statistics, as well as user defined messages which can be sent from transition
actions.
The tool of PNtalk intended for editing nets is called the
PNtalk Browser and it can be started from the
PNtalk Launcher (see
Managing PNtalk). The window of the browser
is divided into three parts:
- the top left part containing a list of classes,
- the top right part containing a list of methods of the selected class,
and
- the bottom part containing the graph of the selected method or of the
object net if no method was selected.
Note that you can use more browsers at the same time.
In the following there are described menus which can be launched in different
parts of the editor and which are used for controlling it. If you know the
action you want to perform, we suggest you to try to find its description by
means of the ``Find'' command of your HTML browser.
The Class List Menu
If you press the middle button of your mouse on the top left part of the
PNtalk Browser, you will obtain a menu which will
allow you to perform the following actions which work with the selected class or
method:
- Add PNtalk Class.
- Delete PNtalk Class.
Note that it is impossible to delete a class with subclasses -- these
classes must be removed before.
- Rename PNtalk Class.
- Find PNtalk Class.
- Save PNtalk Hierarchy.
- Load PNtalk Hierarchy.
- Print Active Method. This item allows you to print out the net
displayed in the bottom part of the browser. You can print into a Post Script
file or an Encapsulated Post Script file.
Note that (1) when printing Post Script you can specify the position of
the net on the page by suitably placing it in the browser, (2) the clipping
region of Encapsulated Postscript is not computed properly in the current
version.
- Print All Nets. This item allows you to print out a set of TeX
documents and ``eps'' files documenting the whole model. A section
corresponds to every class and a subsection to every method. Net comments as
well as net graphs are placed into separate files.
Note that (1) this command works only under Solaris and you further
need to have the ps2epsi utility, (2) net comments are currently not
printed out.
- Edit Method Comment. This allows you to add some commenting text
to the selected method net or to the object net of the selected class if no
method is selected.
The Method List Menu
If you press the middle button of your mouse on the top right part of the
PNtalk Browser you will obtain a menu with the
following items:
- Add Class Method. This allows you to add a new method whose name
must be different from all names of predicates already present in the class,
its descendants, as well as ascendants.
- dd Class Constructor. Similar to adding methods.
- Edit Method Name. This allows you to change the name of the
selected method. The new name must be fulfill the same conditions as a name of
a new method.
Note that if you change the number of parameters or their names, all
arcs connected to the input places will be removed.
- Delete Class Method.
- Find Class Method.
- Edit Method Comment. This allows you to add some commenting text
to the selected method net or to the object net of the selected class if no
method is selected.
The Object Net Menu
If you select an object net (some class is selected in the top left part of the
PNtalk Browser, no method net is selected in the top
right part of the PNtalk Browser, and the graphical
representation of the object has black squares in its corners -- to achieve
this click on some free space inside the bounds of the object net), you can
launch the following menu by using the middle button of your mouse:
- Add Place. This allows you to add a new place into the selected
object net. If no name is specified, it is generated automatically, but the
default name is hidden.
Note that the name of the new place of the object net must be
different from the names of all places already present in the object net, in
its descendants, and also in all methods of the current class, as well as its
descendants.
- Add Transition. This allows you to add a new transition into the
selected object net. If no name is specified, it is generated automatically,
but the default name is hidden.
Note that the name of the new transition of the object net must be
different from the names of all the transitions and substitution transitions
already present in the object net and its ascendants.
- Add Substitution Transition. This allows you to add a new
substitution transition whose subpage corresponds to some class. All places
of this class can be used as input/output sockets (this will be restricted
in the next version of PNtalk, because it hampers the encapsulation
principle). On the other hand, places of the current object net can be used
as input/output ports. A correspondence between ports and sockets can be
established by drawing arcs between ports and the substitution transition and
inscribing them by the names of the appropriate sockets. Direction of arcs is
not important in this case.
Note that the name of the new substitution transition of the object
net must be different from the names of all transitions and substitution
transitions already present in the object net and its ascendants.
- Add Method. This allows you to add a new method net. Restrictions
of naming are the same as in the Method List Menu.
- Add Constructor. This allows you to add a constructor net.
Restrictions of naming are the same as in the Method List Menu.
- Add Predicate. This allows you to add a new predicate.
Note that the name of the predicate must be different from the names of
all the predicates already present in the current object net and also from
the names of all methods present in the current class as well as in its
descendants and ascendants.
The Method Net Menu
If you select a method net (some class is selected in the top left part of the
PNtalk Browser, some method net is selected in the
top right part of the PNtalk Browser, and the
graphical representation of the method net has black squares in its corners --
to achieve this click on some free space inside the bounds of the method net),
you can launch the following menu by using the middle button of your mouse:
- Add Place. This allows you to add a new place into the current
method net. If no name is specified, it is generated automatically, but the
default name is hidden.
Note that the name of the new place of the method net must be
different from the names of all places already present in the method net, and
in the corresponding object net.
- Add Transition. This allows you to add a new transition into the
current method net. If no name is specified, it is generated automatically,
but the default name is hidden.
Note that the name of the new transition of the method net must be
different from the names of all the transitions and substitution transitions
already present in the method net.
- Add Substitution Transition. This allows you to add a new
substitution transition into the current method net -- for more information
see the description of this item in the Object Net Menu.
Note that the name of the new substitution transition of the method
net must be different from the names of all the transitions and substitution
transitions already present in the method net.
- Object Net. This allows you to switch from the current method net
into the appropriate object net.
The Outer Method Net Menu
This menu is launched when some class and some of its methods are selected in
the appropriate list, but the graphical representation of the method net is not
selected (there are no black boxes in its corners -- to achieve this click on
some free space outside the bounds of the method net). This menu serves for
manipulating relations between object nets and method nets:
- Add Place from Object Net. By using this item, you can import a
place from the corresponding object net. This place can then be connected to
transitions of the method net which allows instances of the method to
manipulate states of the appropriate objects.
- Object Net. This allows you to switch from the current method net
description into the appropriate object net.
The Place Menu
This menu is launched when a place is selected (has black boxes round it -- to
achieve this click on it) and the middle button of the mouse is pressed:
- Add Arc. This item allows you to create a new arc. To do this,
select this item, then click the left button on the places of the desired
link points, and finish the arc by clicking the middle button on the
appropriate target transition, substitution transition, or predicate.
Subsequently you have to specify the arc expression. If this is empty, it is
equal to #e which represents a black dot in PNtalk.
- Edit Place. This allows you to change the name (under the
restriction of keeping it valid -- see the Object Net Menu), the initial
marking, and the initial action of the place.
Note that in the current version there is a bug that causes a name
assigned additionally to a no name place to appear only after repeated
redrawing of the editor window. The same is true when removing a name.
- Delete Place.
- Redefinition. You can use this item on inherited places
(displayed in the gray colour). It allows you to redefine the inherited
place, i.e. to change its initial marking, and initial action.
Note that after redefinition, all changes made on the original place
do not concern the redefined place and its descendants.
- Unredefinition. This allows you to revert the redefined place
back to its definition inherited from the ascendant.
- Show Name. This allows you to find out the generated internal
names of ``no name'' places which can be useful when looking for the sources
of syntactical errors announced by the compiler.
The Transition Menu
This menu is launched when a transition is selected (has black boxes round it
-- to achieve this click on it) and the middle button of the mouse is pressed:
- Add Arc. This item allows you to create a new arc. To do this,
select this item, then click the left button on the places of the desired
link points, and finish the arc by clicking the middle button on the
appropriate target place. Subsequently you have to specify the arc
expression. If this is empty, it is equal to #e which represents a black dot
in PNtalk.
- Edit Transition. This allows you to change the name (under the
restriction of keeping it valid -- see the Object Net Menu), the guard, and
the action of the transition.
Note that in the current version there is a bug that causes a name
assigned additionally to a no name transition to appear only after repeated
redrawing of the editor window. The same is true when removing a name.
- Delete Transition.
- Add Breakpoint. This allows you to put a breakpoint on this
transition -- for more information see the description of Debugging OOPNs.
- Redefinition. You can use this item on inherited transitions
(displayed in the gray colour). It allows you to redefine the inherited
transition, i.e. to change its guard, action, and surrounding arcs.
Note that after redefinition, all changes made on the original
transition do not concern the redefined version and its descendants. Further,
using this item causes all original arcs to be removed.
- Unredefinition. This allows you to revert the redefined
transition back to its definition inherited from the ascendant.
- Show Name. This allows you to find out the generated internal
names of ``no name'' transitions which can be useful when looking for the
sources of syntactical errors announced by the compiler.
The Substitution Transition Menu
This menu is quite similar to the Transition Menu, apart from that there cannot
be put breakpoints on substitution transitions.
The Arc Menu
This menu is launched when an arc is selected (has black boxes round it
-- to achieve this click on it) and the middle button of the mouse is pressed:
- Edit Arc Expression.
- Delete Arc.
- Double Headed Arc On/Off. This allows you to create testing arcs,
i.e. arcs which require some tokens to be in the appropriate places to enable
the appropriate transitions, but which do not remove these tokens.
- Add Link Point.
- Remove All Link Points.
Note that arcs going to/from method icons in object nets are not regular arcs
(they represent some arcs displayed in the definitions of the methods) and
therefore they cannot be manipulated in a the common way.
The Method Icon Menu
This menu is launched when a method icon (representing a folded net) is
selected (has black boxes round it -- to achieve this click on it) and the
middle button of the mouse is pressed:
- Edit Method Name. This allows you to change the name of the
selected method -- for more information please see the Method List Menu.
- Delete Method.
- Display Method Definition. This allows you to switch from the
current object net description into the appropriate method net.
The Predicate Menu
This menu is launched when a predicate is selected (has black boxes round it --
to achieve this click on it) and the middle button of the mouse is pressed:
- Add Arc. This is the same as in the Transition Menu, apart from
the fact that all arcs connected to predicates are implicitly set to be
testing.
- Edit Predicate. This allows you to change the name of the
predicate (when keeping the restrictions described in the Object Net Menu)
and its guard.
- Delete Predicate.
In the following there is sketched how to start, control, and terminate
simulation runs.
Starting the Simulation
When starting a simulation run you should do the following steps:
- Compile your OOPN by pressing ``Compile'' in the
PNtalk Launcher.
- If there were syntactical or simple semantical errors, their description
was printed out into the transcript of the
PNtalk Launcher and it is necessary to remove
their causes.
- If there were no errors, specify simulation options in the
``PNtalk Options'' dialog which can be launched
from the PNtalk Launcher. The following things
can be specified here:
- Simulation Mode. This specifies how the user will be able to
control the simulation run. The following options are possible:
- Automatic Mode. The user does not have a possibility to affect
the simulation run; all transition instances are fired automatically. We
can distinguish two submodes here:
- Normal Automatic Mode. Firstly all fireable transitions and
transition bindings are found, and then one transition binding is
chosen and fired.
- Fast Automatic Mode. As soon as the simulator, when checking
bindings fireability, finds one fireable binding, it immediately fires
this binding. Moreover, no information about the run is stored, thus
making it impossible to use the postmortem debugger, but avoiding a
long time necessary for parsing stored information after the end of the
simulation.
- Step-by-Step Mode. In this case, the simulator collects all
fireable bindings, those are shown to the modeller, who chooses which one
will be fired.
- Debug mode. The debug mode is exactly the same as the normal
automatic mode, except for the fact that breakpoints defined by the user in the
browser are taken into account.
Note that this mode has not been tested yet and can contain many
bugs -- for more details see the section
Known Bugs.
- Resume Mode. To be able to describe resume modes, we must review
conditions under which transition fireability can be changed:
- Some tokens are added to or removed from an input place of the
transition.
- The state of an object bound to a token in an input place is
changed. The change can concern either an OOPN object or a Smalltalk
object.
- The state of the object in which the transition instance is situated
is changed. This state can be tested by means of self or
super.
Generally, it is necessary to test transition fireability of affected
transitions after any change from the above list. The same result can be
achieved by testing the fireability of all transition instances before
every firing. This method is implemented in the strong resume mode,
but it is of course rather time consuming.
When we use PNtalk for modelling based on P/T Petri nets or coloured Petri
nets without using Smalltalk objects whose state can be changed, only the
first item of the above list must be taken into account. This is the case
of the so called weak resume mode.
Finally, the normal resume mode includes the entire weak mode, and,
what is more, it can detect changes of transition fireability caused by
state changes of OOPN objects in input places. This is true even if the
changed OOPN object is stored in a PNtalk list. This mode can also detect a
state change of the object in which the particular affected transition
instance is situated. So, the only difference between this mode and the
strong one is that it is unable to detect fireability changes caused by
changes of Smalltalk objects state.
- Simulation Time. You can specify whether to use simulation time
or not, and if so in what range.
- In the PNtalk Launcher, specify the main
class, i.e. the class whose instance should be automatically created at
the beginning of the simulation -- other objects and method net instance are
then created transitively from this object.
- Press the ``Run'' in the PNtalk
Launcher.
Note that before starting a longer simulation run it is sometimes
advantageous to make Smalltalk to clean its memory, i.e. to perform garbage
collecting -- use the menu item ``File|Colect all garbage'' from the
VisualWorks Launcher.
Controlling the Simulation
- If you chosen the step-by-step mode, a debugger window will be
launched after the start of the simulation and you will be able to control
the simulation from there -- for more details see the item
Debugging OOPNs.
- If you chosen the debug mode, a debugger window will be launched
as soon as one of the transitions with breakpoints becomes enabled.
- If you chosen the automatic mode, the simulation runs without any
influence from the side of the modeller till there is no enabled transition
or the maximum of the simulation time is exceeded. After the end of a
simulation run in the normal automatic mode, you can use the
postmortem debugger (which can be launched from the
PNtalk Launcher be the same button as debugger) to
have a look at the resulting net, but, in this case, be PATIENT -- it takes
some time (SOMETIMES VERY LONG) before the system parses all information
necessary to allow using the postmortem debugger. Eventual statistics are
printed out into the transcript after the end of the simulation (for details
see sections Managing PNtalk and
Using Time In OOPNs).
Interrupting the Simulation
There are two possibilities of interrupting the simulation, one is normal, the
second one should be used only in emergency:
- The normal way of interrupting simulation is using the
``Terminate'' button from the
PNtalk Launcher.
Note that it is sometimes necessary to keep mouse cursor with its
button down on ``Terminate'' for quite a long time (sometimes even longer
than a minute). In such a case, it is better to use the following
possibility.
- If the previous way does not work, you can try the following:
- Press SHIFT+CTRL+C.
- Type "Interface stopSimulation" into the window of the
Emergency Evaluator which should appear on the screen.
- Press Esc.
- Wait and pray.
Note that this manipulation need not to be successful and, moreover, it can
take quite a long time to stop all processes and then to parse messages
produced by them (in this there is already written ``STOPPED'' in the Launcher,
but you still cannot work ...).
The tool of PNtalk intended for debugging nets is called not surprisingly
the PNtalk Debugger and it can be started from the
PNtalk Launcher (see
Managing PNtalk). The procedure of starting
it is described in the section Simulating OOPNs.
The window of the debugger is divided into three parts:
- the left part containing a list of processes (i.e. object and method net
instances),
- the middle part containing the graph of method or of the object net
corresponding to the selected process,
- the right part containing information about the selected place or
transition instance.
Note that you can use more debuggers at the same time.
In the following there are described particular parts of the debugger.
The List Of Processes
The List of Processes is organized by using spaces on the beginnings of lines
in such a way that it creates a tree. This tree reflects relations caller x
launched method net instance and creator x created object. Processes correspond
to running net instances, i.e. instances of object nets (one for every object)
and instances of method nets (their number depends on how many times they were
called and how many of them have terminated).
Items in the List of Processes have the form: class_name [object_id] >>
method_name [net_instance_id]. The class_name specifies the class of
the object we are working with. The object_id is unique integer
identifying the object. The method_name is the name of the method the
process belongs to -- in the case of an object net, the name is object.
Finally, the net_instance_id is unique integer identifying the net
instance, i.e. the process. In the case of an object net, object_id =
net_instance_id - 1.
Items in the List of Processes can be typed in three ways:
- The default font is used for alive net instances but with no
enabled transition instances.
- The bold face font is used for net instances with enabled
transition instances.
- The italics is used for net instances which have already terminated
-- this can be used for method nets only.
You can launch a menu with the following items on the List of Processes:
- Scavenge. This allows you to remove lines concerning terminated
processes.
- Show/Hide Corpses. This allows you to decide whether you want to
see information about terminated processes or not -- but even if you decide
to hide it, it still exists.
The Display of Net Instances
This is the middle part of the PNtalk Debugger and
it displays the net of the net instance selected in the List Of Processes (see
above). Fireable transitions are drawn using thick lines. You can use this part
to select places and transitions (by simply clicking on them) you want some
information about -- this information will be described in the right part of
the debugger.
The Display of Information about Places and Transitions
This is the right part of the PNtalk Debugger. It
displays information about place and transition instance selected in the middle
part of the debugger.
In the case of a place, its current marking is displayed.
In the case of a transition, information about its fireable bindings and
about its invocations is printed out. As for the invocations, there is always
information about the unfinished ones and there can be also information about
the finished ones if they have not been scavenged yet. The information is
summarized in the message number_of_fireable_bindings
F/number_of_active_invocations T -- T means ``tail'' and it is an
obsolete term which arose from the implementation of PNtalk. Then you can use
the arrows on both sides of this information to view records about particular
bindings and invocations. In the case of bindings, there said to which
object the variables are bound. In the case of invocations, there is
also a list of processes which were launched within it.
By means of the middle button of your mouse, you can launch a menu on the right
part of the debugger which will allow you to do the following:
- Inspect. This allows you to go to the description of the process
whose number is contained in the line which is currently selected in the right
part of the debugger.
- Spawn Debugger. This allows you to start a new window of the
debugger.
This section describes the way how timing is incorporated into the current
version of PNtalk.
Note that when you want to simulate timed OOPNs you have to specify you are
going to use time in the
``PNtalk Options'' dialog which can be launched from
the PNtalk Launcher -- more information can be found in
the section Simulating OOPNs.
Structural and Value Aspects of Timing
Timing is joint with transitions in PNtalk and it is based on the
principle firing times, i.e. an enabled timed transition consumes input
tokens, but does not produce the output ones before some time passes. Values of
firing times can be specified by means of arbitrary Smalltalk methods.
Therefore it is possible to use deterministic timing, interval timing,
stochastic timing, as well as their various mixtures here. What is worse is
that in PNtalk there is currently only one possibility how to evaluate timed
nets (even with restricted timing) and this is by means of simulation.
From a syntactical point of view, transition delays can be specified by
means of using the method wait: which is implemented in the class
PN, i.e. in the parent of all PNtalk classes. Thus it is possible to
invoke this method in actions of all transitions by means of the message
self wait: delay where delay is an arbitrary Smalltalk
expression. For example, if we want to specify a deterministic delay of the
length 5, we write self wait: 5 in the action of the appropriate
transition.
As for generating stochastic delays, there are currently implemented two
random generators supporting it. The class Uni represents a
uniformly distributed generator and it can be used for generating random
numbers via the method l:min_delay h: max_delay, i.e. if
want to create a transition with uniformly distributed delay within the range 3
to 5, we place into its action the following construction: self wait: (Uni
l: 3 h: 5). Similarly, the class Exp represents an
exponentially distributed generator whose values can be sampled by means of the
method mv: average_delay. We can e.g. create a transition with
the action self wait: (Exp mv: n) where n is a variable on an input arc
of the transition. Other generators can be easily implemented but it requires
some knowledge of programming in Smalltalk -- an interested modeller can be
inspired by the code of classes Uni and Exp which are present in
the category PNtalk-Simulation-Support.
Collecting Statistics about the Behaviour of Stochastic OOPNs
If we use stochastic timing we usually want to derive average performance
characteristics of the modelled system, such as average waiting times, average
lengths of queues, etc. Collecting such kind of data is supporting by
statistics in PNtalk, i.e. by objects of classes derived form the class
PNStatistics which can be found in the category
PNtalk-Simulation-Support. This class monitors all instances of its
subclasses and after the end of simulation it reads data collected by the them
and prints them out to the transcript. Resulting data are collected by means of
calling the method printResultOn: aStream which must be
implemented in all subclasses of PNStatistics. Apart from that, it is
good to implement also the method printOn: aStream which is used
during debugging for collecting intermediary results for displaying them into
the debugger.
Apart from the restrictions presented in the previous paragraph, subclasses of
PNStatistics can be implemented in Smalltalk in an arbitrary way. Once
we have such classes we can use them in OOPNs. If we e.g. we want to create a
statistics describing some facility, we create some subclass
FacilityStatistics of PNStatistics. The we add a place
Stat into the OOPN class describing the facility. The constructor of
the facility can the create an instance of FacilityStatistics, e.g. by
the action facStat := FacilityStatistics withName: name (we suppose
withName: to be a Smalltalk constructor of FacilityStatistics and
name an input variable of the appropriate transition), and store it to
Stat. All methods seizing or releasing the facility must then read the
contents of Stat and send it some messages updating its contents.
Modellers interested in using statistics can be inspired by the example
``MedicalCentre'' which can be obtained at
this URL. The appropriate statistics are represented by classes
FacilityStatistics and GeneralStatistics in the category
PNtalk-Simulation-Support.
- If a no name element is created and then a name is additionally assigned
to it, the name does not appear immediately, but only after several
redrawing of the editor window. The same is true the other way round.
- If a subclass of some class is created and the OOPN is saved before
looking at this subclass, then when the OOPN is loaded in, inherited elements
of the subclass are misplaced.
- If a non existing method is called, the compiler only announces that
there is an unknown error in an unknown class.
- The mechanism of breakpoints is not elaborated and debugged enough -- it
seems that is completely unreliable. The simulation runs automatically till
some transition with a breakpoint is fireable, then it is interrupted and a
debugger window is launched, but after that the system behaves in an
indeterministic way ...
- It is necessary to manually center nets in the browser before printing
them out -- otherwise they can be printed on the edge of the paper.
- Sometimes when printing out transitions with long inscriptions the
graphical representation of the transitions is too small and the inscriptions
does not fit into it.
- Clipping regions of produced Encapsulated Postscript files are generated
in a wrong way.
- The right part of the debugger window is not automatically cleared when
switching from one process into another.
- Net comments are not generated into the appropriate TeX files when
generating the description of the whole model.
- Using the release method inherited from PN causes some
exception to be announced and the simulation is stopped.
- There is a possibility of intererleaving between removing tokens when
firing a transition and starting its action. This must be changed because it
is at variance with the definition of OOPNs.
If you have any comments to this document or to the PNtalk system itself
please send a message to
vojnar@dcse.fee.vutbr.cz.
Last modified at 15/6/1998.