Transformer aTransformer = tranFactory.newTransformer();
Source src = new DOMSource(doc2);
Result dest = new StreamResult(temp);
aTransformer.transform(src, dest);
Dispatcher_jSIMschema dispatcher = new Dispatcher_jSIMschema(temp);
// Sets simulation seed if required
if (options.containsKey(OPTION_SEED)) {
try {
dispatcher.setSimulationSeed(Long.parseLong(options.get(OPTION_SEED)));
} catch (NumberFormatException ex) {
System.err.println("Invalid simulation seed. Should be a number.");
System.exit(1);
}
}
if (options.containsKey(OPTION_MAXTIME)) {
try {
dispatcher.setSimulationMaxDuration(Long.parseLong(options.get(OPTION_MAXTIME)) * 1000);
} catch (NumberFormatException ex) {
System.err.println("Invalid maximum simulation time. Should be a number.");
System.exit(1);
}
}
// Starts the simulation
dispatcher.solveModel();
File output = dispatcher.getOutputFile();
File result = new File(args[1]+"-result.jsim");
copyFile(output, result);
output.delete();