Cancel
Showing results for 
Search instead for 
Did you mean: 

Strange method behaviour

Valued Contributor
Valued Contributor

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.

 

8 REPLIES

Re: Strange method behaviour

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom

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.

 

Regards,

Gert Nomden


Gert Nomden
Senior Consultant | Tecnomatix Product Manager
cardsplmsolutions.com

Re: Strange method behaviour

Siemens Phenom Siemens Phenom
Siemens Phenom

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

_________________________________________________________________
Did you like the answer? Then click the Thumbs Up button.
Did the answer solve your problem? Then accept the answer as solution.

Re: Strange method behaviour

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom

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.


Gert Nomden
Senior Consultant | Tecnomatix Product Manager
cardsplmsolutions.com

Re: Strange method behaviour

Valued Contributor
Valued Contributor

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.

Re: Strange method behaviour

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom

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.

 

 


Gert Nomden
Senior Consultant | Tecnomatix Product Manager
cardsplmsolutions.com

Re: Strange method behaviour

Siemens Phenom Siemens Phenom
Siemens Phenom

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.

Regards,

Ralf
------------------------------------------------------------------------------------------------------
Did you like the answer? Then click the Thumbs Up button.
Did the answer solve your problem? Then accept the answer as solution.

Re: Strange method behaviour

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom

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.


Gert Nomden
Senior Consultant | Tecnomatix Product Manager
cardsplmsolutions.com

Re: Strange method behaviour

Valued Contributor
Valued Contributor

Ok I got it, I modified the randomseed and now I get always the same results, no matter how many active sources I activate.

Thank you