Skip to content

Commit

Permalink
Fixes the save of the result in SoBol
Browse files Browse the repository at this point in the history
  • Loading branch information
ptaillandier committed Dec 3, 2021
1 parent c5adef1 commit 94c0159
Showing 1 changed file with 9 additions and 9 deletions.
Expand Up @@ -137,21 +137,21 @@ public void explore(final IScope scope) throws GamaRuntimeException {
}

computeSobolIndexes(scope);


if (hasFacet(IKeyword.BATCH_REPORT)) {
String path_to = Cast.asString(scope, getFacet(IKeyword.BATCH_REPORT).value(scope));
FileWriter fw;
try {
final File f = new File(FileUtils.constructAbsoluteFilePath(scope, path_to, false));
final File parent = f.getParentFile();
if (!parent.exists()) { parent.mkdirs(); }
if (f.exists()) f.delete();
f.createNewFile();
fw = new FileWriter(f, false);
final File f = new File(FileUtils.constructAbsoluteFilePath(scope, path_to, false));
final File parent = f.getParentFile();
if (!parent.exists()) { parent.mkdirs(); }
if (f.exists()) f.delete();

try (FileWriter fw = new FileWriter(f, false)) {
fw.write(buildSobolReport());

} catch (IOException e) {
GamaRuntimeFileException.create(e, scope);
}
}
}

}
Expand Down

0 comments on commit 94c0159

Please sign in to comment.