Difference between revisions of "Random state"
Line 1: | Line 1: | ||
− | In the <SUMO> tag there are the following two options: | + | In the [[Config:SUMO| <SUMO>]] tag there are the following two options: |
<pre><nowiki> | <pre><nowiki> |
Revision as of 09:38, 6 June 2008
In the <SUMO> tag there are the following two options:
<Option key="seedRandomState" value="default"/> <Option key="randomStatefile" value=""/>
It determines how the random number generators are seeded. The possible values are:
- default: do nothing, the same seed will be used each time matlab is started
- random: the initial state is initialized randomly
- file: load the state from the file given in the randomStateFile option
If the setting is 'default', the results will be the same each time you start Matlab and run for the first time. So with an example:
- start matlab
- run 'go'
- exit matlab
- start matlab
- run 'go'
- exit matlab
In both cases the results will be the same as long as you don't change the configuration settings in between of course.
So note that the results are NOT the same in this case:
- start matlab
- run 'go'
- run 'go'
- exit matlab
Here you will get 2 different results!
If you also want the same results in this setting you must load the random state from disk.
IMPORTANT: Since the toolbox employs threading (modeling and sampling occur in parallel as two separate threads) it is impossible to guarantee 100% determinism. Due to changes in system load, OS scheduling decisions, etc. it is possible that two runs do not give exactly the same results even if the initial random state is the same. There is nothing we can do about this, the only solution would be to do everything sequentially but that would be far too inefficient.