Dear community members,
My model has different sources with different Mus (1 type per each source).
Each MU type has an attribute that generates a random number.
I did some tests with the statistics of one source and:
1.when I have only one source active, the first two random numbers for are 107 and 7
2. when I have 2 sources active (the previous plus another one) the first two random numbers are still 107 and 7
3. when I have 3 sources active (the previuos 2 and another one), the first two random numbers are 107 and 170
I believe that it should continue to give the same number, right? Wht it changes when I activate 3 sources?
I attach both the model with 2 sources and 3 sources for reference.
Solved! Go to Solution.
How about long series of random numbers?
Each Source has a unique random stream, so I would expect that those same values that you got were actually a coincidence.
The random numbers that an MU generates depends on the value of the built-in attribute RandomSeed of the MU class, the MU instance number, and the built-in attribute RandomNumbersVariant of the event controller.
This way – when you do multiple simulation runs – .MUs.Entity:1 will generate the same random numbers (as long as you are using the same RandomNumbersVariant).
It would help if you could share more observations.
It looks like your model still has 3 independent streams of random numbers (although it is for MU classes, not Sources). To me it is not unexpected behavior.
I retried with longer observation, here the results for source 1:
- using 1 active source, i get every time the same seuquence
- using 2 active sources, i get every time the same sequence that is different from the sequence with 1 source
- using 3 active sources, i get every time the same sequence that is different from the sequence with 1 source and 2 source
As each source has a different entity, the entity istance generated by the source should be the same. Also all the other settings are the same. I always reset the simulation before running it.
Then is it a normal behaviour? I was expecting to get always the same sequence from source one.
In your case, the behavior should be that each Source generates a unique and independent series of random numbers. So, Source1 should always gives the same output when you reset the simulation model. Source2 will generate a unique series, different from Source1, but that is replicated when you reset the model. The same for Source3.
If you want different figures every time you reset the model, go to Eventcontroller>Tools>Increment variant on reset.
In the sources you use a formula with a call to z_paraLogistic to define the interval. The first argument to z_paraLogistic which determines the random stream is always 1. This means all are using the same random stream which means they are influencing each other.
Ouch, you are right, Ralph. I was mixing things up!
To make things worse, the method called random contains this code: z_uniform(1, 1, 214);
All your methods and formulas are fishing in the same pond for their random numbers. So they do influence each other.