galenseilis / old_blog

Galen's Chirpy blog.
https://galenseilis.github.io/
MIT License
1 stars 0 forks source link

posts/ciw-external-schedule/ #11

Open utterances-bot opened 1 year ago

utterances-bot commented 1 year ago

External Schedule of Ciw Simulations | Galen's Blog

It would be desirable to make arbitrary changes to the state of a simulation according to a schedule. This is useful to simulating emergencies and disasters where the system has a change point where its behaviour changes substantially.

https://galenseilis.github.io/posts/ciw-external-schedule/

galenseilis commented 1 year ago

Should change (ops.func1) to (ops.func1,). Same for the other tuples of functions of length one.

galenseilis commented 1 year ago

Should change (ops.func1) to (ops.func1,). Same for the other tuples of functions of length one.

Fixed.

galenseilis commented 1 year ago

I think it could also be possible to wrap a Ciw simulation inside of a SimPy simulation. One could use SimPy as a process manager for these global changes. Might be warranted for more complicated cases than a linear sequence of predefined steps.

galenseilis commented 11 months ago

Actually, I am not sure that this approach would work. If memory serves, all of the instances of ciw.Individual get sent to the exit node if they are not there already at the end of the simulation. If that is the case then we would need to instantiate a new simulation instance with individuals already on the queues at the start.

galenseilis commented 11 months ago

Hmm, actually (again), I think such behaviour might be supported. See here.