We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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:
usim.run
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.
The text was updated successfully, but these errors were encountered:
(Thanks for the work @maxfischer2781)
This would also allow to create functions to run a simulation step by step.
async def _step_activity(): while True: await usim.resume await (time + 1) def run_in_steps(*activities): return usim.run(_step_activity(), *activities) def step(simulation): simulation.resume()
and then use it via
simulation = run_in_steps(*some_activities) for i in range(100): step(simulation)
Sorry, something went wrong.
No branches or pull requests
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.
Each simulation is represented by an object.
usim.run
returns this object when the simulation is frozen. The object allows unfreezing:Describe alternatives and the context you have considered
There is currently no way to freeze a simulation.
The text was updated successfully, but these errors were encountered: