ATTENTION

This 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

Go Back   FlexSim Community Forum > FlexSim Software > Q&A
Downloads

Q&A Using Flexsim and building models

  #1  
Old 06-01-2011
Susan Pevovar Susan Pevovar is offline
Flexsim User
 
Join Date: Jun 2011
Posts: 6
Downloads: 0
Uploads: 0
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
Susan Pevovar is on a distinguished road
Default 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  
Old 06-01-2011
Jason Lightfoot Jason Lightfoot is offline
Flexsim Consultant
 
Join Date: Aug 2007
Location: Somerset, UK
Posts: 719
Downloads: 20
Uploads: 0
Thanks: 123
Thanked 953 Times in 446 Posts
Rep Power: 773
Jason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond repute
Default

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  
Old 06-02-2011
Susan Pevovar Susan Pevovar is offline
Flexsim User
 
Join Date: Jun 2011
Posts: 6
Downloads: 0
Uploads: 0
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
Susan Pevovar is on a distinguished road
Default

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  
Old 06-02-2011
Jason Lightfoot Jason Lightfoot is offline
Flexsim Consultant
 
Join Date: Aug 2007
Location: Somerset, UK
Posts: 719
Downloads: 20
Uploads: 0
Thanks: 123
Thanked 953 Times in 446 Posts
Rep Power: 773
Jason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond repute
Default

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?
Attached Files
File Type: fsm avgPFMtoTable.fsm (58.8 KB, 162 views)
  #5  
Old 06-02-2011
Susan Pevovar Susan Pevovar is offline
Flexsim User
 
Join Date: Jun 2011
Posts: 6
Downloads: 0
Uploads: 0
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
Susan Pevovar is on a distinguished road
Default

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  
Old 06-02-2011
Jason Lightfoot Jason Lightfoot is offline
Flexsim Consultant
 
Join Date: Aug 2007
Location: Somerset, UK
Posts: 719
Downloads: 20
Uploads: 0
Thanks: 123
Thanked 953 Times in 446 Posts
Rep Power: 773
Jason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond repute
Default

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.
Attached Files
File Type: zip ExportPFMsCommand.zip (851 Bytes, 159 views)
  #7  
Old 06-02-2011
Susan Pevovar Susan Pevovar is offline
Flexsim User
 
Join Date: Jun 2011
Posts: 6
Downloads: 0
Uploads: 0
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
Susan Pevovar is on a distinguished road
Default

Awesome, thanks! I added the command to the library of the model and am now exporting all of the PFMS to a table. Thanks so much Jason, I learned a lot today.

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


All times are GMT -6.
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Copyright 1993-2018 FlexSim Software Products, Inc.