public void testLocalInstances_distribution(){
  MatsimRandom.reset(123L);
  Random local1a=MatsimRandom.getLocalInstance();
  double value1=local1a.nextDouble();
  MatsimRandom.reset(234L);
  Random local2a=MatsimRandom.getLocalInstance();
  double value2a=local2a.nextDouble();
  Random local2b=MatsimRandom.getLocalInstance();
  double value2b=local2b.nextDouble();
  assertTrue(Math.abs(value1 - value2a) > EPSILON);
  assertTrue(Math.abs(value2a - value2b) > EPSILON);
  assertTrue(Math.abs(value1 - value2b) > EPSILON);
}

public void testLocalInstances_distribution ( ) { MatsimRandom . reset ( 123L ) ; Random local1a = MatsimRandom . getLocalInstance ( ) ; double value1 = local1a . nextDouble ( ) ; MatsimRandom . reset ( 234L ) ; Random local2a = MatsimRandom . getLocalInstance ( ) ; double value2a = local2a . nextDouble ( ) ; Random local2b = MatsimRandom . getLocalInstance ( ) ; double value2b = local2b . nextDouble ( ) ; assertTrue ( Math . abs ( value1 - value2a ) > EPSILON ) ; assertTrue ( Math . abs ( value2a - value2b ) > EPSILON ) ; assertTrue ( Math . abs ( value1 - value2b ) > EPSILON ) ; }
tests that multiple local instance return different random numbers , and that they are more or less evenly distributed .
