Browse Source

fix test driver

main 2.4.1
Stian Fredrik Aune 1 year ago
parent
commit
5aedf0ae42
  1. 2
      ykonsole-core/src/main/kotlin/net/aiterp/git/ykonsole2/infrastructure/testing/TestDriver.kt

2
ykonsole-core/src/main/kotlin/net/aiterp/git/ykonsole2/infrastructure/testing/TestDriver.kt

@ -81,7 +81,7 @@ class TestDriver(private val secondLength: Duration) : ActiveDriver() {
calories += ((level + 1).toDouble() / 10) * Random.nextDouble(0.1, 0.4)
distance += ((level + 1).toDouble() / 10) * Random.nextDouble(1.5, 2.5)
speed = 100.0 - (level * Random.nextDouble(1.0, 2.5))
pulse = maxOf(60.0, minOf(140.0, Random.nextDouble(pulse - (level / 10), pulse + (level / 10))))
pulse = maxOf(60.0, minOf(140.0, Random.nextDouble(pulse - 1 - (level / 10), pulse + 1 + (level / 10))))
output.emit(ValuesReceived(currentState))
}

Loading…
Cancel
Save