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
|
|||
|
|||
Send flowitems to different ports by percentage!
Good Evening,
In my model I have a rack connected to three different queues and I want that the items flow to the queues according to certain percentages. I know that this can be done with the "by percentage" option in the rack's flow; the problem is that my model needs to have 52 racks connected to 104 queues and that exceeds the "by percentage" capacity (it only accepts up to 10 ports). I need to know how can I make this possible, maybe if I use a table...but please let me know!! Need some urgent help! Dil Amaya |
#2
|
||||
|
||||
Test_DefinePortByPercentage_TD
You are right, if you use the Template Code, you only have 10 entries for the percentage. But what you can do is extend the code in the Code Edit by adding local variables (percent and result/port), adjust the percentage calculation and the return code. But this would be quite some effort, I guess.
Another way would be to use arrays for the local variables (percent and result/port) to make it more flexible. Define a local variable for the array size and this information can be used e.g. in a loop. You could then e.g. use a table to fill the array or directly do it in the code. That’s the way I would try to go. I modified your model a bit and it seems to work. I added a Global Table and changed the code in the Send To Port trigger.
__________________
tom the (A)tom: "We have solved our problems ... now we have to fight the solutions." |
The Following User Says Thank You to Tom David For This Useful Post: | ||
Pablo Concha (09-02-2009) |
#3
|
|||
|
|||
Hello,
What would be the difference between using the arrays option and just using the table ("PercentArray" in Tom's model) and calling it by the default "Discrete Empirical Distribution" option in the Send to Port field... regards.. Pablo Concha E. |
The Following 2 Users Say Thank You to Pablo Concha For This Useful Post: | ||
Tom David (09-02-2009) |
#5
|
||||
|
||||
Pablo,
You are right it would be good first to search through the pick options before writing own code. Thanks for pointing this out.
__________________
tom the (A)tom: "We have solved our problems ... now we have to fight the solutions." |
#6
|
|||
|
|||
Hello,
I'm trying to send 25% of items to a processor, and 75% of items to a conveyor. But, if the processor is busy processing, I want the items to go straight to the conveyor instead of waiting for the processor. So, I've tried adding code at the end of the template code for percentage, but with no success. I've attached a sample model trying trying to accomplish this. Thanks for any help. |
#7
|
||||
|
||||
Jamie,
If you have 1 processor and 1 conveyor then you could do the following: 1.Connect the first output port to the processor and the second one to the conveyor. 2.In the function that you are using to send to port return 0 for the processor and 2 for the conveyor. Returning 0 for the processor basically tells the item to go to the first open port. Because the processor is connected to port 1 it will try the processor first and if it is busy then it will go to the conveyor lilke you want. Good Luck, Brandon
__________________
thats not normal. |
The Following 2 Users Say Thank You to Brandon Peterson For This Useful Post: | ||
Phil BoBo (10-07-2009) |
Thread | Thread Starter | Forum | Replies | Last Post |
Using TE FlowItems to Transport other FlowItems | juan alberto | Q&A | 13 | 09-13-2009 09:00 AM |
Problem with Send to Output Port | Joe Allen | Q&A | 3 | 05-14-2009 02:38 PM |
Using Reevaluate Send To vs Pull | Brandon Peterson | Tips and Tricks | 4 | 11-19-2008 08:56 AM |
Automated creation of connections between ports | Matthias Hofmann | Q&A | 3 | 06-25-2008 03:04 AM |
how to send msg to another which do not have connection with the sender object | KelvinHo | Q&A | 3 | 03-05-2008 04:28 AM |