简体   繁体   中英

Can I create and store a snapshot of a simpy simulation?

I am building a simulation of a production process using simpy and an agent (Heuristic or Reinforcement Learning via tensorforce) that allocates orders to stations in the production system.

Every simulation starts with an empty production system that is slowly getting filled with orders. In order to analyze my agents, I would like to see how they perform without that warm-up phase that initially fills the empty production system.

Is there a way to create and save a "snapshot" of a simpy simulation from which I can start at a later stage with different parameters (ie, a different agent) again?

I have read through the simpy docs but could not find such a functionality. My current workaround is starting the simulation every time with an empty production system and changing the agent once the system is fully utilized. However I want to get away from this approach as it wastes a lot of computational time.

Your help is highly appreciated. Thank you very much!

Different to running the simulation from the beginning every time, you might also choose to implement custom methods for serializing and initializing the model state at any point in time.
This SimPy-based project for example uses that approach by initializing the model of a simple production system with already started orders at different steps of the process, hereby accouting for already elapsed processing times at the start of the simulation (based on one of the ideas of this paper ).

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