For school I have to analyse an simulation. We are using the Flexsim for students 2012 software.
I'm trying to export Experiments to Excel. Can anybody help me.
For school I have to analyse an simulation. We are using the Flexsim for students 2012 software.
I'm trying to export Experiments to Excel. Can anybody help me.
I use a Script like this to export results from FlexSim Experimenter to a reasonable CSV format:
// export Experimenter results string outFile = currentfile().replace(/\.fs[xm]$/, ".results.csv"); treenode PMs = node("MODEL:/Tools/Experimenter/PerformanceMeasures"); fileopen(outFile, "w"); fpt("scenario,replication,metric,value\n"); for (int i = 1; i <= PMs.subnodes.length; i++) { treenode PM = PMs.subnodes[i]; string PM_name = PM.name; string PM_name_quoted = "\"" + PM_name.replace(/[\"]/, "\"\"") + "\""; treenode data = node("data", PM); for (int j = 1; j <= data.subnodes.length; j++) { treenode scenario = data.subnodes[j]; for (int k = 1; k <= scenario.subnodes.length; k++) { treenode rep_datum = scenario.subnodes[k]; double value = get(rep_datum); string formattedValue = (value == round(value)) ? numtostring(value,0,0) : numtostring(value,0,6); Array valuerow = [numtostring(j), numtostring(k), PM_name_quoted, formattedValue]; fpt(valuerow.join(",")); fpt("\n"); } } } fileclose(); return outFile;
So if the model file is called "MyModel.fsx", the results will be saved to "MyModel.results.csv". You should be able to import this file in Excel.
To analyze results in R, I load them like:
results <- read.table("MyModel.results.csv", header = T, sep = ",")
The data can be used with `dplyr` like this:
library(dplyr) results %>% group_by(scenario,metric) %>% summarise(mean=mean(value), stdev=sd(value)) results %>% filter(metric == "MyMetric") %>% head
7 People are following this question.
FlexSim can help you understand and improve any system or process. Transform your existing data into accurate predictions.
FlexSim is a fully 3D simulation software environment. FlexSim can be used to simulate any process in any industry.
FlexSim®, FlexSim Healthcare™, Problem Solved.®, the FlexSim logo, the FlexSim X-mark, and the FlexSim Healthcare logo with stylized Caduceus mark are trademarks of FlexSim Software Products, Inc. All rights reserved.
Privacy | Do not sell or share my personal information | Cookie preferences | Report noncompliance | Terms of use | Legal | © Autodesk Inc. All rights reserved