question

Stephanie Y avatar image
0 Likes"
Stephanie Y asked tannerp commented

How do I create a source with different label types at fixed percentages?

I have reviewed existing answers and they are not working for me. I would like a source to generate 3 different label types at fixed percentages. Labels and percentages are: A = 47.5%, B= 5%, C= 47.5%. I am using 3D modeling (not process flow).

FlexSim 20.0.0
percentagesconveyancesource labels
· 1
5 |100000

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

Stephanie Y avatar image Stephanie Y commented ·

I would also like to assign colors to the label types

0 Likes 0 ·

1 Answer

·
Joerg Vogel avatar image
1 Like"
Joerg Vogel answered tannerp commented

It is a discrete empirical distribution.

int returnVal = dempirical(global table name, number random stream);
You set a column of percentage values that sum up to 100. The second column row contain a discrete value that is returned in the probability of the percentage value.
You assign the return value to a label.
You use this value to translate it into other attributes like string or color. You find picklist options which are called like “color by case”. The case value is your label value.
· 3
5 |100000

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

Stephanie Y avatar image Stephanie Y commented ·

I think I got this to work but instead of "number random stream" I used "getstream(current)" can you explain what theses terms mean and what their function is?

0 Likes 0 ·
tannerp avatar image tannerp Stephanie Y commented ·

The code "getstream(current)" is simply reading a numerical value from the current object (a Processor, Queue, or something else) and then using that value to prime a random number stream. For more information on number generation, you can read through articles like this one, but it's mostly just important to know that in simulation software, the more randomness there is, the better. This reduces the chance of running your model with the same variables every time.

1 Like 1 ·
tannerp avatar image tannerp Stephanie Y commented ·

And to clarify, I'm fairly certain that Jörg was just using that line of code as an example; those aren't meant to be specific strings/variables.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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