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 02-23-2012
Jack Lai Jack Lai is offline
Flexsim User
 
Join Date: Nov 2011
Posts: 32
Downloads: 17
Uploads: 0
Thanks: 22
Thanked 0 Times in 0 Posts
Rep Power: 106
Jack Lai is on a distinguished road
Default How to extract the result at queue??

After each simulation, the is a graph represent the "content vs time" in the queue.


Click image for larger version
Name:	content vs time.jpg
Views:	95
Size:	174.7 KB
ID:	1691

And I want to extract those data into an excel format. I record the time when a item entry/leave the queue. It seems ok for operating. But is there any easier and smart way to extract the data?? Thanks in advance.
Attached Files
File Type: fsm content vs time (can record in global table).fsm (70.0 KB, 108 views)
  #2  
Old 02-23-2012
Jack Lai Jack Lai is offline
Flexsim User
 
Join Date: Nov 2011
Posts: 32
Downloads: 17
Uploads: 0
Thanks: 22
Thanked 0 Times in 0 Posts
Rep Power: 106
Jack Lai is on a distinguished road
Default

Many I also know is there any function to control the waiting time of a item in the queue?? For example, it will generate a random waiting time (eg: uniform(1,3) ) for a item when it entry the queue, and then the item wait until the time and pass to the next port. I tried the code on the OnEntry tigger of the queue:

Code:
delayeventofobjects(item,uniform(1,3));
but it doesn't work. Is it posssible to do it?? Thanks in advance.
Attached Files
File Type: fsm count queue.fsm (44.8 KB, 84 views)
  #3  
Old 02-23-2012
Hao Zhou's Avatar
Hao Zhou Hao Zhou is offline
Flexsim User
 
Join Date: Sep 2010
Location: Long Beach
Posts: 66
Downloads: 56
Uploads: 0
Thanks: 78
Thanked 43 Times in 25 Posts
Rep Power: 146
Hao Zhou will become famous soon enoughHao Zhou will become famous soon enough
Default

Since you have already saved you data in a global table, you can extract the whole table to excel file by:

Code:
    excelopen(" /*your already existed excel file path*/ ");
    excelsetsheet("Sheet1");        excelexporttable("contentVStime",1,1,gettablerows("contentVStime"),gettablecols("contentVStime"));
    excelsave();
excelclose(1);
  #4  
Old 02-23-2012
Hao Zhou's Avatar
Hao Zhou Hao Zhou is offline
Flexsim User
 
Join Date: Sep 2010
Location: Long Beach
Posts: 66
Downloads: 56
Uploads: 0
Thanks: 78
Thanked 43 Times in 25 Posts
Rep Power: 146
Hao Zhou will become famous soon enoughHao Zhou will become famous soon enough
Default

For waiting in a queue object, you can write code in OnEntry trigger to close output by closeoutput(). And send delay message to itself in this trigger with you expected waiting time.
And write code in OnMessage trigger to open output by openoutput().
  #5  
Old 02-23-2012
Jack Lai Jack Lai is offline
Flexsim User
 
Join Date: Nov 2011
Posts: 32
Downloads: 17
Uploads: 0
Thanks: 22
Thanked 0 Times in 0 Posts
Rep Power: 106
Jack Lai is on a distinguished road
Default

Let me explain more detail, I hope the item leave the queue base on a random time, not FIFO or LIFO.

For example, start with item A,B,C,D and their entry time is 1,2,3,4 respectively.

Item |Entry time | Stay time in queue | Leave time
A 1 10 11
B 2 3 5
C 3 1 4
D 4 5 9

So the item will leave base the leave time, when the time arrived, the related item leave the queue.
  #6  
Old 02-24-2012
Hao Zhou's Avatar
Hao Zhou Hao Zhou is offline
Flexsim User
 
Join Date: Sep 2010
Location: Long Beach
Posts: 66
Downloads: 56
Uploads: 0
Thanks: 78
Thanked 43 Times in 25 Posts
Rep Power: 146
Hao Zhou will become famous soon enoughHao Zhou will become famous soon enough
Default

See the attached small model.
Attached Files
File Type: fsm test.fsm (68.7 KB, 86 views)
The Following User Says Thank You to Hao Zhou For This Useful Post:
Jack Lai (02-24-2012)
  #7  
Old 02-24-2012
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 Jack,

I would use a processor instead of a queue for your problem.
Change the maximum content in the processor and then under process time you set the delay time.

Lars-Olof
The Following 3 Users Say Thank You to Lars-Olof Leven For This Useful Post:
Steven Hamoen (02-24-2012)
  #8  
Old 02-24-2012
Jörg Vogel's Avatar
Jörg Vogel Jörg Vogel is offline
Flexsim User
 
Join Date: Sep 2007
Location: Hannover, Germany
Posts: 643
Downloads: 35
Uploads: 0
Thanks: 802
Thanked 665 Times in 410 Posts
Rep Power: 642
Jörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond repute
Default

Hi Jack,

another way can be the combination of Do Not Release Item in the function Send To Port (Flow Tab), send delayed message and the command releaseitem( obj item, num output port)

Message parameters are numbers. Therefore the object item must be converted to a number and later back to a node. Commands are tonum(obj) and tonode(num)

Jörg


Thread Thread Starter Forum Replies Last Post
How to extract data?? Jack Lai Flexsim Student Forum 1 12-13-2011 03:54 AM
3 queue problem shafizad Q&A 4 08-06-2010 01:51 PM
Pulling from a Queue vs Sorting the Queue Brandon Peterson Tips and Tricks 3 03-03-2010 01:27 AM
How to export the result of Perfoormace Measures Vic Li Q&A 0 11-11-2008 11:56 PM
Queue Sorting Jeff Nordgren Q&A 12 05-22-2008 03:21 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.