question

Rara Hasna avatar image
0 Likes"
Rara Hasna asked Jeanette F commented

Define or divide item label by statistical distributions

Hello, if I use Inter-Arrival Time on Source with statistical distributions and want to divide or define the items into 3 types by another statistical distribution, what should I use? I know that if I want to define it by percentage, then it works with Triggers - Set Label by Percentage, but is it possible to define it by statistical distributions?


It will be easier if there is any way to solve that without using Process Flow because my model is already complex and it will take much time to revise it all as process flow, but if there is any example of how to use it I will really appreciate it, thank you.

FlexSim 22.2.0
statistical distributionitem labeldefine
· 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.

1 Answer

Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered

You can use the "Code Snippet" option (or write code directly in the code editor window) to write any code you want into a trigger function. This includes assigning the return value to a label.

Most statistical distributions will return a decimal number. To get an integer (if that's the goal) you'd have to round the result. For example:

  1. item.LabelName = Math.round(gamma(0, 5, 10, getstream(current)), 0);

(This requires item to be a variable declared in the header of the trigger code. Essentially any trigger that normally let's you set labels on an item will have that.)

5 |100000

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