Define or divide item label by statistical distributions

Define or divide item label by statistical distributions

lagilata2
Not applicable
332 Views
2 Replies
Message 1 of 3

Define or divide item label by statistical distributions

lagilata2
Not applicable

[ FlexSim 22.2.0 ]

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.

0 Likes
Accepted solutions (1)
333 Views
2 Replies
Replies (2)
Message 2 of 3

FelixMoehlmann
Collaborator
Collaborator
Accepted solution

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:

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.)

0 Likes
Message 3 of 3

Jeanette_Fullmer
Community Manager
Community Manager

Hi @Rara Hasna, was Felix Möhlmann's answer helpful? If so, please click the "Accept" button at the bottom of their answer. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always comment back to reopen your question.

0 Likes