简体   繁体   中英

Simpy: Add process during runtime

Is there a way to add a SimPy process to a SimPy environment when the latter is already running? The context is as follows:

I have successfully implemented a queueing network for a traffic system using SimPy, where cars are propagated across links. The origin and destination of each car is known at "compile" time, as is their departure time. The simulation thus describes how they are moved across the network, where the propagation speed depends on the prevailing densities. If there is a lot of cars on a link, their speed decreases, as in reality. If there are too many cars on a link, they are retained from entering until another car has left, etc.

My question now would be, can I also supply the traffic demand during run time? Imagine there's an overarching process that generates cars in real-time, when my SimPy simulation is already running. How could I do this? Is there any tutorial or example available?

Any help or comment is most appreciated.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM