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
|
|||
|
|||
Multi-Processor Help
Hello,
I was wondering it it is possible to send an item to a port by case value and by percentage? So the end result would be, the Multi-Processor would only send a certain percentage of a particular item to a port. The remaining percentage would be sent to a different port. |
#2
|
||||
|
||||
Davie,
I am not sure if I understand your questions right, but there is a pick option in the Send To Port which is called By Percentage (inputs). I would think, if you use this code modify it, it would do the job. You could do something like that you use a switch statement depending on the item type. Code:
int iItemType = getitemtype(item); switch(iItemType) { case 1: { // insert whole code for percentage // or use example below break; } case 2: { // insert whole code for percentage // or use example below break; } default: { msg(getname(current),"Unexpected switch case!"); stop(); break; } } Or depending on the number of cases you have you could also build your own logic for the different itemtypes like return bernoulli(50,1,2); or using instead of bernoulli() dempirical() and a Global Table for the ‘// or use example below part’ in the above example. Okay, this is not a finished solution but hopefully gives you some hints to figure out a solution for you. If you have any problems or more questions, just feel free to ask. Good success. tom the (A)tom
__________________
tom the (A)tom: "We have solved our problems ... now we have to fight the solutions." |
#3
|
|||
|
|||
Thanks Tom,
I think that I figure out my problem by using Flow Nodes instead. Now I am pulling certain items in the Flow Node from the "Flow" tab. I've noticed that you can only pull one item at a time, so I tried using this following logic code Specify Itemtype Itemtype: 2||3||4||5||6||7||8||9||10 Though I do not get any error, this doesn't seem to work. I am sure it is possible to 'pull' more than one item, I'm just not sure how to code it. |
Thread | Thread Starter | Forum | Replies | Last Post |
Using multi-dimensional arrays with flexscript | Cliff King | Tips and Tricks | 0 | 12-15-2007 11:25 AM |