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 11-09-2008
Vic Li Vic Li is offline
Flexsim User
 
Join Date: Mar 2008
Posts: 39
Downloads: 0
Uploads: 0
Thanks: 6
Thanked 1 Time in 1 Post
Rep Power: 150
Vic Li is on a distinguished road
Unhappy 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.
Attached Files
File Type: zip Problem.zip (44.7 KB, 292 views)
  #2  
Old 11-10-2008
Lars-Olof Leven Lars-Olof Leven is offline
Flexsim Distributor
 
Join Date: Aug 2007
Location: Sweden, Borlnge
Posts: 312
Downloads: 278
Uploads: 2
Thanks: 300
Thanked 256 Times in 139 Posts
Rep Power: 330
Lars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to behold
Default

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);
Do not forgot and change your table to the number of itemtypes you have.

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);
Now you will get text files with the total flowtime, there will be one file for each replciation and scenario.
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  
Old 11-10-2008
Vic Li Vic Li is offline
Flexsim User
 
Join Date: Mar 2008
Posts: 39
Downloads: 0
Uploads: 0
Thanks: 6
Thanked 1 Time in 1 Post
Rep Power: 150
Vic Li is on a distinguished road
Default

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  
Old 11-10-2008
Lars-Olof Leven Lars-Olof Leven is offline
Flexsim Distributor
 
Join Date: Aug 2007
Location: Sweden, Borlnge
Posts: 312
Downloads: 278
Uploads: 2
Thanks: 300
Thanked 256 Times in 139 Posts
Rep Power: 330
Lars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to behold
Default

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);
Assuming that column 3 is where you keep how many of each type has entered the sink.

Do not forget to reset the table to 0 on each reset.

Lars-Olof
  #5  
Old 11-10-2008
Vic Li Vic Li is offline
Flexsim User
 
Join Date: Mar 2008
Posts: 39
Downloads: 0
Uploads: 0
Thanks: 6
Thanked 1 Time in 1 Post
Rep Power: 150
Vic Li is on a distinguished road
Default

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  
Old 11-04-2010
Congshi Wang Congshi Wang is offline
Student
 
Join Date: May 2010
Location: Germany
Posts: 58
Downloads: 2
Uploads: 0
Thanks: 48
Thanked 0 Times in 0 Posts
Rep Power: 124
Congshi Wang is on a distinguished road
Default

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


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.