Closed rcabanasdepaz closed 3 years ago
The methods ArraysUtil::shuffle do not use the global Random object and hence the it cannot be replicated. An so it happens with the derived methods.
Random
The following code does not always produces the same result, though it should.
RandomUtil.setRandomSeed(10); VertexFactor vfi = VertexFactorUtilities.random(Strides.as(0,3), 3); System.out.println(vfi); BayesianFactor bf = BayesianFactorUtilities.random(Strides.as(0,3), Strides.empty()); System.out.println(bf); double[] v = RandomUtil.sampleNormalized(3); System.out.println(Arrays.toString(v)); double[] v2 = new double[]{0,1,2,3,4}; ArraysUtil.shuffle(v2); System.out.println(Arrays.toString(v2));
The methods ArraysUtil::shuffle do not use the global
Random
object and hence the it cannot be replicated. An so it happens with the derived methods.The following code does not always produces the same result, though it should.