Commit 2b3fa82f authored by Simon Trapp's avatar Simon Trapp

WEKA relative path fix

parent e95a69f4
......@@ -76,7 +76,6 @@ import de.tud.cs.simqpn.kernel.monitor.SimulatorProgress;
public class SimQPN implements IApplication {
public static long runtime;
private static File qpeFile = null;
public static void main(String[] args) {
startSimQPNWithCommandLine(args);
......@@ -101,10 +100,6 @@ public class SimQPN implements IApplication {
}
}
public static File getQPEFile() {
return qpeFile;
}
private static void runSimulatorOnDocument(Document netDocument,
String configurationName, String outputFilename, String logConfigFilename, SimulatorProgress progress, Date date) throws SimQPNException {
Element net = netDocument.getRootElement();
......@@ -134,7 +129,6 @@ public class SimQPN implements IApplication {
} catch(URISyntaxException ex) {
xmlFile = new File(path);
}
qpeFile = xmlFile;
SAXReader xmlReader = new SAXReader();
return xmlReader.read(xmlFile);
}
......
......@@ -44,10 +44,8 @@ package de.tud.cs.simqpn.kernel.loading.distributions;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.nio.file.Paths;
import de.tud.cs.simqpn.kernel.SimQPNException;
import de.tud.cs.simqpn.kernel.console.SimQPN;
import weka.classifiers.Classifier;
public class WEKACreator extends DistributionCreator {
......@@ -58,14 +56,6 @@ public class WEKACreator extends DistributionCreator {
@Override
protected void loadParams() throws SimQPNException {
wekaFilename = this.loadStringParam("wekaFile");
if (!Paths.get(wekaFilename).isAbsolute()) { // if not absolute filepath -> switch to DML environment mode
// switch from "DQL-Queries/results/" to "DML-Model/StatisticalModels/" folders
// treats wekaFile parameter as sole filename
wekaFilename = SimQPN.getQPEFile().getParentFile().getParentFile().getParent()
+ SimQPN.getQPEFile().separatorChar + "DML-Model"
+ SimQPN.getQPEFile().separatorChar + "StatisticalModels" + SimQPN.getQPEFile().separatorChar
+ wekaFilename;
}
try {
FileInputStream fis = new FileInputStream(wekaFilename);
ObjectInputStream ois = new ObjectInputStream(fis);
......
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