Random seeds

357 views
Skip to first unread message

Jean-Christophe S.

unread,
May 18, 2015, 5:10:06 AM5/18/15
to jaamsi...@googlegroups.com
Hello Harry,

I come back to a subject we already spoke about, which is the variable random seed.

On my last model, they are about 25 objects that generate random variables.

And the final result (OEE), strongly depends on these seeds (+- 5%).

It means that to test the variability of the model I have to run it several times and between each run, I have to change the 25 random seeds.

I know it's possible to define a global seed, but it's also a particular configuration, because in that case, all the objects will follow the same sequence.

So my request is to have the possibiilty to set the random seed to a special value (-1 for example) for that in this case, the random seed is not constant but depends for example on the processor clock.

Users who want to have a determistic model can continue to set the random seed to a specific value, and those who want an heuristic model can set the seeds to the "processor clock" value.

An extension to this would be to have the possibility to run automatically a model several times, and record some key final parameters at each loop.

Thank you for you answer.


Harry King

unread,
May 18, 2015, 11:40:35 AM5/18/15
to jaamsi...@googlegroups.com
Jean-Christophe,

I think you are misinterpreting the meaning of the GlobalSubstreamSeed keyword. This keyword works together with the RandomSeed keyword to determine the random sequence. When you change the GlobalSubstreamSeed, every random sequence is changed. Furthermore, distributions with different RandomSeed inputs will continue to have different random sequences. In other words, the random sequence is a function of BOTH the GlobalSubstreamSeed and the RandomSeed inputs.

For your model, you should provide each of the 25 distributions with a unique input for RandomSeed (seed value 1 - 25 are fine) and set the GlobalSubsteamSeed to 1 for your first run, 2 for your second run, etc. In this way, you only need to change one input for each run.

After reading the pop-up descriptions for the two inputs, I can see why you are confused. The user manual is only slightly better. I'll re-write these descriptions later today!

Harry

Jean-Christophe S.

unread,
May 19, 2015, 5:49:00 AM5/19/15
to jaamsi...@googlegroups.com
Hello Harry,

You're right. I missunderstood the GlobalSubstreamSeed Keyword.

Now it works and it's really much easier. Thank you very much for your answer, next time I read the manual before posting a request.

Regarding the second part of the request ( possibility to run automaticaly a number of time the same model, but changing the globalseed at each run), do you think you can integrate it in the wishes list. I would rate it 3 on 5.

Best regards

Harry King

unread,
May 19, 2015, 2:45:53 PM5/19/15
to jaamsi...@googlegroups.com
Jean-Christophe,

Most simulation package include an "experimenter" feature that can make multiple runs and even search for an optimal value for an input. We have always felt that this capability should be provided by a separate program that launches JaamSim runs and collects results. For our commercial projects, we use an Excel spreadsheet with macros to perform this function. Unfortunately, it's not possible to make this spreadsheet general enough or stable enough to distribute it with JaamSim.

Until we come up with a better solution, you can launch multiple runs with different seeds by creating a batch file that launches each run. The user manual describes how to do this on page 84.

I'll add the need for a better solution to our feature request list.

Harry

slash...@gmail.com

unread,
May 19, 2015, 10:07:17 PM5/19/15
to jaamsi...@googlegroups.com
What do you think about the idea of making available for download a zipped folder of standard scripts to launch experiments in different languages. In my own use cases I might want to do that in Python, R, C#, Java, or by writing a batch file or bash script. I think if you provided a ready-made template in key languages you'd cover the vast majority of use cases. Perhaps this is something that we users should share. That being said, a default method for those who are not strong programmers would probably go a long way to help students and others new to DES.

Harry King

unread,
May 20, 2015, 1:44:19 PM5/20/15
to jaamsi...@googlegroups.com, slash...@gmail.com
Launching multiple runs is the easy part -- the batch file method described in the manual is one way to do it. I'd like something more powerful. For example, our Excel spreadsheet can generate thousands of runs with just a few inputs to specify the inputs to change and the range of values to test. It also pulls the results back into the spreadsheet automatically and summarises the outputs of interest into tables. I'll like to do something similar in Python or Java, but am still struggling to design the inputs to the program and how it would work with Excel.

It would be great if you could contribute any code that would help JaamSim users in the meantime.

Harry
Reply all
Reply to author
Forward
0 new messages