question

Sebastien avatar image
0 Likes"
Sebastien asked Phil BoBo commented

Repeat Random Stream with model parameters

Hi,

We have a model where we can change parameters of a system within Global Tables, that changes for instance the arrival rate of the material flow.

If we have our first simulation run with x=20 and then use another value like x=30 and run the simulation again, we obtain different results with our models which is normal.

But once we change it back to 20, should we have the same results or is it normal that we obtain different random values ?

I don't know exactly how the random stream works in that case. When does it change ?


FlexSim 20.2.3
flexsim 20.2.3random streams
· 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.

Ben Wilson avatar image Ben Wilson ♦♦ commented ·

Hi @Sebastian, was one of Ralf Gruber's answer helpful? If so, please click the red "Accept" button at the bottom of one of the answers. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always unaccept and comment back to reopen your question.

0 Likes 0 ·
Ralf Gruber avatar image
1 Like"
Ralf Gruber answered Phil BoBo commented

Sebastian,

if Random Streams are set to repeat, the same initial model should get you the same results with the same parameters. Are you sure, your model is always reset to the same initial status? E.g. do you put Task Executers on a designated spot at reset, or do they start where ever they have been left in the previous run?

Check your model for that

Good luck

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

Repeat Rand Streams is an option in Main Menu “Statistics“.

0 Likes 0 ·
Sebastien avatar image Sebastien commented ·

@Ralf Gruber thank you for your answer. As far as we know all the necessary values and Task Executers are reset and the random stream option in statistics is activated. We went through the manual and checked all the points adressed there.

Yet, we have'nt initialised all the variables to a default value but I don't think we would have some repetition then. We will look futher into it. Maybe we missed something otherwise we will try to initialize all the variables to a default value.

0 Likes 0 ·
Sebastien avatar image Sebastien Sebastien commented ·

@Ralf Gruber. How is it possible that our model is repeatable on our computers but not on a computer from a partner, knowing that he did not change anything to the model ?

0 Likes 0 ·
Ralf Gruber avatar image Ralf Gruber ♦ Sebastien commented ·

For as long, as they do have a set value, you should be fine.

0 Likes 0 ·
Sebastien avatar image Sebastien commented ·

@Ralf Gruber,

Sorry for digging up the subject again. We dug deeper in the issue. The Event Log shows a difference once the first patient comes into the system and should walk to the first waiting line. The only difference is with the parval(2) although the events happen at the same time this parval(2) is different (parval(2): 2516010663936,000000 != parval(2): 2512319938560,000000). This is the line in the log:

What is this variable and how is it that it is different between two model runs ?

410,502655 BeginTask: NodeFunction /Patient1 /Tools/People/Flows/Activities/Walk/Travel>variables/callbackNode parnode(1): /Tools/People/Flows/Activities/Walk>stats/instances/Patient1 parval(2): 2516010663936,000000 parval(3): 0,000000 parval(4): 0,000000
0 Likes 0 ·
Phil BoBo avatar image Phil BoBo ♦♦ Sebastien commented ·

That's just a pointer difference. That's expected.

When using the event log to find why a model isn't repeatable, you need to find the first event where the time is different. Whatever generated the event with a different time is the source of the repeatability issue. Having different memory addresses in the params is expected.

1 Like 1 ·
Sebastien avatar image Sebastien Phil BoBo ♦♦ commented ·

Oh I see. Thank you ! I'll look deeper into the issue.

0 Likes 0 ·
Show more comments
Ralf Gruber avatar image
0 Likes"
Ralf Gruber answered

Are you doing any calculations OnDraw? These would be dependent on screen refresh rate, which could explain different results on a different computer. You should never do that. Or are you maybe reading positions of objects without calling updatelocations, e.g. items on conveyors?

These are all guesses, the model would probably help ;)

5 |100000

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

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.