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 03-10-2016
Wilfredo Salinas
Guest
 
Posts: n/a
Downloads: 18
Uploads: 0
Default Experimenter not saving to Table

After converting a Flexsim 5 to 7 file, experimenter is not writing results to Global Table. Based on Tree, I have the following codes

StartofScenario code only declares variables.
RowID = scenario;
ColID = replication;

EndOfRun code has the following line,
settablenum("MyData",RowID,ColID,getnodenum(stats_ contentmax(node("/MyProcessor",model()))));

Is there something wrong with the conversion. Same model runs perfect in Flexsim 5.

Thanks for the help.
  #2  
Old 03-10-2016
Phil BoBo's Avatar
Phil BoBo Phil BoBo is offline
Flexsim Development
 
Join Date: Jan 2008
Posts: 756
Downloads: 109
Uploads: 18
Thanks: 385
Thanked 1,483 Times in 525 Posts
Rep Power: 1174
Phil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond repute
Default

FlexSim 7 runs each experiment replication on a separate, background FlexSim process. It is not running in the main FlexSim process that you see. Because of this, you need to pass the information from the child process back to the main process.

In the End of Replication trigger, there is a picklist called "Write To Global Table" that does what you are trying to do.
  #3  
Old 03-11-2016
Wilfredo Salinas
Guest
 
Posts: n/a
Downloads: 18
Uploads: 0
Default

I followed your instructions and Flexsim 7 would not save any results. This is what the new code looks like,

double replication = parval(1);
double scenario = parval(2);
treenode childexpfolder = parnode(3);
{ //************* PickOption Start *************\\
/***popup:WriteToGlobalTable*/
/**Write to GlobalTable*/
treenode table = reftable(/** \nTable: *//***tag:table*//**/"Content"/**/);
string tablename = concat(getname(ownerobject(table)),"S",numtostring (scenario),"R",numtostring(replication));
int row = /** \nRow: *//***tag:row*//**/replication/**/;
int col = /** \nColumn: *//***tag:col*//**/scenario/**/;
double value = /** \nValue: *//***tag:val*//**/getinput(stats_contentmax(node("/MyProcessor",model())))/**/; <----- CHANGED HERE

if (gettablerows(table) < row || gettablecols(table) < col) {
settablesize(table,maxof(row,gettablerows(table)), maxof(col,gettablecols(table))); }

if (objectexists(childexpfolder)) { // End of Replication on the main process
treenode savedtables = node("/MyData",childexpfolder); <-----CHANGED HERE
treenode tablecopy = node(concat("/",tablename),savedtables);
settablenum(table,row,col,gettablenum(tablecopy,ro w,col));
} else { // End of Replication on the child process
settablenum(table,row,col,value);
treenode savedtables = assertsubnode(node("/Tools/Experimenter",model()),"MyData"); <------ CHANGED HERE
createcopy(table,savedtables);
treenode tablecopy = last(savedtables);
setname(tablecopy,tablename);
}
} //******* PickOption End *******\\
  #4  
Old 03-11-2016
Phil BoBo's Avatar
Phil BoBo Phil BoBo is offline
Flexsim Development
 
Join Date: Jan 2008
Posts: 756
Downloads: 109
Uploads: 18
Thanks: 385
Thanked 1,483 Times in 525 Posts
Rep Power: 1174
Phil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond repute
Default

getinput(stats_contentmax(node("/MyProcessor",model()))) will always return 0.

Why did you change that line from your previous question?

getnodenum(stats_contentmax(node("/MyProcessor",model())))


Also, changing the "savedtables" lines is unnecessary, but since you changed both of them, it should still work fine.
  #5  
Old 03-11-2016
Wilfredo Salinas
Guest
 
Posts: n/a
Downloads: 18
Uploads: 0
Default

I manually edited "end of replication" drop down because it only listed a few choices. I need to save only the max from MyProcessor.

Thanks again for the help. This is very frustrating.
Attached Thumbnails
Click image for larger version
Name:	Screenshot.jpg
Views:	295
Size:	53.8 KB
ID:	3205  
  #6  
Old 03-11-2016
Phil BoBo's Avatar
Phil BoBo Phil BoBo is offline
Flexsim Development
 
Join Date: Jan 2008
Posts: 756
Downloads: 109
Uploads: 18
Thanks: 385
Thanked 1,483 Times in 525 Posts
Rep Power: 1174
Phil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond repute
Default

You changed the temporary node where it passes the information back up from the child process to the main process.

If all you are doing is writing one value to one table for each scenario/replication, all you needed to change were the fields in the GUI. You didn't need to modify the code at all.

In the popup that appears when you select the pick option, just change:

Table from "Content" to "MyData"

Value from getinput(node("/Sink1",model())) to getnodenum(stats_contentmax(node("/MyProcessor",model())))


Thread Thread Starter Forum Replies Last Post
Time Table Experimenter Zulay Sarmiento Q&A 3 08-11-2015 04:08 AM
Tracking into global table - Experimenter Simon Jutz Q&A 10 05-07-2014 07:20 AM
Global Table export problem by using end of replication trigger in teh experimenter Peppino Q&A 16 02-22-2013 04:38 AM
Problem in saving as fsp David Chan Q&A 3 10-18-2011 09:46 AM
About saving files Fernando Igor Q&A 3 01-18-2010 03:11 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.