Closed holgerbrandl closed 1 year ago
This would be a great improvement of the API, but it would currently block the use of kalasim in jupyter because of https://github.com/Kotlin/kotlin-jupyter/issues/351
It's not possible to separate the sub-tasks, as this would require to internalize the main implementation of Component.hold()
in https://github.com/holgerbrandl/kalasim/blob/01070aad938ab2cdd0967932848d17499f7819c0/src/main/kotlin/org/kalasim/Component.kt#L1285-L1302
So the fix needs to be stalled until the duration API support has been fixed upstream.
Fixed in v0.9 by marking non-typed usage as experimental. See https://www.kalasim.org/changes/#v09
When a user has defined a tick-transform in a model it should optionally support disallowing untyped use of
hold
etc.In a second iteration, kalasim may also want to enforce a tick-unit when creating a simulation (i.e.
val sim = Environment(TimeUnit.MINUTES)
). This would makehold(2)
impossible: The user would always need to state her intent about the duration by providing a tick-unit.FYI @MohidQaiser