SSJ
V. 1.1.9.

umontreal.iro.lecuyer.rng
Interface RandomStreamFactory

All Known Implementing Classes:
BasicRandomStreamFactory

public interface RandomStreamFactory

Represents a random stream factory capable of constructing some types of random streams. A complex simulation program may need to construct several random streams. If the class of random stream needs to be changed in the future, it may be necessary to modify several parts of the program. A random stream factory allows the stream-specific code for constructing a random stream to appear once in the program rather than several times. A factory is constructed from any class implementing this interface, and the newInstance method is used each time a new random stream is needed.

For example, to construct MRG32k3a streams, a BasicRandomStreamFactory can be constructed. Instead of using new MRG32k3a() to get a new stream, the user calls the newInstance method of the created factory. If the random stream happens to change, only the construction code of the BasicRandomStreamFactory needs to be updated.


Method Summary
 RandomStream newInstance()
          Constructs and returns a new random stream.
 

Method Detail

newInstance

RandomStream newInstance()
Constructs and returns a new random stream. If the instantiation of the random stream fails, this method throws a RandomStreamInstantiationException.

Returns:
the newly-constructed random stream.
Throws:
RandomStreamInstantiationException - if the new random stream cannot be instantiated.

SSJ
V. 1.1.9.

To submit a bug or ask questions, send an e-mail to Pierre L'Ecuyer.