ihmcrobotics / euclid

Vector math, geometry, reference frame, and shapes 2D & 3D

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Random Test values are not Random

PicassoCT opened this issue · comments

Statically initialized seeds lead to same values in every sequence. E.g:
Quaternion Based TransformTest

Random random = new Random(45L);
QuaternionBasedTransform transform = EuclidCoreRandomTools.nextQuaternionBasedTransform(random);
will always result in:

x = -0.5599634331913013
y = 0.5960433401296669
z = 0.41656366724225924
s = 0.3970491169985922

Recommended solution is initializing with a source of random: System.nanoTime()

Hi!
That's actually done on purpose, that allows to reproduce a failing test locally.