This is an implementation of Petri net.
Install it by the following command:
npm install --global @xieyuheng/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: