Generating token based on probability and distribution

Generating token based on probability and distribution

Vns
Not applicable
154 Views
5 Replies
Message 1 of 6

Generating token based on probability and distribution

Vns
Not applicable

[ FlexSim 22.0.8 ]

Hi -

im not quite sure if there is a way to generate tokens based on the following conditions:

Set a probability for token creation for each hourly slot. In the event a token where to be created set a randomize quantity distribution to be generated.

Time intervalProbabilityQty
0600 - 065920%1 - 4 (2)
0700 - 0759
50%1 - 4 (1)
0800 - 0859
10%1 - 4 (4)


Thanks in advance.




0 Likes
Accepted solutions (1)
155 Views
5 Replies
Replies (5)
Message 2 of 6

moehlmann_fe
Enthusiast
Enthusiast
Accepted solution

To use different expressions for the hours of the day, it would be best to use the "Date Time Source".

One way to either create no tokens or a random number is to just multiply two distributions together. "bernoulli" can be set up to either return 1 or 0 with the given probability. So only if it returns 1 will the quantity be something other than 0. The second distribution controls the quantity if it does return 1.

1675009684625.png

0 Likes
Message 3 of 6

jason_lightfootVL7B4
Autodesk
Autodesk
bernoulli takes a percentage value not probability - so bernoulli(20,1,0) gives 20% chance of returning 1.
Message 4 of 6

moehlmann_fe
Enthusiast
Enthusiast
Right, that's an oversight on my part. Thanks for the correction.
0 Likes
Message 5 of 6

Vns
Not applicable

Thanks @Felix Möhlmann / @Jason Lightfoot for sharing the inputs.

I can't seems to get the model to run to generate the tokens based on this setup. Is there a step that i missed? probability and distribution.fsm

0 Likes
Message 6 of 6

moehlmann_fe
Enthusiast
Enthusiast

Put the expression into the Arrival field at the bottom that appears when you have a table cell selected, not into the table directly. (Writing it into the cell directly interprets it as text, not FlexScript).

1675061928943.png

In your case the resulting table should look like this:

1675061949963.png

You only see the first row of the code that gets auto-generated when you type in the expression. This was changed in version 22.2 which my screenshot above is from.

Sorry for the confusion.

0 Likes