2 Exercise 2
Probability distributions
The goal of this exercise is to gain a deeper understanding of different probability distributions, their properties and application for simulations using OMNeT++.
Create a simple model consisting of a sender S and a receiver R. The sender creates
new messages with a random time interval T and sends it to the receiver. The receiver
records the inter-arrival time of the messages.
Figure 1: Sender-Receiver-Model
Choose at least two different probability distributions for the random variable T (check
the OMNeT++ manual for a list of distributions) and for each of them.
• Draw the Probability Density Function (PDF) and the Cumulative Distribution
Function (CDF) of the distribution.
• Record and visualize the histogram and vector data of the inter-arrival times of
the received messages when you stop the simulation after 100, 1000, and 10000
messages.
• What are the sample mean, sample variance and the standard deviation of the
simulation results?
• Compare the results to the theoretical expectations.
3 Exercise 3
Random Number Generators
Based on Exercise 2, implement the random number generators to generate the random
Inter-arrival time T.
4
1. Implement the Linear Congruential random number Generator (LCG) in OMNeT++ based on the method:
di = 16807di−1 mod (231 − 1)
2. Generate the uniformly distributed Inter-arrival time T (e.g. uniform (0,2)) based
on the LCG RNG.
3. Generate the exponentially distributed T (e.g. with exponential(1)).
4. Compare the new simulation results with the ones using the OMNeT++ default
RNG (Mersenne Twister).
5. Which characteristics should “good” random number generators have? Do you
think the LCG RNG is a “good” RNG and why?
6. In a simulation program for a cellular mobile radio system it is required to initially
distribute N mobile stations uniformly in the area of a circle with radius R. For
each mobile station the angle φi and radius ri has to be generated. Describe the
algorithm.
Hints
a. For generating the exponential distribution, please refer to exercise 4 and 5 in the
optional tasks part (inverse CDF method to generate other distributions based on
uniform distribution).
b. Optional tasks are not required to finish. But they are quite useful for you to
get further understanding of random number generators. You can only get the
solutions for the optional tasks if you have done them.
接包方 | 国家/地区 | |
---|---|---|
![]() |
10
Bestpartner
|
成都市 |
![]() |
4
Tianyaxiao
|
北京市 |
![]() |
4
York_li
|
上海市 |