Skip to content

Kalasim v0.8

After some more months of continued refinements, extensions and refactorings, and - for sure - a sightly number of new simulations across different domains and industries, we present with great pleasure the next milestone v0.8 release of kalasim!

kalasim v0.8 has matured considerable across the entire API. From a small experimental API it has grown into a battle-tested real-time scalable open-architecture simulation engine, designed not just for engineers, but for business process analysts and industrial engineers who need to go beyond the limitations of existing simulation tools to model and optimize their business-critical use-cases.

New Features

With this milestone release, we have further stabilized its core API, improved its performance while adding new features all over the place.

Major enhancements in this release are

  • Support for kotlin.time.Duration across the entire API. Processes can be expressed much more naturally using time-units:
val sim = createSimulation {
    object : Component() {
        override fun process() = sequence {
            // some action
  • Added new options to model resource honor policies allowing for more configurable request queue consumption

    val r  = Resource(honorPolicy = RequestHonorPolicy.StrictFCFS)

  • Added Timeline Arithmetics. It is now possible to perform stream arithmetics on timeline attributes

  • We have reworked and simplified depletable resources. This enables a wide range of new use-cases. See lunar mining for a great example. As part of this feature, we have introduced different request modes to model resources requests that exceed resource capacity.
    val tank  = DepletableResource(capacity=100, initialLevel=60)
    put(gasSupply, 50, capacityLimitMode = CapacityLimitMode.CAP)
  • A new animation submodule to visualize process simulations was added. To keep the core API minimalistic, a new dependency adds all required dependencies from OpenRendr. This additional dependency also provides complimentary utilities such as AnimationComponent to streamline rendering. To demonstrate the capabilities, we have worked out several examples such as the moon base and the office tower.

Other notable enhancements in this release are a streamlined predicate consumption in wait(), more supported statistical distributions, improved bottleneck analysis using resource request-ids and RequestScopeContext in honor block. First community PRs were merged, in particular #35 which improved the support for asynchronous event consumption.

For a complete list of technical changes in the v0.8 milestone release check out our change log.

Example & Documentation Improvements

Several new examples were added as part of this release. First, we explored resource mining on the moon, where we don't just demonstrate how to model a complex mining and logistics operation, but also showcase how to animate this process. In the office tower we explore capacity planning via an interactive UI to size elevators in a busy office building.


Different individuals and organizations made this milestone release possible. Most importantly, we'd like to thank SYSTEMA GmbH for supporting the project.

Next steps

While improving kalasim, we have dropped some roadmap items sketched out earlier.

  • Environment snapshotting & branching: While we still believe that this would be highly beneficial, the feature is currently blocked by issues with serialization of kotlin objects (in particular coroutines)
  • We have evaluated but eventually dropped the idea of algebraic composability of simulation environments. Mainly because instances of org.kalasim.Environment can be configured to be incompatible on various levels which can't be resolved with a simple +

Next on our roadmap are various open tickets as well as the following meta-tasks

  • The next release is likely to enforce a tick-duration (seconds, hours, etc.) for any simulation. Along with that, to improve the type-safety and readability of process definitions, we will start replacing all - essentially untyped - tick-time duration method arguments with kotlin.time.Duration equivalents.
  • Better examples & better teaching materials: We will continue to release more complex simulations with thousands of simulation entities (in particular finishing the emergency room), along with protocols on how to analyze and optimize dynamics in such systems.
  • Improved kotlin-jupyter integration to bring more control and introspection functions into the browser.

Please note, that the kalasim APIs will be subject to breaking changes until a first major release.

If you think that kalasim is missing some important feature, please just let us know.