Skip to content

Commit

Permalink
Bug fix (log msg)
Browse files Browse the repository at this point in the history
  • Loading branch information
ZiluTian committed Apr 4, 2024
1 parent 36c1a07 commit 718baf3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion Akka/src/main/scala/core/DriverImpl.scala
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,11 @@ class Driver {

case LogControllerFinished() =>
Behaviors.stopped {() =>
ctx.log.info(f"Average ${(end-initialStart)/(currentTurn-1)} ms")
if (currentTurn > 1) {
ctx.log.info(f"Average ${(end-initialStart)/(currentTurn)} ms")
} else {
ctx.log.info(f"Average ${end-initialStart} ms")
}
ctx.log.debug(f"Simulation completes! Stop the driver")
workersStop.foreach(a => a ! WorkerSpec.Stop())
}
Expand Down
6 changes: 5 additions & 1 deletion Base/src/main/scala/Simulate.scala
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,11 @@ object Simulate {
end = System.currentTimeMillis()
println(f"Round ${currentRound} takes ${end-start} ms")
}
println(f"Average ${(end - initial)/totalRound} ms")
if (totalRound >= 1) {
println(f"Average ${(end - initial)/totalRound} ms")
} else {
println(f"Average ${end - initial} ms")
}
SimulationSnapshot(actors, collectedMessages.flatMap(i => i._2).toList)
}
}

0 comments on commit 718baf3

Please sign in to comment.