Visualization
There are two type of visualizations
- Statistical plots to inspect distributions, trends and outliers. That's what described in this chapter
- Process rendering to actually show simulation entities, their state or position changes on a 2D (or even 3D) grid as rendered movie. This may also involve interactive controls to adjust simulation parameters. Such functionality is planned but not yet implemented in
kalasim
Examples * Movie Theater
Built-in Visualizations
Currently, the following extensions for distribution analysis are supported
CategoryTimeline<T>.display()
provides a segment chart of the levelFrequencyTable<T>.display()
provides a barchart of the frequencies of the different valuesNumericStatisticMonitor.display()
provides histogram of the underlying distributionMetricTimeline.display()
provides a line chart with time on the x and the value on y
r.activiities
to show the activities as segments timeliner.timeline
to show the resource utilization and queuing status- All monitor related plots from above
- All monitor related plots from above
For monitors, see corresponding section
Framework Support
By default, kalasim
supports 2 pluggable visualization backends. Currently kravis and lets-plot are supported.
Since we may not be able to support all visualizations in both frontends, the user can simply toggle the frontend by package import:
// 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()
}
Kravis
kalasim
integrates nicely with kravis
to visualize monitor data. For examples see src/test/kotlin/org/kalasim/analytics/KravisVis.kt
.
LetsPlot
lets-plot is another very modern visualization library that renders within the JVM and thus does not have any external dependencies. Similar to kravis
it mimics the API of ggplot2.