Class EnhancedStreamableGenerator

All Implemented Interfaces:
RandomGenerator, RandomGenerator.StreamableGenerator
Direct Known Subclasses:
EnhancedJumpableGenerator, EnhancedSplittableGenerator

public class EnhancedStreamableGenerator extends EnhancedRandomGenerator implements RandomGenerator.StreamableGenerator

An EnhancedStreamableGenerator is used to wrap an object of any class that implements RandomGenerator.StreamableGenerator for the purpose of adding all of the functionality of the RandomIndexer and RandomVariates. See the superclass EnhancedRandomGenerator for documentation of the enhanced functionality that is added to the wrapped object.

The methods of the RandomGenerator.StreamableGenerator interface, such as rngs(), that return streams of RandomGenerator are implemented to return streams of EnhancedRandomGenerator objects that wrap the RandomGenerator objects in the streams returned by the enclosed StreamableGenerator. However, additionally this class provides a counterpart, such as erngs(), for each of these whose return type is explicitly a stream of EnhancedRandomGenerator objects to simplify usage without the need to cast the objects of the stream in order to utilize the enhancements.

  • Constructor Details

    • EnhancedStreamableGenerator

      public EnhancedStreamableGenerator()
      Constructs the EnhancedStreamableGenerator to wrap an instance of a default StreamableGenerator. The library's current default is to wrap an instance of SplittableRandom, chosen due to Java's designation of that class as a legacy random number generator, and likely longterm existence. However, the rho-mu library makes no guarantee that this choice will remain the default.
    • EnhancedStreamableGenerator

      public EnhancedStreamableGenerator(long seed)
      Constructs the EnhancedStreamableGenerator to wrap an instance of a random number generator initialized with a specified seed to enable replicating the same sequence of random numbers during subsequent runs.
      seed - The seed for the random number generator.
    • EnhancedStreamableGenerator

      public EnhancedStreamableGenerator(RandomGenerator.StreamableGenerator generator)
      Constructs an EnhancedStreamableGenerator to wrap and enhance a given RandomGenerator.StreamableGenerator.
      generator - the RandomGenerator.StreamableGenerator to wrap and enhance.
    • EnhancedStreamableGenerator

      public EnhancedStreamableGenerator(String algorithmName)
      Constructs the EnhancedStreamableGenerator to wrap an instance of any random number generator supported by your version of Java as specified by its name, as documented via the RandomGenerator.StreamableGenerator.of(java.lang.String) method.
      algorithmName - The name of the random number generator as documented by the RandomGenerator.StreamableGenerator.of(java.lang.String) method.
      NullPointerException - if algorithmName is null.
      IllegalArgumentException - if algorithmName is not found.
  • Method Details