Giter Club home page Giter Club logo

cpn2pn's Introduction

cpn2pn

Transform Coloured Petri Nets in PNML format to equivalent Petri Nets

This project is written for python 3.6+ and uses the dependency multiset, which can be installed by:

$ pip install multiset

Usage:

This project is written as a module called CPNParser, which contains the models used for reading Coloured Petri Nets in PNML format, the code for unfolding the net, and the model for Petri Nets, which can be converted to PNML format.

The input file must follow the PNML standard for symmetric nets in order to be parsed. More information on the standard can be found at pnml.org and in this paper.

Command line

In order to access this functionality from the command line, the tool convertCPN.py was written. To get help, use:

$ convertCPN.py -h
ConvertCPN is a tool that converts a colored Petri net in the PNML format, to a P/T net,
and prints the P/T net to stdout in PNML format.

Usage:
  convertCPN.py [options] <source>

  Where <source> is the file to convert.
  Note: stderr is used for outputting inconsistencies with the PNML standand.

Options:                                                                                                                                          
  -h, --help                Prints this text.                                                                                                     
  -o, --output-file <file>  Prints the PNML to the specified file instead of stdout.                                                               
  -v, --verbose             Prints additional information such as size of input and output.

TODO

  • Rewrite tests to not require not included files
  • Make the single- and multi-threaded sections as functions (found at comments "# TODO:1")

cpn2pn's People

Contributors

viphor avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

thanh-tuan

cpn2pn's Issues

TypeError: 'NoneType' object is not iterable

Hi,
I'm Stefano and I would like to ask you a question.
I folllowed your instructions, but I have this error:

$ python3 convertCPN.py -v '/home/perone/Documenti/Example.pnml'
Traceback (most recent call last):
File "convertCPN.py", line 111, in
commandsarg
KeyError: '/home/perone/Documenti/Example.pnml'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "convertCPN.py", line 113, in
run()
File "convertCPN.py", line 32, in run
cpn = CPNModel(sys.argv[len(sys.argv) - 1])
File "/home/perone/Documenti/cpn2pn-master/CPNParser/CPNModel.py", line 225, in init
self.__parse_types()
File "/home/perone/Documenti/cpn2pn-master/CPNParser/CPNModel.py", line 235, in __parse_types
for decl in decls:
TypeError: 'NoneType' object is not iterable

Is it possible that the problem is .PNML file? What is the tool that you used to generate the CPN?
Best reguards,
Stefano.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.