ATTENTIONThis FlexSim Community Forum is read-only. Please post any new questions, ideas, or discussions to our new community (we call it Answers) at https://answers.flexsim.com/. Our new Question & Answer site brings a modern, mobile-friendly interface and more focus on getting answers quickly. There are a few differences between how our new Q&A community works vs. a classic, threaded-conversation-style forum like the one below, so be sure to read our Answers Best Practices. |
flexsim.com |
#1
|
|||
|
|||
Experimenter Export
Hi. I have been running experimenter and have the values I need for my performance measures (mean, std dev) for each scenario and replication.
I would like to easily export these values to excel or to a tablee. I realize that I can do the HTML export, but that is not the ideal means of reporting for me. I also tried the export "standard report of model" in the end of replication triggers, but that wasn't exactly what I needed either. My performance measures of concern aren't in the standard report. I can see the average values for the performance measures within the tree view in the experimenter, I just don't know how to access them and write them to a table. I don't need the individual value for each run, just the averages. Any ideas or am I going about this wrong? Thanks, Susan |
#2
|
|||
|
|||
Here's some code that will write the PFM averages to a table (global table called "Test" in my example) which you can then export or copy and paste.
Code:
treenode targettable=reftable("Test"); clearcontents(targettable); treenode pfm=node("/Tools/Experimenter/PerformanceMeasures/1",model()); while (objectexists(pfm)){ treenode scenario=node("/1/1",pfm); int pfmrank=getrank(pfm); if (pfmrank==1) settablesize(targettable,content(up(pfm)),content(up(scenario))); treenode valcell=gettablecell(targettable,pfmrank,1); string pfmname=getname(pfm); setname(rank(targettable,pfmrank),pfmname); while (objectexists(scenario)){ double value=0; int reps=content(scenario); forobjectlayerunder(scenario) value+=get(a); //sum the replications setname(valcell,concat("Scenario",numtostring(getrank(scenario),0,0))); set(valcell,value/reps); //write the average into the cell scenario=next(scenario); valcell=next(valcell); } pfm=next(pfm); } |
The Following 3 Users Say Thank You to Jason Lightfoot For This Useful Post: | ||
Lars-Olof Leven (06-03-2011) |
#3
|
|||
|
|||
Thanks Jason. This code worked in creating a table for the PFMS, though their values are all 0. I am trying to figure out why. (I can clearly see the non-zero values in tree view).
|
#4
|
|||
|
|||
Hi Susan, I've attached the working test model which has the code on a user command called exportPFMs.
When you say you can see the values, do you mean the replication results under each scenario? Where in the tree are you looking? |
#5
|
|||
|
|||
Thanks Jason.
So - I ran your model and can clearly see how you export your PFMs into the global table with the ExportPFMS function. However, when I opened my model and tried the same thing, the ExportPFMS function does not exist so I get errors. I looked through the command reference and it was not there. Yet, when I open yours it is in the command reference manual. Why the difference? Is it part of some additional Software package or updates we did not receive? We are using FlexSIM 5. Thanks in advance, Susan |
#6
|
|||
|
|||
Okay - the user commands are stored with the model, so you could try and copy the text and parameters from one model to the other.
If not, here's a library which will 'stamp' the command into your model when the library is loaded. So load your model first and then load the library. |
Tags |
experimenter, reporting |
Thread | Thread Starter | Forum | Replies | Last Post |
Sketchup Pro Export Settings | Joshua Cole | Q&A | 7 | 03-15-2011 10:08 AM |
problem with excel export | Congshi Wang | Q&A | 1 | 12-09-2010 09:24 AM |
statistics cannot export to excel or csv | zhang xin | Container Terminal (CT) Library | 2 | 03-12-2010 08:01 AM |
Speeding up Excel Export | Nico Zahn | Tips and Tricks | 0 | 01-06-2010 08:50 AM |
Export of statistic data from Experimenter | Matthias Hofmann | Q&A | 1 | 11-04-2008 09:05 AM |