1 / 8

Chapter 4 Random Number Generator

Chapter 4 Random Number Generator. Speaker : H.M. Liang. Background. Why random number is necessary? Seed and distribution Random number generator is controlled by seed and distribution In NS-2, different table is generated if seed is set to 0. TCL. Create a random number generator

cleo-french
Télécharger la présentation

Chapter 4 Random Number Generator

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Chapter 4 Random Number Generator Speaker : H.M. Liang

  2. Background • Why random number is necessary? • Seed and distribution • Random number generator is controlled by seed and distribution • In NS-2, different table is generated if seed is set to 0

  3. TCL • Create a random number generator set rng [new RNG] • Set the random seed $rng seed 0 or n , n is an integer • seed 0 uses current time of day and counter The name of new generator

  4. TCL • Create an instance of a random variable object with specific distribution set rv [new Randomvariable/<type of random-variable>] • Associate a RandomVariable with non-default RNG $rv use-rng $rng • Generate a number $rv value

  5. TCL - type of random-variable • UniformRandomVariabletools/ranvar.h min_, max_ • ExponentialRandomVariabletools/ranvar.h avg_ • ParetoRandomVariabletools/ranvar.h avg_,shape_ • ParetoIIRandomVariabletools/ranvar.h avg_, shape_ • ConstantRandomVariabletools/ranvar.h val_ • HyperExponentialRandomVariabletools/ranvar.h avg_, cov_ • NormalRandomVariabletools/ranvar.h avg_, std_ • LogNormalRandomVariabletools/ranvar.h avg_, std_

  6. Distribution – Part I

  7. Distribution – Part II

  8. Example

More Related