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
|
|||
|
|||
Creating more than one itemflow in source (inter-arrival time style)
Problem::
I would like a source to generate 14 flowitems all at the same time( which this time is determined by an exponential distribution for the first working shift (0-7 hr). ) for example, a camion comes with 14 packages at some unknown time in the first shift. My unsuccessful Approach:: I tried to create more than one itemflow in inter-arrival time style in source. I used the "by time of day" pick-down option. it is only possible for one item in this case then, a solution would be to use a seperator to unpack one item to several (say 14) in above configuration. Do u have any better suggestion |
#2
|
|||
|
|||
Hi,
I would use your suggested approach with the separator, it is a easy solution to do and you will be using Flexsim standard objects. Lars-Olof |
#3
|
|||
|
|||
Hello shafizad,
If you only have to set the arrival time once, you could choose an arrival schedule of one row on the source, with a quantity of 14. On the Reset Trigger of the source you could define a double ArrivalTime as an exponential distribution. You add the Arrival Time to the table with the following code: setnodenum( node( "/schedule/1/1", variables( current ) ), ArrivalTime ); Of course if you need to change the arrival time more than once, you could add this code to the message trigger and send a message each time you need the arrival time changed. Esther |
The Following 2 Users Say Thank You to Esther Bennett For This Useful Post: | ||
Steven Hamoen (07-09-2010) |
#4
|
|||
|
|||
In this model I send a message on the source creation trigger to itself with the idea to use the OnMessage pickoption to create a number of flowitems. I had to add releaseitem() to that pickoption though which is why I post the model here.
This allows you to retain the exponential inter-arrival time. |
The Following 5 Users Say Thank You to Jason Lightfoot For This Useful Post: | ||
Tom David (07-09-2010) |
#5
|
|||
|
|||
Quote:
I had the same idea as you at the first place, but the problem is that each time you create an item, it sends a message. for each message it does create surplus flowitems and also sends messages(unfortunately). this is a loop creating unwanted additional flowitems. |
#6
|
|||
|
|||
Quote:
Could u upload a model of your suggestion.(actually, I am new to this kind of programming and I need more than a hint). btw, I expect my model to work 5 days of week and for each day, I want a camion (say, containing 14 packs) arriving at some exponentially distributed time in the first shift. |
#7
|
|||
|
|||
Solution Found.
I would like to thank the contributions.
ONLY, you have to add in the OnCreation this line of code insertcopy(...); BEST, |
#8
|
|||
|
|||
Hello Shafizad,
I did not build a model, so I will not upload it and actually I like Jason's solution a little better, but I will try to explain a modified version of his model and maybe you will understand better. You could go at it like this: Make sure that the source doesn't create objects 'automatically'. In Jason's model, one objects is created every 100 seconds and with the OnCreation trigger, he adds another 13 objects and that is not what you want. You could select the arrival schedule option and define that the source should not create any objects at time 0. (set quantity to 0 ) and don't use the OnCreation trigger. Now on the triggers tab you open the OnReset trigger. In this trigger you define a FirstArrivalTime, based on the first time you want the objects to arrive in your model. You send a delayed message to current, with a delay of FirstArrivalTime. On the OnMessage trigger of the source, you select the pick option: CreateFlowItem. If you want to create 14 objects everytime, you can just set the Number to create to 14 (in stead of msgparam(1). If you want to create the same flowitem, you can set the Flow item bin rank to 1 (in stead of msgparam(2). The destination would be the queue and could be referred to as outobject( current, 1 ) (in stead of current). If you test it like this, you will see that 14 obejcts will be created at FirstArrivalTime. Now you would like to repeat this for every first five days of every week. At the end of the OnMessage trigger, you would have to create a value NextCreationTime, that defines the duration between the current camion and the next camion. Then again send a delayed message to current with the delay NextArrivalTime. I hope this made you understand a little bit better how you can use the different triggers to manipulate the source object to get what you want. Good luck, Esther |
The Following 2 Users Say Thank You to Esther Bennett For This Useful Post: | ||
Tom David (07-12-2010) |
#9
|
|||
|
|||
Quote:
I liked the way you manipulate the messages. it works fine btw. I had also used the Timetable for the shutdown of source object for the shifts I didn't want. Your suggestion is better than Jason because it allows easier manipulation of exponentially distributed of arrival time. (because my next-level problem is to have 2 such camions at exponentially distributed time at the deposit.) IF u don't have time, IGNORE THE LINES BELOW, PLS: I believe the solution would be a good pick-up option to be added into the standard library of Flexsim and be called "Camion source style" Last edited by shafizad; 07-12-2010 at 08:09 AM. Reason: my next-level problem |
Tags |
by time of day, inter arrival time, shift, source |
Thread | Thread Starter | Forum | Replies | Last Post |
Arrival schedule Source | Nico Zahn | Q&A | 3 | 12-15-2008 04:23 AM |
Time-Varrying Source Doesn't Like Small Standard Deviation | david_white | Q&A | 10 | 06-26-2008 01:31 PM |
the accurate time of creating a TS? | qin tian | Q&A | 1 | 05-26-2008 06:23 PM |
Inter Arrival Time by Time of Day Mod | Brandon Peterson | Tips and Tricks | 0 | 04-23-2008 11:13 AM |
How to use the actual date/time data in Arrival Schedule Mode of Source | syseo | Q&A | 0 | 10-12-2007 08:22 PM |