question

Pieter Cecat avatar image
0 Likes"
Pieter Cecat asked Pieter Cecat commented

dempirical to randomly distribute items over several queues

Hi everyone

I am using 'dempirical' to select a scenario at the start of every 2 months (1 month = 720 hours = time unit model). However, I do not think it is working properly as I have set some scenarios' probabilities equal to zero to check the function's accuracy but as it turns out, FlexSim still selects that scenario.

My discrete distribution should contains 5 values with corresponding probabilities (0,1 / 0,2 / 0,4 / 0,2 / 0,1). Probability percentages are entered in column 1 starting with row 1 of the table, and the associated values are entered in column 2.

Attached you find my model. The values are entered in the global tabel "SCENARIOS" and the dempirical function is called upon in my triggers for the Graded_Cores_Inv-queue.

I have been really stuck trying to solve this issue so any help would be appreciated.

Thank you in advance!

Pieter

uncertain-quantity-quality-cores.fsm

FlexSim 16.0.8
flexscripttriggersscenariodempirical
· 2
5 |100000

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

Joerg Vogel avatar image Joerg Vogel commented ·

Are setting discrete integer values in your table, or have you set decimal values as shown above?

Maybe you use integer values in your table and compute their floating appearance in your function instead.

0 Likes 0 ·
Pieter Cecat avatar image Pieter Cecat Joerg Vogel commented ·

Hi @Jörg Vogel

Thanks for your reply!

My table looks like this (also see my attached model)

I still have no idea why 'dempirical' doesn't work as it should not return values 2, 3 and 5 for Scenario considering they have 0 probability of occurence.

I am using it as follows in my triggers:

to get a scenario according to the table above

to get the table of the scenario that occurred in order to distribute my items according to that table (see table below for example scenario 2)

I don't see what I am doing wrong.

0 Likes 0 ·
htsuf.png (2.9 KiB)
rewxr.png (939 B)
j5n6f.png (1.8 KiB)
1.jpg (8.9 KiB)

1 Answer

·
Jeff Nordgren avatar image
0 Likes"
Jeff Nordgren answered Pieter Cecat commented

@Pieter Cecat,

The first thing I noticed is that your SCENARIOS table is invalid. It only adds up to 1, not 100. From the User Manual:

dempirical (str/node/num table[, num stream]) Returns a random sample from a discrete empirical distribution

Description A discrete empirical distribution.The table referenced must contain a list of values and probability percentages associated with each of the values. Probability percentages must be entered in column 1 starting with row 1 of the table, and their associated values are entered in column 2. The table may have as many rows as needed to define as many values as desired. The percents are entered as numbers between 0 and 100, and should add up to a total of 100 percent; otherwise any values defined after a cumulative percentage of 100 is reached will never be returned.

The numbers in column 1 MUST add up to 100, no more, no less for the dempirical() distribution to work.

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

Pieter Cecat avatar image Pieter Cecat commented ·

Thank you for noticing! It's easy to not see these small errors.

Regards

Pieter

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.