Skip to content

Kalasim Release History

v0.9 (Not yet released)

Developer snapshots are deposited on maven-central starting with v0.8.90+

v0.8

Released announced at 2022-09-27

Milestone Enhancements

  • Implemented 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
  • Introduced different capacity modes if resource requests exceed resource capacity.
    val tank  = DepletableResource(capacity=100, initialLevel=60)
    
    put(gasSupply, 50, capacityLimitMode = CapacityLimitMode.CAP)
    
  • #23 Added support for duration extensions introduced in kotlin v1.6 to express durations more naturally with 2.hours, 3.minutes and so on. It is now possible to use java.time.Instant and kotlin.time.Duration in Component.hold() and Environment.run.
    createSimulation{
        object: Component{
            val driver = Resource(2) 
            override fun process() = sequence {
                request(driver) {
                    hold(23.minutes)
                }
                hold(3.hours)
            }
    
        }
    }.run(2.5.days) // incl. fractional support
    

Major Enhancements

  • #37 Simplified process activation in process definitions
  • #34 Added support for triangular distributions
  • #43 Simplified states to consume predicates directly in wait()
  • #27 Made resource events more informative and consistent. These event now include a request-id to enable simplified bottleneck analyses
  • Added RequestScopeContext to honor-block of request including requestingSince time
  • #35 Improved support for asynchronous event consumption (contributed by pambrose via PR)
  • Reduced memory requirements of resource monitoring by 50% by inferring occupancy and availability using Timeline Arithmetics
  • #38 Extended and improved API support for depletable resources.
  • Added ComponentQueue.asSortedList() to sorted copy of underlying priority queue
  • Ported data-frame-support from krangl to the more modern kotlin-dataframe.

Minor enhancements

Documentation

v0.7

Released 2021-11-27

See release announcement

Major enhancements

  • Reworked event & metrics logging API
  • Introduced ComponentList
  • Implemented ticks metrics monitor (fixes #9)
  • New timeline and activity log attributes to resources for streamlined usage and capacity analysis
  • Extended display() support API on all major components and their collections (including Resource, Component or List<Component>, MetricTimeline) (fixes #18)
  • Thread-local context registry enabled via Koin Context Isolation (fixes #20)
  • Dramatically improved simulation performance

Documentation

Minor enhancements

  • Added possibility stop a simulation from a process definition using `stopSimulation
  • Introduced AssertModes (Full, Light (default), None) to enable/disable internal consistency checks. This will optimize performance by another ~20% (depending on simulation logic)
  • Improved request priority API
  • Allow for runtime reconfiguration of ClockSync to enable adjustable simulation speed
  • Lifted Component sub-type requirement from ComponentQueue
  • Fixed oneOf in request()
  • Redesigned honorBlock in request() to return Unit and to provide claimed resource via it
    request(doctorFoo, doctorBar, oneOf = true) { doctor ->
        println("patient treated by $doctor")
    }
    
  • Added RealDistribution.clip to allow zero-inflated distribution models with controlled randomization

Breaking changes

  • Removed components from Environment and created componentCollector as optional replacement
  • Redesigned events & metrics API
  • Updated to koin v3.1 (fixes #15): GlobalContext has been replaced with DependencyContext
  • Established use of TickTime across the entire API to disambiguate simulation time instants from durations, which are still modelled as Double
  • Changed Component.nowand Environment.now to new value class TickTime for better type safety
  • Simplified ClockSync API by removing redundant speedUp parameter
  • Component.status has been renamed to Component.componentState to enable extending classes to use the property name status for domain modelling
  • Removed requirement to implement info in SimulationEntity
  • Moved stochastic distributions support API to from Component to SimulationEntity
  • Removed Component::setup because the user can just use an init{} block instead
  • Migrated release channel from jcenter to maven-central

v0.6

Released 2021-02-12 -> Updated to v0.6.6 on 2021-05-05

Major Enhancements

  • Added selectResource() to select from resources with policy

    val doctors = List(3) { Resource() }
    val selected = selectResource( doctors, policy = ShortestQueue )
    

  • New suspending batch interaction to group an entity stream into blocks

    val queue = ComponentQueue<Customer>()
    val batchLR: List<Customer> = batch(queue, 4, timeout = 10)
    

  • Added option to configure a tick to wall time transformer

    createSimulation {
        tickTransform = OffsetTransform(Instant.now(), TimeUnit.MINUTES)
    
        run(Duration.ofMinutes(90).asTicks())
        println(asWallTime(now))
    }
    

  • Added lifecycle records to streamline component state analyses

  • Changed ComponentGenerator to allow generating arbitrary types (and not just Components)

    ComponentGenerator(uniform(0,1)){ counter -> "smthg no${counter}"}
    

  • Added forceStart to ComponentGenerator to define if an arrival should be happen when it is activated for the first time

  • Changed scheduling priority from Int to inline class Priority (with defaults NORMAL, HIGH, LOW) in all interaction methods for more typesafe API

  • Started bundled simulations for adhoc experimentation and demonstration by adding M/M/1 queue MM1Queue

  • Added support for pluggable visualization backend. Currently kravis and lets-plot are supported. For jupyter-notebook examples mm1-queue analysis

    // simply toggle backend by package import
    import org.kalasim.plot.letsplot.display
    // or
    //import org.kalasim.plot.kravis.display
    
    MM1Queue().apply {
        run(100)
        server.claimedMonitor.display()
    }
    

  • New Example: "The ferryman"

  • New Example: Office Tower

v0.5

Released 2021-01-12

Major Enhancements

Notable Fixes

  • Fixed failAt in request

v0.4

Released 2021-01-03

Major Enhancements

  • Implemented interrupt interaction
  • Reworked documentation and examples
  • Implemented standby
  • Implement disable/enable for monitors
  • Yield internally, to simplify process definitions

    // before
    object : Component() {
        override fun process() = sequence { yield(hold(1.0)) }
    }
    
    // now
    object : Component() {
        override fun process() = sequence { hold(1.0) }
    }
    

  • Made scheduledTime nullable: Replaced scheduledTime = Double.MAX_VALUE with null where possible to provide better mental execution model

  • Provide lambda parameter to enable auto-releasing of resources
    // before
    object : Component() {
        override fun process() = sequence { 
            request(r)
            hold(1)
            release(r)
        }
    }
    
    // now
    object : Component() {
        override fun process() = sequence { 
            request(r){
                hold(1)
            }
        }
    }
    
  • Implemented Environment.toString to provide json description
  • Various bug-fixes

v0.3

  • Reimplemented monitors
  • Continued salabim core API reimplementation
  • Fixed: Decouple simulation with different koin application contxts

v0.2

  • Reimplement core salabim examples in kotlin
  • Port all salabim examples
  • Started MkDocs manual

v0.1

  • Reimplement salabim's main component lifecycle
  • Add timing API