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 |
|
Downloads |
Q&A Using Flexsim and building models |
#1
|
|||
|
|||
Collect the total flow time of two itemtype and many replications
Hi ~~
Problem definition: There are two itemtypes in the model. I'd like to collect the total flow time of each itemtype and write in a global table. And I will design a Experimenter with many scenarios. And there are 30 replications for each scenario. So I want to collect the total flow time of each itemtype for each replication and scenario (like the global_table.xls in the files). I set two labels of the item. One is at the Entry of the queue. The other is at the Entry of the sink. I know just how to calculate the total flow time and write in the global table. But I have two problems. (1) I don't know how to divide to collect flow time of each itemtype. (2) Collect the data for each replication and scenario and write into a global table. Thank a lot. |
#2
|
|||
|
|||
Hi Vic,
Let the item get type 1, 2, 3, and so. In the exit I would use this code Code:
int type=getitemtype(item); double staytime=gettablenum("mytable",type,2)+getlabelnum(item,"end_time")-getlabelnum(item,"start_time"); settablenum("mytable",1,type,staytime); To export the table, you do it this way. Under Experimenter->Advanced -> End of Replication, add this code: Code:
treenode tabell=node("/Tools/GlobalTables/mytable",model()); string filename="mytable"; filename = concat(filename , "_S" , numtostring(scenario,0,0) , "_R" , numtostring(replication,0,0) , ".csv"); string directory = modeldir(); if(stringlen(directory) < 3) directory = documentsdir(); filename=concat(directory,filename); exporttable(node(">variables/data",tabell),filename,1,1); If you have 3 replication and 3 scenario you will get 9 files. Lars-Olof |
The Following User Says Thank You to Lars-Olof Leven For This Useful Post: | ||
Vic Li (11-10-2008) |
#3
|
|||
|
|||
Thanks so mach, Lars-Olof.
I want to collect the input of each itemtype. I write the code, but it doesn't work. Code: ------------------------------------------------------------------ if(type==1) int input1=getinput(node("/Sink1",model())); else int input2=getinput(node("/Sink1",model())); settablenum("mytable",type,3,input1); settablenum("mytable",type,3,input2); ----------------------------------------------------------------- It gives input1 a big wrong number, and gives input2 the number that is the number of input of all item. So It's not what I want >"<. thx~ |
#4
|
|||
|
|||
Hi Vic,
The getinput will only return the total of what has arrived to the sink. If you want to record number of input for each type, use this code: Code:
int count=gettablenum("mytable",type,3); count++; settablenum("mytable",type,3,count); Do not forget to reset the table to 0 on each reset. Lars-Olof |
#5
|
|||
|
|||
Thanks so mach, Lars-Olof.
I succeed to build the model. By the way, I used the Experimenter-->Performace Measures to collect the data of each replication and scenario. Use "Statistic by individual object" and add the code: int FlowTime=10; rewrite -> int stat =FlowTime else if(stat == FlowTime) value = gettablenum("mytable",1,2); It's a easy way to catch the data of each replication and scenario. Lars-Olof, thanks so mach again. |
The Following User Says Thank You to Vic Li For This Useful Post: | ||
Lars-Olof Leven (11-10-2008) |
#6
|
|||
|
|||
Hi,
isn't there any statistic/reporting function that shows the flowtime/throughput time distribution of all flowitems entered and exited the model (of one scenario replication)? Like a bar chart that shows the fraction of flowitem with a certain throughput time class (100-120 time units, 120-140 time units, etc.) Thanks! Congshi |
Thread | Thread Starter | Forum | Replies | Last Post |
Displaying the simulation time with the various date/time formats. | Regan Blackett | Tips and Tricks | 12 | 11-12-2012 08:01 AM |
Flow item in object in time 0 | KelvinHo | Q&A | 17 | 04-17-2012 09:12 AM |
How to unload all the same itemtype flowitem into the matching queue altogether? | karl huang | Q&A | 12 | 02-21-2009 12:45 AM |
Changing flow item by time | KelvinHo | Q&A | 6 | 08-13-2008 07:58 AM |
I want Recorder to collect interval statistics | qin tian | Gripes and Goodies | 13 | 03-03-2008 06:43 PM |