diff --git a/matsim/src/main/java/org/matsim/analysis/LinkStatsControlerListener.java b/matsim/src/main/java/org/matsim/analysis/LinkStatsControlerListener.java index 771b2dc2b95..42ff155f702 100644 --- a/matsim/src/main/java/org/matsim/analysis/LinkStatsControlerListener.java +++ b/matsim/src/main/java/org/matsim/analysis/LinkStatsControlerListener.java @@ -112,6 +112,9 @@ public void notifyIterationStarts(IterationStartsEvent event) { @Override public void notifyShutdown(ShutdownEvent event) { + if (createLinkStatsInIteration(event.getIteration())) { + linkStats.writeFile(this.controlerIO.getOutputFilename(Controler.DefaultFiles.linkstats)); + } String fileName = this.controlerIO.getOutputFilename(Controler.DefaultFiles.linkscsv); CSVFormat format = CSVFormat.DEFAULT.builder()