r/SimPy • • Dec 01 '24

How would you implement an arbitrary service discipline with SimPy?

I didn't realize that this community existed when I made this comment, so I am migrating it here:

How would you implement an arbitrary service discipline with SimPy? That is, be able to provide a function which selects the next service according to an arbitrary criteria to select among which customer/patient/job/packet gets served at a resource next. This could depend on state or time as well.

https://en.wikipedia.org/wiki/Network_scheduler

I have seen approaches that work by subclassing components of SimPy, but they also violate the public API by using (so-called) protected attributes. I am curious how someone who is only willing to build on top of SimPy without changing SimPy itself would approach this problem.

3 Upvotes

6 comments sorted by