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-15-2007
Davie Stomp Davie Stomp is offline
Flexsim User
 
Join Date: Nov 2007
Posts: 13
Downloads: 2
Uploads: 0
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 152
Davie Stomp is on a distinguished road
Default Cashier line ups

hello,

i am trying to set the Oncreation (for a source) other than duniform.
i'll tell you what i want to do.
I am trying to simulate a line at a cashier station. There are four types of item i created (duniform 1,4). Each item represents a payment type(cash, credit, debit, and other). Given our data collection there is a high percentage of cash followed but credit, debit and other.

the question is: how do i set the Oncreation as a weighted percentage by item(cash, credit, debit...)?
  #2  
Old 11-15-2007
Anthony Johnson's Avatar
Anthony Johnson Anthony Johnson is offline
Manager of Product Development
 
Join Date: Jul 2007
Posts: 440
Downloads: 86
Uploads: 4
Thanks: 171
Thanked 899 Times in 288 Posts
Rep Power: 735
Anthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond repute
Default

Use a dempirical distribution. You'll need to set up a global table with 2 columns and one row for each itemtype. The first column designates the percentage probability of that row, and the second column represents the value that dempirical should return. Once you've set up the table, replace the duniform(1,3) function with dempirical("tablename") in the creation trigger.
The Following User Says Thank You to Anthony Johnson For This Useful Post:
Brandon Peterson (10-08-2009)
  #3  
Old 11-17-2007
Davie Stomp Davie Stomp is offline
Flexsim User
 
Join Date: Nov 2007
Posts: 13
Downloads: 2
Uploads: 0
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 152
Davie Stomp is on a distinguished road
Default

i have created a global table but i cannot find anything on the help index for the dempirical values. how do i find the dempirical values? and what would the interarrival times be?
<img>Global Table</img>
Attached Thumbnails
Click image for larger version
Name:	Global Table.JPG
Views:	355
Size:	131.8 KB
ID:	65  
  #4  
Old 11-17-2007
Kris Geisberger Kris Geisberger is offline
Flexsim Canada, Forum Moderator
 
Join Date: Aug 2007
Location: Canada
Posts: 209
Downloads: 54
Uploads: 1
Thanks: 99
Thanked 389 Times in 133 Posts
Rep Power: 451
Kris Geisberger has much to be proud ofKris Geisberger has much to be proud ofKris Geisberger has much to be proud ofKris Geisberger has much to be proud ofKris Geisberger has much to be proud ofKris Geisberger has much to be proud ofKris Geisberger has much to be proud ofKris Geisberger has much to be proud ofKris Geisberger has much to be proud ofKris Geisberger has much to be proud of
Default

Go to Help > Commands and search for dempirical. There you should find the following description:

dempirical(str tablename, num stream)

Description:
A discrete empirical distribution function. Will randomly return a discrete value as defined by column 2 of the global table referenced. It is expected that column 1 of the table contains percents and column 2 contains values. The percents in column 1 must add up to 100.

Example:
int outport = dempirical("SendToTable",1);

This sets outport to a random value that is determined by the GlobalTable called SendToTable.
I noticed in your screenshot that your column1 does not add to 100. Also, your value column is still all zeros. These are the values that your dempirical() will return.

If you are trying to create 4 itemtypes (cash, credit, debit, other) according to the ratio of the percents in column1: Set column2 to 1,2,3,4 and use dempirical("yourtablename",1) in the OnCreation trigger with the Set Itemtype pick option.

The inter-arrival time is related to how frequently one of these 4 items shows-up at the cashier. If you know the inter-arrival timing of each of these 4 items separately, you may want to consider using 4 separate sources (one to create each of the 4 itemtypes).

Kris
The Following User Says Thank You to Kris Geisberger For This Useful Post:
Brandon Peterson (10-08-2009)
  #5  
Old 11-19-2007
Davie Stomp Davie Stomp is offline
Flexsim User
 
