/Label-petri-net

Simple label petri-net construction and visualize, built as an assignment.

Primary LanguagePython

Labeled-petri-net

This is the implementation of petri net for our assignment.

Visit here to get our code in github.

This assignment is separated into 6 files:

  • net.py contains all neccessary implementation classes to visualize the simple petri net.
  • asm1b_i.py constructs the Specialist petri net s_net and visualize desired transition system.
  • asm1b_ii.py uses s_net from asm1b_i.py to tackle the problem.
  • asm2.py constructs the Patient petri net p_net.
  • asm3.py merges s_net and p_net into the superimposed (merge) petri net m_net
  • asm4.py uses m_net and find reachable marking by firing one transition once.

Some packages are required for some actions:

  • Visualize the petri net: graphviz
    • Install pydot, pydotplus, pydot, pydot-ng: pip install pydot, pip install pydotplus, pip install pydot-ng.
    • Access this link and download the latest 32-bit Windows install package.
    • Add C:\Program Files (x86)\Graphviz\bin to user environment path. Click here to know more about it.
    • Add C:\Program Files (x86)\Graphviz\bin\dot.exe to system environment path.
    • Install graphviz: pip install graphviz. Restart computer to be enabled to use.
  • Organizing graphical files and folders: os, shutil
    • Install os: pip install os
    • Install shutil: pip install shutil