@Override public void afterSim() { /* * Calling the afterSim Method of the QSimEngineThreads * will set their simulationRunning flag to false. */ for (QNetsimEngineRunner engine : this.engines) { engine.afterSim(); } if (this.usingThreadpool) { this.pool.shutdown(); } else { /* * Triggering the startBarrier of the QSimEngineThreads. * They will check whether the Simulation is still running. * It is not, so the Threads will stop running. */ this.startBarrier.arriveAndAwaitAdvance(); } /* Reset vehicles on ALL links. We cannot iterate only over the active links * (this.simLinksArray), because there may be links that have vehicles only * in the buffer (such links are *not* active, as the buffer gets emptied * when handling the nodes. */ for (QLinkI link : network.getNetsimLinks().values()) { link.clearVehicles(); } }