I am using uniform distribution to generate a random time to release a certain truck.
Always I start a simulation, it is released at the same.
releaseTime : time;
releaseTime := z_uniform(1, 6000, 12000); -- a time between 6000 seconds and 12000 seconds
Can anyone explain me how to generate different random numbers to every time I run the simulation?
Thanks in advance!
Solved! Go to Solution.
First of all..the console should not show the times in seconds. It shows it in the time format you chose in the preferences. Well you just had one event so the method is executed once so only one random no. is gererated.
If you still just want to run the method once and expect the no. to change please change the random no. stream in every run.
What triggers me is why you would use a script to do something like this. To generate moving units, we normally use the Source object.
The Eventcontroller has settings to change your random number seed (Eventcontroller -> Tools). If you tick 'increment variant on reset', then you'll get different results. There you can also change the seed to a value you want.
cards PLM Solutions