Skip to content

Commit

Permalink
write events configurable via config
Browse files Browse the repository at this point in the history
  • Loading branch information
janekdererste committed Feb 2, 2024
1 parent 7ac41ce commit 3008599
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/main/java/org/matsim/run/RunQsimComparison.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ protected Config prepareConfig(Config config) {
config.controler().setLastIteration(0);

// don't write any events, as this slows down the qsim
config.controler().setWriteEventsInterval(0);
//config.controler().setWriteEventsInterval(0);

// rust_qsim has no pt
config.transit().setUseTransit(false);
Expand Down Expand Up @@ -76,10 +76,9 @@ public void notifyMobsimBeforeCleanup(MobsimBeforeCleanupEvent e) {
var now = Instant.now();
var duration = Duration.between(start, now);
var size = config.qsim().getNumberOfThreads();

var filename = Paths.get(outDir.getOutputFilename("instrument-mobsim.csv"));
try (var writer = Files.newBufferedWriter(filename); var p = new CSVPrinter(writer, createWriteFormat("timestamp", "func", "duration", "size"))) {
p.printRecord(Instant.now().getNano(), "org.matsim.core.mobsim.qsim.run", duration.getNano(), size);
p.printRecord(Instant.now().getNano(), "org.matsim.core.mobsim.qsim.run", duration.toNanos(), size);
} catch (IOException ex) {
throw new RuntimeException(ex);
}
Expand Down

0 comments on commit 3008599

Please sign in to comment.