11.3.2021, 9:00 - 11:00: Due to updates GitLab may be unavailable for some minutes between 09:00 and 11:00.

Commit 9c427f01 authored by Benedikt Zoennchen's avatar Benedikt Zoennchen

bugFix issue #47

parent 9e1a712b
package org.vadere.gui.components.model;
import java.awt.Point;
import java.util.Collection;
import java.util.Optional;
import java.util.function.Function;
import org.vadere.state.scenario.Agent;
import org.vadere.util.geometry.shapes.VPoint;
import org.vadere.util.math.InterpolationUtil;
import org.vadere.util.potential.CellGrid;
public abstract class SimulationModel<T extends DefaultSimulationConfig> extends DefaultModel {
......
......@@ -5,7 +5,7 @@
"processWriters" : {
"files" : [ {
"type" : "org.vadere.simulator.projects.dataprocessing.outputfile.TimestepPedestrianIdOutputFile",
"filename" : "out.txt",
"filename" : "postvis.trajectories",
"processors" : [ 1 ]
} ],
"processors" : [ {
......
......@@ -78,16 +78,19 @@ public abstract class OutputFile<K extends DataKey<K>> {
}
public void write() {
try (PrintWriter out = new PrintWriter(new FileWriter(absoluteFileName))) {
printHeader(out);
this.dataProcessors.stream().flatMap(p -> p.getKeys().stream())
.distinct().sorted()
.forEach(key -> printRow(out, key));
out.flush();
} catch (IOException ex) {
throw new UncheckedIOException(ex);
// if there is something to write i.e. absoluteFileName != null
if(!isEmpty()) {
try (PrintWriter out = new PrintWriter(new FileWriter(absoluteFileName))) {
printHeader(out);
this.dataProcessors.stream().flatMap(p -> p.getKeys().stream())
.distinct().sorted()
.forEach(key -> printRow(out, key));
out.flush();
} catch (IOException ex) {
throw new UncheckedIOException(ex);
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment