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 |
#1
|
|||
|
|||
How to pull items from a queue?
Hi! I'm working on a project in which I have to simulate a restaurant in a food court. I'm trying to do the following thing: I have two sources in my model. One generates the "Clients" flow items and the other one generates the "food". So I want to pull one food item from a queue to a processor when a client arrives to a certain point, and when the food is finally processed, the client and the food go to the sink. Is it possible to do something like that??
|
#2
|
||||
|
||||
This can be done by controlling the output of the objects (closeoutput() and openoutput()). Close the output of the food queue at OnReset and OnExit. OnMessage open the output. Send a message (senddelayedmessage()) when a client arrive at a certain point (OnEntry). Here you should also control the output of the object as you do in the food queue. If the food is processed (OnProcessFinish) send a message to the clients object to open the output.
So the commands you need are closeoutput(), openoutput() and senddelayedmessage(). I guess in the download section are some models using this mechanism. First model which comes to my mind are the Sample_MilkrunKanbanSystem_TD model. But maybe it is not easy to find the code because the model is a bit more complicate. /downloadPages/file&id=210
__________________
tom the (A)tom: "We have solved our problems ... now we have to fight the solutions." |
The Following 3 Users Say Thank You to Tom David For This Useful Post: | ||
Rachid Kolfin (09-04-2009) |
#3
|
|||
|
|||
How to pull items from a queue?
Tom is absolutely right, it is the most simple way of doing this. I would only like to add that you will probably want to send the type of food as a parameter of the message that the customer sends on arrival. So what type of food did the customer choose. Maybe then it is a good idea to store this parameter as a label on the food so it knows how long the "processing" takes.
Good luck, Rachid Kolfin |
The Following User Says Thank You to Rachid Kolfin For This Useful Post: | ||
Daglys Brizo (09-04-2009) |
#4
|
||||
|
||||
Rachid,
If you are sending the message to open the input of the processor so that it will make the food, then there is possibly an easier way to make the processing time dependent on the person's choice for their type of food. The Process Time trigger can check for the type of person. The code may look lik the following (I am assuming a center port connection between the processor and the object the customer is in, and that the food is available immediately upon the customer arrival): switch(getitemtype(last(centerobject(current, 1)))) { case 1: //customer type 1 return 5; case 2: //customer type 2 return 10; case 3: //customer type 3 return uniform(5,10,1); default: //all other customer types return 15; } This may simplify your code a little bit. Good Luck, Brandon
__________________
thats not normal. |
The Following 2 Users Say Thank You to Brandon Peterson For This Useful Post: | ||
Focus Kang (09-10-2009) |
Tags |
pull, restaurant |
Thread | Thread Starter | Forum | Replies | Last Post |
Pulling from a Queue vs Sorting the Queue | Brandon Peterson | Tips and Tricks | 3 | 03-03-2010 01:27 AM |
Using Reevaluate Send To vs Pull | Brandon Peterson | Tips and Tricks | 4 | 11-19-2008 08:56 AM |
Pull items out of a rack | BenjaminBuecklein | Q&A | 1 | 09-22-2008 03:59 AM |
Operator not unloading items before picking up priority items | Howe Chiat Cheng | Q&A | 2 | 05-28-2008 02:05 AM |
Pull Logic Dillema | William Proctor | Q&A | 2 | 09-14-2007 12:46 PM |