[ODE] Non-deterministic behavior

Adam D. Moss aspirin at ntlworld.com
Sat Aug 30 01:21:01 2003


nlin@nlin.net wrote:
> On Sun, Aug 24, 2003 at 10:16:30AM -0400, Josh Welber wrote:
> 
>>Does anyone have experience with ODE giving non-deterministic 
>>results?
> 
> As a comment I'd like to point out that test_crash.exe (the stepfast demo)
> gives non-deterministic behavior. You can press "r" to reset the simulation,
> yet if you press "r" several times, the car(s) crash into the wall in different
> ways each time. I don't know if this is due to stepfast or ODE or a flaw
> in test_crash.cpp, but it's worth investigating.

test_crash's 'reset' function doesn't actually totally reset the
simulation.  This is supposedly on purpose, so the car can build
up a lot of accelleration over multiple runs, 'for fun'.

Note also that if you have RANDOM_JOINT_ORDER (the default) defined
in stepfast.cpp then the rand() function will be used to randomize
the order with which joint constraints are solved.  rand()
is deterministic but shares state with the app, so anyone
who uses stepfast for simulation but non-deterministically
seeds or uses rand() for something else in the application is
guaranteed to get non-deterministic behaviour in the simulation.

--Adam
-- 
Adam D. Moss   . ,,^^   adam@gimp.org   http://www.foxbox.org/   co:3
"I am NOT a nut!  I am the keeper of the seven universal truths!"