PaulSanchez / SimpleKit-Python

An event-graph based discrete-event simulation engine implemented in Python
2 stars 1 forks source link

SimpleKit question from long ago Simkit user (Java) #1

Open misken opened 2 years ago

misken commented 2 years ago

Hi Paul, I ran across an answer of yours in the [simpy] channel of StackOverflow. I'm guessing you are the same person who was involved in Arnie Buss's Simkit project at NPS? I used to use simkit extensively for large scale DES work in the healthcare world. I've fallen away from Java programming and use Python extensively now in both my teaching and research. I've done a fair bit of DES modeling with SimPy (see http://www.sba.oakland.edu/faculty/isken/courses/mis6900_s22/mod4_des_simpy.html) but haven't really used it for industrial strength simulation work. I'm working on such a model now, but SimPy development seems to have stopped and I'm always looking around for Python DES alternatives. I, like you I'm guessing, like the "event graph" approach and have often wished for a Python based Simkit. I've only glanced at your SimpleKit-Python code but thought I'd ask about its status. Do you see SimpleKit-Python as just for basic models for teaching DES or does it have potential for being the basis of a first class DES library for Python? Also wondering if any of your teaching materials are available, like the old Simkit stuff used to be? Anyway, thanks for sharing SimpleKit-Python. Mark

PaulSanchez commented 2 years ago

On Oct 24, 2022, at 2:27 PM, Mark Isken @.***> wrote:

Hi Paul, I ran across an answer of yours in the [simpy] channel of StackOverflow. I'm guessing you are the same person who was involved in Arnie Buss's Simkit project at NPS?

Hi Mark.

Arnie and I were in the same grad school cohort from Cornell, and have remained friends since. Arnie had a different advisor, but my advisor Lee Schruben was a mentor to Arnie, and hired him as a research assistant once he completed the PhD but was on the market looking for his first academic position. We both had input to Lee’s initial paper on event graphs and event based modeling. Arnie invited my wife Susan and me to come out to NPS in 1999 for a sabbatical year, and we ended up staying. I did some work with him on loosely coupled component modeling, but was not a contributor to the SimKit codebase.

I used to use simkit extensively for large scale DES work in the healthcare world. I've fallen away from Java programming and use Python extensively now in both my teaching and research. I've done a fair bit of DES modeling with SimPy (see http://www.sba.oakland.edu/faculty/isken/courses/mis6900_s22/mod4_des_simpy.html) but haven't really used it for industrial strength simulation work. I'm working on such a model now, but SimPy development seems to have stopped and I'm always looking around for Python DES alternatives. I, like you I'm guessing, like the "event graph" approach and have often wished for a Python based Simkit.

I’m not a big fan of SimPy, I strongly prefer event scheduling to process modeling. I feel the latter gets convoluted very quickly.

I think Arnie did some very creative work with SimKit, but I also had a few nits to pick. I also had a very different goal than Arnie had—I wanted a teaching tool where the internals could be exposed to people, so I actually set as an objective that the engine in SimpleKit should fit on one sheet of paper so it could be a self-contained handout. Generation 1 was written in Java and used in a Winter Simulation Conference intro tutorial on the basics of simulation modeling (which has since been updated to be the tutorial found on the simplekit git repository). Generation 2 was written in Ruby, and is the one I personally tend to use. A high school summer intern wanted to do something with Python, so I worked with her to port the Ruby version over.

I've only glanced at your SimpleKit-Python code but thought I'd ask about its status. Do you see SimpleKit-Python as just for basic models for teaching DES or does it have potential for being the basis of a first class DES library for Python?

Susan and I have used it for “real” work. We developed a very large “pseudo” agent-based model for studying ebola, and ported that over to look at COVID as well. We also have used it for a couple of logistics models, had another summer intern convert the ebola model into a California wildfire propagation model, had a German student who used it for studying maintenance and availability of their helicopter fleet, a Turkish student who used it to simulate Hughes’ salvo equations, and another student who used it to model a potential fleet of autonomous supply ships capable of unmanned mid-ocean rendezvous and resupply missions, to name a few. Nevertheless, I haven’t tried to promote or push it in any way, since it was conceived as a pedagogical tool.

Also wondering if any of your teaching materials are available, like the old Simkit stuff used to be? Anyway, thanks for sharing SimpleKit-Python. Mark

I don’t really have teaching materials other than the updated WSC paper that comes with SimpleKit. My research domain has been the output analysis side of the fence, a field that has come to be known as “data farming”. SimpleKit was built to be simpler and more accessible than SimKit, so that I could introduce it to people very quickly in data farming workshops and then move on to our real objective of showing the benefits of large-scale designed experiments.

If you were happy with Arnie’s Java version of SimKit, you’d probably like his port of it to Python. I’d be happy to supply you with his e-mail.

Another alternative is to go back to the original source — Lee Schruben wrote a modeling tool called Sigma, and a book to go with it. He’s retired now, but the book is available and I think Lee still sells Sigma as a commercial product.

Thanks for both your interest and your kind words!

Regards, —Paul

misken commented 2 years ago

Thanks so much, Paul, for the detailed response. Having been an avid simulator since my grad school days in the late 1980's (UMich IOE), I love learning more about simulation history. Yes, I've read your "loosely coupled" paper and still have a file of all of the SimKit materials. My most ambitious model was for analyzing hospital based pneumatic tube systems and SimKit worked wonderfully for that. I had started working on a Java library of healthcare specific modeling components meant to be used with SimKit but then it stalled. My real goal that I'd like to accomplish to some extent before I retire, is to release a library of healthcare specific models (inpatient flow, emergency department, surgical services, ...) that are usable in real projects by an analyst with decent Python skills. Healthcare is littered with tons of models created in various proprietary packages (Arena, MedModel, Simio, and on and on) that can't be examined nor extended by the broader healthcare simulation community. My inspiration was projects like the ns-2 simulation library for network simulation.

Periodically I've checked on the status of SimKit but did not realize that Arnie had ported it to Python. Has he released it publicly? Yes, I'd love to check it out if that's possible.

Since I teach in a business school, SimPy has been fine for the little simulation module I include in one of my classes on Python based analytics. It does provide a nice motivating example for the use of generators. However, right now I'm mired in the details of how to architect an industrial quality patient flow model using SimPy which has me questioning if SimPy is the right tool. We'll see.

PaulSanchez commented 2 years ago

Mark, Arnie, it’s my pleasure to introduce you to each other.

Arnie - by way of background, Mark read an answer I wrote on stackoverflow and tracked me down through my git repository for SimpleKit. He has used SimKit/Java in the past but became a Python user. I told him that my goals were different from yours - you wanted a full-featured simulation engine, I wanted a teaching tool for a WSC tutorial 15 years ago that fit as a handout on a single sheet of paper. And here we are.

—Paul

Begin forwarded message:

From: "Buss, Arnold (Arnie) (CIV)" @.> Subject: Re: Python SimKit implementation Date: October 25, 2022 at 9:49:46 AM PDT To: Paul Sanchez @.>

Yes, that’s my development repo of my port of Simkit to Python. The best way to install it however is from the PyPi site (https://pypi.org/project/DESpy/) using pip.

I wanted the OR students to have a chance to use Event Graph simulations, but as you’re aware they have Python these days. Python does have a few nice features -actually the best is the PyPi site to install & update projects. The nice thing is that when there is an update, it is very easy for the user to install it (again this pip thing).

Overall coding in Python was excruciating for me, but I somehow got it done. I haven’t worked on it in a while – it’s not as fully featured as Simkit, but it gets the job done. One feature form Simkit I’d like to add is the ability to have multiple event lists running in different threads, something I put into Simkit awhile back and has proved to be very handy for the models I’ve been writing for NAVSUP.

So far two students have used DESpy for their thesis (1 OR and 1 CS), so it’s survived two whacks from users.

Anyway, I’d be happy to talk to this person, so put them in touch.

-Arnie

misken commented 2 years ago

Thanks much, Paul. I'll contact Arnie via email from my university email account. I can't believe I hadn't stumbled across his Python port over the years.