umontreal.iro.lecuyer.rng
Interface RandomStreamFactory
-
- All Known Implementing Classes:
- BasicRandomStreamFactory
public interface RandomStreamFactoryRepresents a random stream factory capable of constructing instances of a given type of random stream by invoking thenewInstancemethod each time a new random stream is needed, instead of invoking directly the specific constructor of the desired type. Hence, if several random streams of a given type (class) must be constructed at different places in a large simulation program, and if we decide to change the type of stream in the future, there is no need to change the code at those different places. With the random stream factory, the class-specific code for constructing these streams appears at a single place, where the factory is constructed.The class
BasicRandomStreamFactoryprovides an implementation of this interface.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description RandomStreamnewInstance()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 aRandomStreamInstantiationException.- Returns:
- the newly-constructed random stream.
- Throws:
RandomStreamInstantiationException- if the new random stream cannot be instantiated.
-
-
DMelt 3.0 © DataMelt by jWork.ORG