Skip to content

Commit

Permalink
v0.9.1 release
Browse files Browse the repository at this point in the history
  • Loading branch information
holgerbrandl committed Apr 17, 2023
1 parent 79324ce commit b3b8df9
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 37 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ plugins {

group = "com.github.holgerbrandl"
//version = "0.8.101"
version = "0.9"
version = "0.9.1"


repositories {
Expand Down
Binary file modified docs/userguide/docs/basics_images/event_loop.pptx
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/userguide/docs/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
To get started simply add it as a dependency:
```
dependencies {
implementation "com.github.holgerbrandl:kalasim:0.9"
implementation "com.github.holgerbrandl:kalasim:0.9.1"
}
```

Expand Down
48 changes: 14 additions & 34 deletions simulations/notebooks/kotlin-conf-23.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": null,
"execution_count": 2,
"outputs": [],
"source": [
"import org.kalasim.*\n",
Expand All @@ -11,8 +11,8 @@
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-04-14T06:42:00.384741400Z",
"start_time": "2023-04-14T06:42:00.203738800Z"
"end_time": "2023-04-14T18:55:40.533945900Z",
"start_time": "2023-04-14T18:55:40.433846400Z"
}
}
},
Expand All @@ -27,16 +27,16 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 3,
"outputs": [],
"source": [
"val sim = Elevator(numCars = 4)"
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-04-14T06:42:04.340365200Z",
"start_time": "2023-04-14T06:42:04.255356600Z"
"end_time": "2023-04-14T18:55:41.043844800Z",
"start_time": "2023-04-14T18:55:40.528017600Z"
}
}
},
Expand All @@ -51,16 +51,16 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 4,
"outputs": [],
"source": [
"sim.run(24.hours)\n"
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-04-14T06:42:09.653819200Z",
"start_time": "2023-04-14T06:42:09.556832800Z"
"end_time": "2023-04-14T18:55:41.454846600Z",
"start_time": "2023-04-14T18:55:41.039845200Z"
}
}
},
Expand All @@ -81,11 +81,7 @@
"sim"
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-04-14T06:42:15.971880900Z",
"start_time": "2023-04-14T06:42:15.908893500Z"
}
"collapsed": false
}
},
{
Expand All @@ -108,11 +104,7 @@
"sim.cars[0].visitors.queueLengthTimeline.display(\"# visitors car 1\")"
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-04-14T06:42:27.384192800Z",
"start_time": "2023-04-14T06:42:25.341615200Z"
}
"collapsed": false
}
},
{
Expand All @@ -123,11 +115,7 @@
"sim.cars[0].visitors.statistics.lengthOfStayStats"
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-04-14T06:42:47.711255200Z",
"start_time": "2023-04-14T06:42:47.641255600Z"
}
"collapsed": false
}
},
{
Expand All @@ -143,11 +131,7 @@
"avgQueueLength.take(5)\n"
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-04-14T06:43:13.876471600Z",
"start_time": "2023-04-14T06:43:13.661474200Z"
}
"collapsed": false
}
},
{
Expand All @@ -162,11 +146,7 @@
" .geomCol()"
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-04-14T06:43:30.144075800Z",
"start_time": "2023-04-14T06:43:28.155206500Z"
}
"collapsed": false
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/org/kalasim/misc/TimeUtil.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import kotlin.time.Duration.Companion.milliseconds

// Duration utilities
fun Iterable<Duration>.sum() : Duration = sumOf { it }
fun <T> Iterable<T>.sumOf(selector: (T) -> Duration) = map{ selector(it)}.sum()
fun <T> Iterable<T>.sumOf(selector: (T) -> Duration) = map{ selector(it).inWholeMilliseconds }.sum().milliseconds

fun Iterable<Duration>.mean() : Duration = meanOf { it }
fun <T> Iterable<T>.meanOf(selector: (T) -> Duration) = map{ selector(it).inWholeMilliseconds}.mean().milliseconds
Expand Down

0 comments on commit b3b8df9

Please sign in to comment.