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 09-03-2009
KelvinHo KelvinHo is offline
Flexsim User
 
Join Date: Jan 2008
Location: Hong Kong
Posts: 129
Downloads: 18
Uploads: 1
Thanks: 44
Thanked 23 Times in 7 Posts
Rep Power: 171
KelvinHo will become famous soon enough
Default Random pick item

Hi,

I would like to ask a simple question as below:

In the connection of:
source -> queue -> combiner
what can i do to let the combiner to random pick items in the queue (not fifo or lifo)?
  #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: 520
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

My first idea would be to define the position of the items in the queue at OnEntry, which can be random:

int iRank = duniform(1, content(current) + 1);
setrank(item,iRank);

The combiner always takes the first item and if I change the rank in the queue it is a kind of randomness which one he chooses.
It is not exactly what you are asking for, but I guess it could be still a solution. Or at least it will give you a hint.
__________________
tom the (A)tom: "We have solved our problems ... now we have to fight the solutions."
The Following 2 Users Say Thank You to Tom David For This Useful Post:
KelvinHo (09-09-2009)
  #3  
Old 09-03-2009
KelvinHo KelvinHo is offline
Flexsim User
 
Join Date: Jan 2008
Location: Hong Kong
Posts: 129
Downloads: 18
Uploads: 1
Thanks: 44
Thanked 23 Times in 7 Posts
Rep Power: 171
KelvinHo will become famous soon enough
Default

Thanks, problem solved
  #4  
Old 09-03-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: 490
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

Kelvin,

Another method would be to randomly select an item from the Queue with the Pull Requirement. You would need a label to store a variable and the following code.

if(getrank(item) == 1)
{
setlabelnum(current, "ItemRank", duniform(1, content(inobject(current, port))));
}

return getrank(item) == getlabelnum(current, "ItemRank");

If you only wanted to do the random pull for the pallets or for the items then you would need a port check first. Here is the code for that:

//Only randomly pull pallets
if(port > 1) return 1;

//Only randomly pull items
if(port == 1) return 1;

So, now you have two different methods to do the same thing.

Good Luck,
Brandon
__________________
thats not normal.
The Following User Says Thank You to Brandon Peterson For This Useful Post:
Tom David (09-03-2009)


Thread Thread Starter Forum Replies Last Post
Pick window on conveyor. Neil Brandon Q&A 9 02-04-2013 03:12 AM
Repeat Random Streams Cliff King Q&A 16 08-30-2012 10:49 AM
I would like the pick up from the rack in function of a variable demand rate... mariogib Q&A 1 03-13-2009 10:53 PM
Flexsim beginners are sometimes just amazing (Rack - Pick Operator) Tom David Q&A 1 12-05-2008 10:35 AM
More random random number Paul Dowling Q&A 6 06-01-2008 07:30 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.