Skip to main content

Exercise 1: Play with the self message

Try to change the scheduled time for the message first to 20, then to 10000. Re-run the simulation for each - do you see any difference?

To more clearly see that something changes, add the following code to handleMessage() - it doesn't matter where exactly for now.

EV << "Changing to red color at time " << simTime() << "\n";

The kernel function simTime() returns the current simulation time. The macro EV is used to write something to the debugging output of the simulation, usually in the bottom right corner of the simulation. Very useful!