proxy.golang.org : github.com/dalzilio/nets
Package nets defines a concrete type for Time Petri Nets and provides a Parser for building Nets from the textual description format used in the Tina toolbox (see below). We support a very general subset of the description format for Time Petri nets found in the Tina man pages (see http://projects.laas.fr/tina/manuals/formats.html). We explain some of our restrictions below. All the files successfully parsed or printed using the library are valid .net file A net is described by a series of declarations of places, transitions, priorities and/or notes, and an optional naming declaration for the net. The net described is the superposition of these declarations. The grammar of .net declarations is the following, in which nonterminals are bracketed by < .. >, terminals are in upper case or quoted. Spaces, carriage return and tabs act as separators. Labels may be (optionally) assigned to places and transitions, but we do not support the use of a "lb" declaration, for labels, that was only kept for backward compatibility. We also do not support stopwatches and reset arcs. Grammar Two forms are admitted for net, place and transition names: ANAME : any non empty string of letters, digits, primes (’) and underscores (_) ’{’QNAME’}’ : any chain between braces, and in which the three characters "{,}, or \" are escaped with a \ Empty lines and lines beginning with ’#’ are considered comments. In any closed temporal interval [eft,lft], one must have eft <= lft. Weight is optional for normal arcs, but mandatory for test and inhibitor arcs. By default: transitions have temporal interval [0,w[; normal arcs have weight 1; places have marking 0; and transitions have the empty label "{}" When several labels are assigned to some node, only the last assigned is kept. When a transition is associated with several timing intervals, we keep the intersection of all the intervals (the result must not be empty). It is also possible to list transitions associated with a place, in a pl declaration. Arcs defined in this way are added to the respective transitions. This is a simple example of .net file. Note that it is possible to have several declarations for the same object (place or transition); the end result is the fusion of all these declarations. This example shows the basic usage of the package: Parse a .net file and output the result on the standard output. Since the net has priorities, we also compute the transitive closure of its priority relation (a call to PrioClosure). Note that we print the number of places and transitions of the net, as a comment, but that we strip the original comments found in the file. This example shows how to use the result of parsing a .net file to find the number of transitions in a net. This example shows how to output a Net into a PNML Place/Transition file.
Registry
-
Source
- Documentation
- JSON
purl: pkg:golang/github.com/dalzilio/nets
Keywords:
petri-nets
, pnml
, tina
License: AGPL-3.0
Latest release: 3 months ago
First release: almost 4 years ago
Namespace: github.com/dalzilio
Stars: 6 on GitHub
Forks: 0 on GitHub
See more repository details: repos.ecosyste.ms
Last synced: 8 days ago