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
|
|||
|
|||
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
|
||||
|
||||
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) |
#4
|
||||
|
||||
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 |