Join Date: Nov 2007
Posts: 13
Downloads: 2
Uploads: 0
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 152
Davie Stomp is on a distinguished road
Default

hey kris,

Thanks a lot for your help. i got the results that i thought i would, but i wanted you to look over my work just to make sure i understood everything. i have attached screenshots for the Oncreation, Onexit, Global table, Processor values, and the sim screenshot.

let me know what you think
Attached Thumbnails
Click image for larger version
Name:	1.JPG
Views:	380
Size:	151.1 KB
ID:	66   Click image for larger version
Name:	2.JPG
Views:	364
Size:	147.1 KB
ID:	67   Click image for larger version
Name:	3.JPG
Views:	356
Size:	150.7 KB
ID:	68   Click image for larger version
Name:	4.JPG
Views:	328
Size:	160.2 KB
ID:	69   Click image for larger version
Name:	5.JPG
Views:	327
Size:	156.6 KB
ID:	70  

  #6  
Old 11-22-2007
Kris Geisberger Kris Geisberger is offline
Flexsim Canada, Forum Moderator
 
Join Date: Aug 2007
Location: Canada
Posts: 209
Downloads: 54
Uploads: 1
Thanks: 99
Thanked 389 Times in 133 Posts
Rep Power: 451
Kris Geisberger has much to be proud ofKris Geisberger has much to be proud ofKris Geisberger has much to be proud ofKris Geisberger has much to be proud ofKris Geisberger has much to be proud ofKris Geisberger has much to be proud ofKris Geisberger has much to be proud ofKris Geisberger has much to be proud ofKris Geisberger has much to be proud ofKris Geisberger has much to be proud of
Default

There are three parts to your assignment. You should know:
1. the arrival rate of your customers
2. the distribution of the 4 payment types (this is your empirical table)
3. the process times (at the cashier) based on the payment type

Your Global Table called "payment" is set up perfectly for a discrete empirical table (2.jpg). When you call: dempirical("payment",1) it will return one of the values in column 2 (1,2,3 or 4 in your case) based on the percentages in column 1. NOTE the ,1 in the dempirical() is the number stream and has no relation to the values in column 2. (1.jpg is not correct)

That being said, you seem to be confused about the function of the OnCreation trigger. The OnCreation does not cause items to be created, rather it is executed WHEN an item is created by the Source object. (It will be triggered once for every item that is created.) It is the first opportunity for you to characterize the items that are created.

The Source tab of the Source object contains an Arrival Style which governs the timing of item creation of this source. The default option is Inter-Arrival Time where you can specify the time that passes before this source creates another item (customer in your case).

If you have data that describes the time between customers, you can use one Source object to create the customers at that Inter-Arrival time. Then OnCreation set the itemtype to dempirical("payment",1). Again, this single statement will characterize your customers (set the itemtype) with one of the 4 payment types. Then, as you have done already, set the ProcessTime of the Processor to be based on the itemtype of the customer.

If you do not have data that describes the arrival rate of the customers, you can set the Arrival Style of the Source to Arrival Sequence then check the Repeat Schedule/Sequence check box. Note that this will create an infinite supply of customers, therefore your cashier will never be idle. As long as you set the itemtype based on the empirical table you will still have the distribution of payment types you are looking for.

Be careful, it looks like (3.jpg) you are setting the itemtype a second time in the OnExit trigger. The OnExit is excuted just before the item leaves the Source (after creation), thus setting the itemtype again in the OnExit will overwrite what you set it to in the OnCreation trigger.
The Following User Says Thank You to Kris Geisberger For This Useful Post:
Brandon Peterson (10-08-2009)
  #7  
Old 11-29-2007
Davie Stomp Davie Stomp is offline
Flexsim User
 
Join Date: Nov 2007
Posts: 13
Downloads: 2
Uploads: 0
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 152
Davie Stomp is on a distinguished road
Default

Kris thanks a lot. Your comments and in put have been most helpful



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.