adevs
Public Member Functions | List of all members
adevs::crand Class Reference

#include <adevs_rand.h>

Inheritance diagram for adevs::crand:
adevs::random_seq

Public Member Functions

 crand ()
 Create a generator with the default seed.
 
 crand (const crand &src)
 Copy constructor.
 
 crand (unsigned long seed)
 Create a generator with the given seed.
 
void set_seed (unsigned long seed)
 Set the seed for the random number generator.
 
double next_dbl ()
 Get the next double uniformly distributed in [0, 1].
 
unsigned long next_long ()
 Get the next unsigned long.
 
random_seqcopy () const
 Copy the random number generator.
 
 ~crand ()
 Destructor.
 
- Public Member Functions inherited from adevs::random_seq
virtual ~random_seq ()
 Destructor.
 

Detailed Description

The crand class provides random number sequences using the standard C rand_r() function. Each instance of crand generates its own random number sequence, and the clone method saves the state of the random number generator. This class can be used in parallel simulations.


The documentation for this class was generated from the following file: