Simulation differs between GUI and non-GUI version

Hi,
i started a script which simulates some cubes locomoting for some seconds. I ran the python script in the IDE (GUI) version and in the command line version. I measured at the end the position of the root cube. Unfortunately the results differ, i.e. the cubes move to a different position in the GUI version than it moved in the command line version.
Has anyone faced the same problems and could give me a hint how to deal with it?

How different?

Just how much of a difference are you seeing? Do you see identical results in repeated runs of the GUI version? And does the sim use physical simulation?

The physical simulation system used by breve does make use of a random number generator, and this randomness can cause simulations to run with tiny differences. However, I don't see why it would be any more different with GUI vs. command-line than just running the GUI twice in a row.

- jon

Hi Jon, thanks for the

Hi Jon,
thanks for the reply.
Yes, physics engine is enabled.
If I run the same code with the GUI several times, I get the same results.
If I run the same code with the command line option, I also get the same results.
Just between both versions is a difference. I could reduce the difference by applying an initial torque on the joints (I guess this reduces the random number effect).

A little bit strange is that in the first 1.5 seconds the simulation results are quite equal (say for an x-location 0.768975 (GUI) to 0.777929(CLI) ) but then suddenly it diverges to more visual differences (1.83 to 1.62).

I currently use an own visualization to see the CLI results.
best regards

I've suspected/worried about

I've suspected/worried about something like this for a while too, though I'm actually wondering if there is a difference between CLI with the display off and CLI with the display on. I run my simulations with the display off and save the output. Then I load it up with the display on to watch it. I also have plots of how my creatures are progressing, but sometimes the behavior I get doesn't match the performance indicated by the plots.

I wonder if there are any significant sources of non-determinism in breve. I haven't looked at the source myself, but I would assume there's some threading in there. Could time spent displaying graphics take enough time away from logic threads that they might not be able to respond as quickly as they should? Just speculation...

In any case, the next step for me, and probably for BreveSim as well, should be to try repeating experiments by setting the random number seed. That way, at least you can't blame the random number generator for differences in results

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.