create new tag
, view all tags

Towards More Sophisticated Models


Our second exercise aims to teach the fundamental methods required to create more sophisticated simulation models. Through this experiment we learn how to add state variables, debugging information, parametric simulation, modeling processing delays, dealing with random numbers and implementing timers.


The exercise is available on this Web page. Please complete the activities of the tutorial to answer the questions given in the following section.


  1. What does ev << "Hello\n"; do? If I write printf("Hello\n"); instead, does it do the same?
  2. What does WATCH} do?
  3. Refer to the OMNeT++ manual for information on cMessage object to find out how to define the name and the kind of a message?
  4. Modify the initialize() function to create two messages with different names and kinds (you decide the name and the kind). Send the two messages in sequence and print out their names and kinds (hint: you might want to use enum to do this).
  5. Modify the handleMessage() function to receive the two messages (see previous item) separately. When a message is received, print out its name and kind.
  6. How do we model processing delay? In the example given we choose to model processing time of 1 second. If I change this to 100000 seconds, how much longer the simulation would run?
  7. Go through the OMNeT++ manual to find out how many different types of random number distributions implemented in the framework. Write them.
Topic revision: r2 - 2013-08-05 - AhmetSekercioglu
This site is powered by the TWiki collaboration platformCopyright © 2008-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback