Txc7 Class Reference
List of all members.
Detailed Description
In this step we'll introduce random numbers. We change the delay from 1s to a random value which can be set from the NED file or from omnetpp.ini. In addition, we'll "lose" (delete) the packet with a small probability.
Constructor & Destructor Documentation
00038 {
00039 event = tictocMsg = NULL;
00040 }
Txc7::~Txc7 |
( |
|
) |
[virtual] |
Member Function Documentation
void Txc7::handleMessage |
( |
cMessage * |
msg |
) |
[protected, virtual] |
Reimplemented from cSimpleModule.
00062 {
00063 if (msg==event)
00064 {
00065 EV << "Wait period is over, sending back message\n";
00066 send(tictocMsg, "out");
00067 tictocMsg = NULL;
00068 }
00069 else
00070 {
00071
00072 if (uniform(0,1) < 0.1)
00073 {
00074 EV << "\"Losing\" message\n";
00075 delete msg;
00076 }
00077 else
00078 {
00079
00080
00081
00082 simtime_t delay = par("delayTime");
00083
00084 EV << "Message arrived, starting to wait " << delay << " secs...\n";
00085 tictocMsg = msg;
00086 scheduleAt(simTime()+delay, event);
00087 }
00088 }
00089 }
void Txc7::initialize |
( |
|
) |
[protected, virtual] |
Member Data Documentation
The documentation for this class was generated from the following file: