This is an implementation of Petri net.
Install it by the following command:
npm install --global @cicada-lang/petri-net-js
The command-line program is called petri-net-js
.
petri-net-js repl # Open an interactive REPL
petri-net-js run [path] # Run a Petri net program
petri-net-js help [name] # Display help for a command
transition processComplaint(
place input: Complaint
------------------------
place output: ComplaintArchive
) {
(input) -> [register] -> (c1, c2)
(c1) -> [sendQuestionnaire] -> (c3)
(c3) -> [processQuestionnaire] -> (c5)
(c3) -> [timeout] -> (c5)
(c5, c6) -> [archive] -> (output)
(c2) -> <evaluate> -> (c6, c7)
(c5, c7) -> [processComplaint] -> (c5, c8)
(c8) -> <checkProcessing> -> (c6, c7)
}
begin {
place input: Complaint
place output: ComplaintArchive
(input) -> [processComplaint] -> (output)
@send(input, Complaint(1, "xieyuheng"))
@send(input, Complaint(2, "xieyuheng"))
@send(input, Complaint(3, "xieyuheng"))
@receive(output, printComplaint)
}
npm install # Install dependencies
npm run build # Compile `src/` to `lib/`
npm run build:watch # Watch the compilation
npm run test # Run test
Papers:
- Communication with automata, Carl Adam Petri, 1966 (the founding paper).
- The Application of Petri Nets to Workflow Management, Wil van der Aalst, 1998.
To make a contribution, fork this project and create a pull request.
Please read the STYLE-GUIDE.md before you change the code.
Remember to add yourself to AUTHORS. Your line belongs to you, you can write a little introduction to yourself but not too long.