Hello everyone...
I am trying to set the noise seed in my model to randomize off the timer on every model run, using GET TIME VALUE(2,0,10). However, this results in the model terminating with an error at initiation (time 0.0). The error is thrown by any variable that incorporates a RANDOM function (actually they are all RANDOM UNIFORM). I would interpret that as the RANDOM function lacking a seed at initiation, but making the noise seed an ACTIVE INITIAL(GET TIME VALUE(2,0,10),0) doesn't seem to solve anything.
The RANDOM UNIFORM formulas all have a seed parameter of 0.
Are there any ideas as to what exactly is causing this, and how to circumvent the problem?
(Vensim Professional v6.0.0.1 on Win7)
cheers
florian
Randomized noise seed crashes model
-
- Super Administrator
- Posts: 4626
- Joined: Wed Mar 05, 2003 3:10 am
Re: Randomized noise seed crashes model
Can you post a model that crashes so we can take a look?
Advice to posters seeking help (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Units are important!
http://www.bbc.co.uk/news/magazine-27509559
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Units are important!
http://www.bbc.co.uk/news/magazine-27509559
Re: Randomized noise seed crashes model
I was probably not correct to say the model "crashes"; it terminates with an error message "ERROR: Floating point error computing - rYear - at time = 0.000000. ", where rYear is
integer( RANDOM UNIFORM( 1987, 2009.9, 0))
If I remove the random uniform function in rYear, the next variable containing that function crops up. If all random uniform functions are removed, or noise seed is set to a constant, the model executes as normal.
I'm sorry I'm not at liberty to share the actual where the issue is occurring... and I haven't managed to recreate the issue in a simpler model.
I was hoping this behaviour might be a known occurrence, but I might be out of luck here
integer( RANDOM UNIFORM( 1987, 2009.9, 0))
If I remove the random uniform function in rYear, the next variable containing that function crops up. If all random uniform functions are removed, or noise seed is set to a constant, the model executes as normal.
I'm sorry I'm not at liberty to share the actual where the issue is occurring... and I haven't managed to recreate the issue in a simpler model.
I was hoping this behaviour might be a known occurrence, but I might be out of luck here
-
- Super Administrator
- Posts: 4626
- Joined: Wed Mar 05, 2003 3:10 am
Re: Randomized noise seed crashes model
Without something that re-creates the error, there is not much we can do.
Saying that, it would be a good idea (and good practice) to simplify things. The way you have it at the moment, you cannot see what sample from the distribution is.
For example, change your code to
I suspect the floating point error is somewhere else and is being incorrectly reported as rYear. If you view the tabular output, is one of the levels growing exponentially?
Saying that, it would be a good idea (and good practice) to simplify things. The way you have it at the moment, you cannot see what sample from the distribution is.
For example, change your code to
Code: Select all
random sample = RANDOM UNIFORM( 1987, 2009.9, 0)
integer random number = integer( random sample )
Advice to posters seeking help (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Units are important!
http://www.bbc.co.uk/news/magazine-27509559
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Units are important!
http://www.bbc.co.uk/news/magazine-27509559
Re: Randomized noise seed crashes model
All levels are behaving as expected. As I said, this happens at time 0.000 (which is initial time), and setting noise seed to a constant removes the problem. Wouldn't it be reasonable to suppose that the connection to a function that actually uses noise seed (i.e. random uniform()) is genuine?
Re: Randomized noise seed crashes model
You should be using INITIAL(GET TIME VALUE(2,0,10)) to avoid reinitializing the random stream at every time step. I don't think that's the issue though.
If you delete everything from the model but the NOISE SEED and the RANDOM instances, does it still crash? If so, could you share that portion?
If you delete everything from the model but the NOISE SEED and the RANDOM instances, does it still crash? If so, could you share that portion?
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Re: Randomized noise seed crashes model
Working on it - it takes some doing to cut this down but keep it functional...
Re: Randomized noise seed crashes model
Definitely reasonable - just tough for us to replicate unfortunately. Trying on this end too.
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Re: Randomized noise seed crashes model
Does this model run for you?
What version/hardware/OS are you on? [Never mind, I see this in your original post.]
Tom
(This is a modified version of what's in the help system.)What version/hardware/OS are you on? [Never mind, I see this in your original post.]
Tom
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/