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 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
|
||||
|
||||
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
|
|||
|
|||
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
|
||||
|
||||
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. |
#6
|
||||
|
||||
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 |