How to create items from source by percentage?

How to create items from source by percentage?

adity_kamath
Not applicable
251 Views
11 Replies
Message 1 of 12

How to create items from source by percentage?

adity_kamath
Not applicable

[ FlexSim 16.0.2 ]

I want to be able to create 3 different item types from a source such that each item type has a fixed percentage of being created (All percentages add to 100%). How can I do this in the source object?

0 Likes
Accepted solutions (1)
252 Views
11 Replies
Replies (11)
Message 2 of 12

regan_blackett
Autodesk
Autodesk
Accepted solution

The easiest way to do this would probably be the use of a dempirical() distribution in the "Set ItemType and Color" option under the OnCreation Trigger of the Source. demprical takes the name of a Global Table as it's parameter that is formatted such that you have a row for each value you want returned by the distribution and two columns. Column one should have the percentages and column two should have the associated values as show below:

2730-demprical-table.png

So the value in column 2, row 3 will occur 50% of the time.

In your Source triggers, you could have something like this:

2731-oncreation.png

The Item Type field would then use the values and percentages defined in the table.

Message 3 of 12

jeff_nordgren
Not applicable

@Aditya Kamath

Aditya,

An alternative to the global table method referenced by Regan, you can just select the "By Percentage" dropdown option from the Inter-Arrivaltime field.

2732-percent1.png

Then you can just add the number of percentage breakdowns that you want, totaling 100%. In the dropdown option where you specify the percentages, the second field title is "Time". Ignore that, that should be changed. It should read something like the popup that says "Enter value or expression" (right arrow). Other than that, just make sure that the percentages add up to 100.

2733-percent2.png

Message 4 of 12

adity_kamath
Not applicable

@regan.blackett This is exactly what I was looking for. Thank you!

0 Likes
Message 5 of 12

adity_kamath
Not applicable

@Jeff Nordgren Thanks for sharing this! I did explore this option, however it looks like I am assigning percentages to the inter-arrival time and not the itemType or numbers of each item type. Is that right?

0 Likes
Message 6 of 12

michael_kramer1
Not applicable

When I need to use percentages I usually use an "Assign Labels" right below the "Source," then use the "Assign Labels" to create the percentages.

2746-percentage3.png

Message 7 of 12

jeff_nordgren
Not applicable
@Aditya Kamath

Aditya,

As you have discovered, the answer given by Regan is the best answer for your situation.

0 Likes
Message 8 of 12

adity_kamath
Not applicable

@Michael Kramer THanks for youe help!

0 Likes
Message 9 of 12

victor_rv
Not applicable

I am trying to use the function of Item type by percentage, but I do not have the proper output.

I have a source that delivers 4 items (Arrival schedule at time 0, and the items are pallets). I need that each item has 25% (one item of each time and if I increase from 4 to 8 items, then 2 items of each).

I've added a trigger on creation, Set Item Type by Percentage, and create four positions, with a percentage of 25% for each item type

16204-trigger-on-creation.jpgitem-type-by-percentage-task.fsm

My problem is at the end, I have 4 items, two for type 1, and one for type 2 and 3, but i don't have any item 4. (also if I increase the delivery to 8 items, I obtain 4 type 1, 2 type 2 and 2 type 3, but none item 4

Which is my error?

0 Likes
Message 10 of 12

marcello_rosadini
Not applicable

Hi Victor,

If you cannot find the answer to your question on the site, please create a new question.

There is no error. When you choose that option, what you are stating is, that you want a distribution of items in those percentages. The larger the sample, the closer those values will fit.
Take a coin flip as an example: There is a 50% chance that you will get a head and a 50% chance you will get a tail.

That doesn't mean that if you toss the coin 2 times you will get 1 head and 1 tail. You could get also 2 tails or 2 heads.

If you flip it 1 million times it is very likely that you will have approximately 50-50

In your example in such a small sample it could be possible that you get all 4 items of just 1 item type.

Depending on what you need, probably assigning the item type by percentage is not the best option and you should set a fixed value from the beginning,

0 Likes
Message 11 of 12

stephanie_y
Not applicable

How do you create or edit the table?

0 Likes
Message 12 of 12

Jacob_Gillespie
Autodesk
Autodesk
@Stephanie Y

Create the table by opening the tool box, clicking the + button and selecting Global Table.

If you have any more questions then please create a new question instead of a comment on an old question.

0 Likes