usim icon indicating copy to clipboard operation
usim copied to clipboard

Pause/Resume simulation

Open maxfischer2781 opened this issue 4 years ago • 1 comments

Short description of the feature Allow to pause the simulation and later on resume it.

Describe the solution you'd like Simulation code should be able to pause at any time. This freezes the current simulation state.

async def some_activity():
     if time == 20:
        await usim.resume  # new call to pause simulation until resumed

Each simulation is represented by an object. usim.run returns this object when the simulation is frozen. The object allows unfreezing:

simulation = usim.run(some_activity())
print("Current state:", simulation)
simulation.resume()

Describe alternatives and the context you have considered There is currently no way to freeze a simulation.

maxfischer2781 avatar Jun 23 '20 12:06 maxfischer2781