question

jacopo-r avatar image
0 Likes"
jacopo-r asked Jason Lightfoot edited

Random numbers with Experimenter

Hi all,

I would like to know a bit more about the random numbers creation behind the experimenter.

I have noticed that every time I run, let's say, 15 replications of a specific scenario, the experimenter gives me the same results even though I delete the previous results and I close and re-open the model. To me, it seems like the random sequence is the same every time I run it. If so, is there a way to not have such repeatability in the random sequence? (I hope what I wrote makes sense.)

Besides, if I compare 15 replications of the same scenario run by the experimenter versus 15 replications run manually with random streams, the manual runs give me more variance within the results.

Thanks

FlexSim 23.1.2
experimenterrandom streamsrandom numbers
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
2 Likes"
Felix Möhlmann answered Jason Lightfoot edited

A given replication will always use the same random number sequence. This is done so that replications of different scenarios are comparable. For example, you want to compare two different configurations of your model. If the random numbers were different every time, then a replication doing much better in scenario 1 than in scenario 2 wouldn't have any meaning since this could just be variance based on the random number generator.

It is not possible to directly alter this behaviour. So your best bet is to simply run more replications instead of deleting the previous ones. (Though I do know that the result screen will get overly full at some point.)

You could try to alter which random number stream gets used (the part that normally says 'getstream(current)' or 'getstream(activity)'). Either as a model parameter so different scenarios will use different numbers or by using the system clock (command realtime()).

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

jacopo-r avatar image jacopo-r commented ·

Thank you for the answer

0 Likes 0 ·
Jason Lightfoot avatar image Jason Lightfoot ♦♦ jacopo-r commented ·

Repeating streams are needed for debugging and as part of a variance reduction technique that is best practice. You may also try using the randantithetic(1) function to better understand how sensitive the model is to the random samples.

2 Likes 2 ·