Slow Intelligence System - Petri Net component
by Callen Shaw

About
-----------
This code was developed in Nov/Dec 2010 for Dr. Chang's
CS2650 course, Distributed Multimedia Systems.  It
demonstrates a working Petri Net simulation, whose 
events can be directly linked to the course's Slow
Intelligence System software.  The SIS-Testbed folder
contains a modified version of this software, while the
rest of this directory houses the eclipse project for
the Petri Net Simulator.


Using It
-----------
A demonstrative batch script was created to launch the
components necessary to see the Petri Net Simulator in
action.  Run "guided demo script.bat" in this directory
to launch the demo.  


Really Using It
-----------
Assuming you are familiar with the SIS Testbed, you can
launch the Petri Net simulator as follows.  First,
run the Server and PrjRemote programs.  Use the remote
to send Server a MsgID=20, with the component Name
defined as your PNML <net>'s id attribute.  Then run
the Simulator on a PNML file by running:
   java -cp ./bin NetSim <input.pnml> [serverAddress] [port]
Where serverAddress and port default to 127.0.0.1:7999

This will launch the interface.  It immediately begins
simulating the Petri Net, so if any initial tokens are
placed, Transitions may fire right away.  The best way
to prevent this is by placing a "control" Place (that
is initially tokenless) as input to any Transition to 
control.

By clicking on a Place, you can see its PNML details,
and have the option to put a token on the Place.

By clicking a Transition, you can see its PNML
details, and can also edit the SIS message that is
sent when the Transition fires (OnFire).  OnFire
events are described below.


SIS Interaction
-----------
The Petri Net component must be instantiated to the SIS
with message 20 (Create), but note that 
   The Name of the component must be defined to match
   the id attribute of your PNML file's <net> element!

The component will accept message (MsgID=1000), which 
signals that a Petri Net Place should gain a token. The 
fields for this are as follows:
   NetID: id attribute of your PNML file's <net> element
   PlaceID: id attribute of the PNML <Place> element

Each Transition can be defined to send a message, with
custom data, to the SIS system.  In the XML Editor, the
user can define a MsgID and series of Key/Value pairs
that define a SIS message.  When that transition fires,
the component sends this message to the SIS Server. The
XML Editor can also load an SIS XML message from the
filesystem and the fields will populate automatically.

