Skip to content

Commit f623322

Browse files
authored
add trip filter for trip start OR end in shp area (matsim-org#3269)
1 parent e8458ed commit f623322

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

contribs/simwrapper/src/main/java/org/matsim/simwrapper/SimWrapper.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,15 @@ boolean hasDashboard(Class<? extends Dashboard> d, String context) {
120120
* Generate the dashboards specification and writes .yaml files to {@code dir}.
121121
*/
122122
public void generate(Path dir) throws IOException {
123+
generate(dir, false);
124+
}
125+
126+
/**
127+
* Generate the dashboards specification and writes .yaml files to {@code dir}.
128+
* @param dir target directory
129+
* @param append if true, existing dashboards will not be overwritten
130+
*/
131+
public void generate(Path dir, boolean append) throws IOException {
123132

124133
ObjectMapper mapper = new ObjectMapper(new YAMLFactory()
125134
.disable(YAMLGenerator.Feature.WRITE_DOC_START_MARKER)
@@ -157,6 +166,11 @@ public void generate(Path dir) throws IOException {
157166
yaml.subtabs = layout.getTabs();
158167

159168
Path out = dir.resolve("dashboard-" + i + ".yaml");
169+
170+
while (append && Files.exists(out)) {
171+
out = dir.resolve("dashboard-" + ++i + ".yaml");
172+
}
173+
160174
writer.writeValue(out.toFile(), yaml);
161175

162176
i++;

0 commit comments

Comments
 (0)