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
FAQ Downloads Calendar Search Mark Forums Read

Q&A Using Flexsim and building models

Reply
 
Thread Tools Display Modes
  #1  
Old 09-03-2009
Daglys Brizo Daglys Brizo is offline
Flexsim User
 
Join Date: Aug 2009
Posts: 1
Downloads: 0
Uploads: 0
Thanks: 3
Thanked 0 Times in 0 Posts
Rep Power: 0
Daglys Brizo is on a distinguished road
Default 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??
Reply With Quote
  #2  
Old 09-03-2009
Tom David's Avatar
Tom David Tom David is offline
Flexsim User
 
Join Date: Aug 2007
Location: Schwaebisch Gmuend, Germany
Posts: 430
Downloads: 157
Uploads: 47
Thanks: 486
Thanked 450 Times in 233 Posts
Rep Power: 516
Tom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant future
Default

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.

http://www.flexsim.com/community/forum/downloads.php?do=file&id=210
__________________
tom the (A)tom: "We have solved our problems ... now we have to fight the solutions."
Reply With Quote
The Following 3 Users Say Thank You to Tom David For This Useful Post:
Daglys Brizo (09-04-2009), Focus Kang (09-10-2009), Rachid Kolfin (09-04-2009)
  #3  
Old 09-04-2009
Rachid Kolfin Rachid Kolfin is offline
Simulation Consultant
 
Join Date: May 2008
Location: Amsterdam
Posts: 21
Downloads: 18
Uploads: 0
Thanks: 58
Thanked 37 Times in 16 Posts
Rep Power: 165
Rachid Kolfin will become famous soon enoughRachid Kolfin will become famous soon enough
Default 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
Reply With Quote
The Following User Says Thank You to Rachid Kolfin For This Useful Post:
Daglys Brizo (09-04-2009)
  #4  
Old 09-04-2009
Brandon Peterson's Avatar
Brandon Peterson Brandon Peterson is offline
The Flexsim Consultant
 
Join Date: Jul 2007
Location: Salt Lake City, Utah
Posts: 382
Downloads: 29
Uploads: 6
Thanks: 192
Thanked 516 Times in 235 Posts
Rep Power: 486
Brandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant future
Default

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.
Reply With Quote
The Following 2 Users Say Thank You to Brandon Peterson For This Useful Post:
Daglys Brizo (09-04-2009), Focus Kang (09-10-2009)
Reply

Tags
pull, restaurant

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
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


All times are GMT -6. The time now is 01:20 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.
Copyright 1993-2018 FlexSim Software Products, Inc.