Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

report + step are not working #1

Closed
j2l opened this issue Feb 5, 2022 · 5 comments
Closed

report + step are not working #1

j2l opened this issue Feb 5, 2022 · 5 comments

Comments

@j2l
Copy link

j2l commented Feb 5, 2022

Hello,

I tried your example and got stuck.

petri> load p1.json
loaded...
petri> report
Did not recognize: report
petri> report p1
Did not recognize: report
petri> send L-sensor-1 3
EMIT: Pump1: 1
EMIT: mixer2: 1
<
petri> step
Did not recognize: step
petri> 

It looks like the last commit removed them.

BTW, does your code is more a FSM (single path) or can it manage a real petri network?

@rleddy
Copy link
Owner

rleddy commented Feb 5, 2022

First - thanks for stopping by. I have been hoping someone would find something wrong or anything. So, this is actually a good step.

I am just having a look. Happy to help. I will tell you when I get this back in. Maybe soon. Might be tomorrow, depending on my day.

Last Q: This is a Petri model. So, it is multi-path. E.I. it is designed that way. It is not regulated by matrix multiplication, however. It moves tokens from place to place.

@rleddy
Copy link
Owner

rleddy commented Feb 5, 2022

OK. I have not fixed it yet. But, yes.. it got removed.
Basically, I made another version I called run-petri-async
So, files got swapped. Since there is any interested, I will straighten it out. I have some links on npm to fix as well.
I used the code to write a tutorial I put on codementor. And, here it is four years later. So, this is not very prolix. But, I got sloppy at some point. What I had for the article tutorial was a server for a web page that shows petri marking on an SVG graph. I have to find that code, too.

I will tell you when it is up to date.

@j2l
Copy link
Author

j2l commented Feb 6, 2022

SVG Graph? Fantastic @rleddy

I didn't know about run-petri-async.
I found your tutorial on CodeMentor

I know what you feel, if you search for the "Among Us" game clone, you get 458 results on github.
But the Petri Net which describes a natural process in the whole universe, AND a major way of programming and even debug programming language is poorly covered. Go figure.

I started with FSM (single threaded Petri Net with only one current state) in javascript (svelte), and discovered CPN which is lacking to be fully available in Javascript (design with graph (cytoscape would be great), import export JSON, run-execute in JS).

Have a great Sunday!

@rleddy
Copy link
Owner

rleddy commented Feb 8, 2022

Thanks for taking the time to check on things here.

I am going to close this issue after documenting and debugging. I will update the npm publication next. (I have added documentation in the code and updated the readme.md.)

So, it was good to revisit the code in the light of what I have been working on. I started with just making the simple Petri-net modules to help think about how to use the nets in ML and Blockchain. I have seen some work on using deep Petri-nets for ML.

I just made a page (nothing there yet) in copious-world for collecting stuff about Petri-nets. I want to put some matrix base implementations there as well as the network versions (networks are taking care of sparse matrix representations.) High level colored Petri-nets provide a powerful programming facility. It can correspond to the kind of computation expected in the use of Rete nets. Coloring corresponds to type checking and constraints. So, I might want to clarify some of that in the content on copious-world.

I see that you are working with Svelte. I don't know if that brought you here. But, I am adding a Petri-net diagramming component to copious-world/vedges (a word play on SVG). So, I can draw these now. But, it will takes some work to make it very smooth. So, I am using Svelte to wrap the drawing program. But, the output of the drawing package may be a different form of component collections.

Another hope I have for Petri-nets is that I would like my visual display to sync up with machines that talk to sensors and controllers. It seems to me that you could just relay markings between interfaces and servers.

Thanks again. Always looking for collaboration. I do not have money to pay people at the moment.

@rleddy rleddy closed this as completed Feb 8, 2022
@j2l
Copy link
Author

j2l commented Feb 9, 2022

Thank you very much for your update.
Add links and I'll see what I can do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants