mirror of
https://github.com/maxkratz/iflye.git
synced 2024-09-08 00:03:51 +00:00
Merge pull request #85 from Echtzeitsysteme/hotfix/dissscenarioload-various-fixes
Various fixes for the DissScenarioLoader
This commit is contained in:
commit
e3bf3a5282
3 changed files with 25 additions and 2 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -141,3 +141,7 @@ org.emoflon.gips.gipsl.examples.mdvne.seq/
|
|||
*.lp
|
||||
|
||||
org.emoflon.gips.gipsl.examples.mdvne.bwignore/
|
||||
|
||||
vne.scenarios/model.xmi
|
||||
|
||||
vne.scenarios/metrics/
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package scenario.util;
|
||||
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.File;
|
||||
import java.io.FileReader;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
|
@ -237,6 +238,23 @@ public class CsvUtil {
|
|||
return;
|
||||
}
|
||||
|
||||
if (format == null) {
|
||||
throw new IllegalArgumentException("Given CSV format was null");
|
||||
}
|
||||
|
||||
if (content == null || content.length == 0) {
|
||||
throw new IllegalArgumentException("Given content was null or empty.");
|
||||
}
|
||||
|
||||
// Create parent folder if it does not exist
|
||||
final int lastSlash = csvPath.lastIndexOf('/');
|
||||
final String parentPath = csvPath.substring(0, lastSlash);
|
||||
final File parentFolder = new File(parentPath);
|
||||
if (!parentFolder.exists()) {
|
||||
parentFolder.mkdir();
|
||||
}
|
||||
|
||||
// Write CSV line itself
|
||||
try {
|
||||
BufferedWriter out;
|
||||
// If file does not exist, write header to it
|
||||
|
|
|
@ -152,11 +152,12 @@ public class DissScenarioLoad {
|
|||
* Evaluation.
|
||||
*/
|
||||
|
||||
// Print metrics before saving the model
|
||||
printMetrics();
|
||||
|
||||
// Save model to file
|
||||
ModelFacade.getInstance().persistModel();
|
||||
System.out.println("=> Execution finished.");
|
||||
printMetrics();
|
||||
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue