Browse files

example

  • Loading branch information...
1 parent 7c862ad commit 3e8036e1bcd0e3289cee10699bb58b6e174cea9a Richard Metzler committed Jul 10, 2009
Showing with 28 additions and 1 deletion.
  1. +28 −1 README
View
29 README
@@ -1,3 +1,30 @@
This is a really simple Petrinet written in Java.
-Why doesn't GitHub update anything?
+Here is an example on how to use it and display a it in a really simple and basic "gui".
+
+package petrinet.gui;
+
+import petrinet.logic.Arc;
+import petrinet.logic.Petrinet;
+import petrinet.logic.Place;
+import petrinet.logic.Transition;
+
+public class ImWechsel {
+
+ public static void main(String[] args) {
+ Petrinet pn = new Petrinet("Wechsel");
+ Transition t1 = pn.transition("t1");
+ Transition t2 = pn.transition("t2");
+
+ Place p1 = pn.place("p1", 1);
+ Place p2 = pn.place("p2");
+
+ Arc a1 = pn.arc("a1", p1, t1);
+ Arc a2 = pn.arc("a2", t1, p2);
+ Arc a3 = pn.arc("a3", p2, t2);
+ Arc a4 = pn.arc("a4", t2, p1);
+
+ PetrinetGUI.displayPetrinet(pn);
+ }
+
+}

0 comments on commit 3e8036e

Please sign in to comment.