瀏覽代碼

Fixes Simulation stopping with an duration=0 interval

Andreas T. Meyer-Berg 6 年之前
父節點
當前提交
813d9c806f
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      src/main/java/de/tu_darmstadt/tk/SmartHomeNetworkSim/core/SimulationManager.java

+ 3 - 1
src/main/java/de/tu_darmstadt/tk/SmartHomeNetworkSim/core/SimulationManager.java

@@ -88,8 +88,10 @@ public class SimulationManager extends Observable {
 	 */
 	private void simulateTimeStep() {
 		// Just simulate if timer is running
-		if (endTime <= currentTime)
+		if (endTime <= currentTime){
 			stopSimulation();
+			return;
+		}
 		if (currentTime + duration <= endTime) {
 			simulateTimeIntervall(currentTime, duration);
 			currentTime += duration;