Good example of someone making nice visuals to show what's happening in their sim?

223 views
Skip to first unread message

Mike Helsel

unread,
Feb 13, 2021, 6:23:59 PM2/13/21
to python-simpy
Hey All, 

Just wondering if folks know or have a good example of a SIMPY process or scenario that's well visualized in a notebook. Started using the library just a week ago and haven't found anything yet that is great at showing what's going on. 

Thanks,
Mike

is...@oakland.edu

unread,
Feb 15, 2021, 7:40:49 AM2/15/21
to python-simpy
I did a few Jupyter notebook based blog posts on some basic hospital patient flow modeling using SimPy. One post covers a non-OO process focused approach and the other an OO approach. The notebooks are downloadable from one of my Github repos.



Mark

Richard Tabassi

unread,
Feb 15, 2021, 12:28:30 PM2/15/21
to is...@oakland.edu, python-simpy
I use go.js, something like this example is pretty good https://gojs.net/latest/samples/processFlow.html or https://gojs.net/latest/samples/productionProcess.html

The code is pretty straight forward, you mostly need to wrap your output into a suitable json format. You could yield and push to the front end to get the effect you want, or set up an endpoint API and pull at a certain rate to update.  I usually use an Ajax call to an API then update with the json. 

They have a ton of examples and you can pretty easily layer in nearly anything you can think of.

Rich


--
You received this message because you are subscribed to the Google Groups "python-simpy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python-simpy...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python-simpy/921ee309-94a2-48a1-9e04-33b5a41c81b8n%40googlegroups.com.

is...@oakland.edu

unread,
Feb 15, 2021, 12:58:15 PM2/15/21
to python-simpy
Ah, I see I misinterpreted the question. Thanks for sharing the go.js idea. Very cool. Would you happen to have a shareable SimPy + go.js example?

Mike Helsel

unread,
Feb 15, 2021, 3:08:24 PM2/15/21
to python-simpy
Thanks, the challenge that I am having is bringing folks from a wide set of backgrounds to a common baseline understanding of a problem. My thought is that by showing more transparently different parts of a simulation visually, wherever possible, even if its representative, will make some progress in making sure folks have better base level understanding. 

Michael Gibbs

unread,
Feb 27, 2021, 12:01:25 AM2/27/21
to python-simpy
check out my posts of agent based pandemic simulation,
It has a simply pie chart of who is infected.

the trick is you really need two threads, one for the simulation and one for the graphics
It also helps if you put the simulation in loop and advance it one time tick at a time to ensure it releases all resources shared between the threads
Reply all
Reply to author
Forward
0 new messages