Skip to content
This repository has been archived by the owner on Oct 3, 2023. It is now read-only.

Provide a sleep function in modbat.dsl.Model #40

Open
cyrille-artho opened this issue Feb 26, 2019 · 0 comments
Open

Provide a sleep function in modbat.dsl.Model #40

cyrille-artho opened this issue Feb 26, 2019 · 0 comments
Assignees

Comments

@cyrille-artho
Copy link
Owner

Currently, stay allows a model to stay dormant for a while. The new code (issue #33) will integrate this functionality with an implementation that supports virtual time. This allows us to skip ahead to the next event, instead of waiting with Thread.sleep.
If we use this in a simulated environment, the environment also needs to be able to skip time. We therefore need to provide a custom sleep function in the model.
If virtual time is used, Model.sleep internally calls advance on the virtual timer instead of sleeping.
Later on, we can also support real time, where all calls to advance are replaced with Thread.sleep.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants