question

alistairlowe avatar image
0 Likes"
alistairlowe asked alistairlowe answered

Percentages in order

How do i set the 15% to be assigned first?


1745239372304.png

FlexSim 25.1.1
percentages
1745239372304.png (20.4 KiB)
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Matthew Gillespie avatar image
0 Likes"
Matthew Gillespie answered Matthew Gillespie commented

I'm not sure I understand what you're asking. It's only going to assign one of those two values. There's a 15% chance it assigns the value "Seed" and an 85% chance it assigns the value "Serial".

· 2
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

I am trying to get the first 15% to be Seed and then the rest to be Serial.


0 Likes 0 ·
Matthew Gillespie avatar image Matthew Gillespie ♦♦ alistairlowe commented ·

Then the By Percentage pickoption isn't going to be useful to you. The question is 15% of what?


The simplest way is probably to set this up in an arrivals table. Like if you have 100 items arriving make 2 entries. One with 15 items that get the Seed label and another with 85 items that get the Serial label.


Alternatively you could write a code snippet that keeps track of how many items have arrived and if the number goes above your 15% number then you switch. Something like:

string labelValue = "Seed";
if (current.NumArrivals > 15)
    labelValue = "Serial";
    
item.Type = labelValue;
current.NumArrivals++;

I've attached a sample model with these two approaches.

PercentArrivals.fsm

0 Likes 0 ·
percentarrivals.fsm (26.9 KiB)
alistairlowe avatar image
0 Likes"
alistairlowe answered

Thanks for the help.

5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.