/**
* Exports table information to file specified by user.
*/
protected void export() {
SimpleGUIFileExporter fileExporter = new SimpleGUIFileExporter() {
@Override
public void export(BufferedWriter bufferedWriter) throws IOException {
List<SimulationTableInformation> simTableInfos =
simRunTableModel.getSimTableInfos();
for (SimulationTableInformation simTableInfo : simTableInfos) {
if (simTableInfo.getSimState() != ComputationRuntimeState.FINISHED) {
continue;
}
// 1: store the simConfig's model parameters
TaskConfiguration simConfig =
simTableInfo.getSrti().getComputationTaskConfiguration();
Map<String, ?> parameters = simConfig.getParameters();
for (Entry<String, ?> parameter : parameters.entrySet()) {
bufferedWriter.append(parameter.getKey() + "="
+ parameter.getValue() + sepSequence);
}
// 2: store some of the simConfig's simulation parameters
bufferedWriter.append(simConfig.getSimStartTime() + sepSequence);
bufferedWriter.append(simConfig.getSimStopFactory() + sepSequence);
// 3: store the run information
RunInformation runInfo = simTableInfo.getRunInfo();
bufferedWriter.append(runInfo.getTotalRuntime() + sepSequence);
bufferedWriter.append(runInfo.getModelCreationTime() + sepSequence);
bufferedWriter.append(runInfo.getObserverConfigurationTime()
+ sepSequence);
bufferedWriter.append(runInfo.getComputationTaskCreationTime()
+ sepSequence);
bufferedWriter.append(runInfo.getComputationTaskRunTime()
+ sepSequence);
bufferedWriter.append('\n');
}
}
};
fileExporter.export(getContent());
}