Data Structures and Algorithms
with Object-Oriented Design Patterns in C# |
Program defines the SimpleRV class. The SimpleRV class implements the RandomVariable interface defined in Program . This class generates random numbers uniformly distributed in the interval (0,1).
The implementation of the SimpleRV class is trivial because the RandomNumberGenerator class generates the desired distribution of random numbers. Consequently, the Next accessor simply calls RandomNumberGenerator.Next.