src/core/examples/sample-random-variable.cc
changeset 7169 358f71a624d8
parent 7025 32212c736ab4
child 9063 32755d0516f4
equal deleted inserted replaced
7168:7c724be8f9a6 7169:358f71a624d8
    29  * to generate random numbers.  By default, the uniform random variate that
    29  * to generate random numbers.  By default, the uniform random variate that
    30  * will be outputted is 0.816532.  Because ns-3 uses a fixed seed for the
    30  * will be outputted is 0.816532.  Because ns-3 uses a fixed seed for the
    31  * pseudo-random number generator, this program should always output the
    31  * pseudo-random number generator, this program should always output the
    32  * same number.  Likewise, ns-3 simulations using random variables will
    32  * same number.  Likewise, ns-3 simulations using random variables will
    33  * behave deterministically unless the user changes the RunNumber or the
    33  * behave deterministically unless the user changes the RunNumber or the
    34  * Seed.  
    34  * Seed.
    35  * 
    35  * 
    36  * There are three primary mechanisms to change the seed or run numbers
    36  * There are three primary mechanisms to change the seed or run numbers
    37  * from their default integer value of 1
    37  * from their default integer value of 1
    38  * 1) Through explicit call of SeedManager::SetSeed () and 
    38  * 1) Through explicit call of SeedManager::SetSeed () and 
    39  *    SeedManager::SetRun () (commented out below) 
    39  *    SeedManager::SetRun () (commented out below) 
    57   // SeedManager::SetRun (3);
    57   // SeedManager::SetRun (3);
    58 
    58 
    59   UniformVariable uv;
    59   UniformVariable uv;
    60 
    60 
    61   cout << uv.GetValue () << endl;
    61   cout << uv.GetValue () << endl;
    62   
    62 
    63 }
    63 }