NoChurn Class Reference

No churn generating class (only bootstraps a networks). More...

#include <NoChurn.h>

Inheritance diagram for NoChurn:
ChurnGenerator

List of all members.

Public Member Functions

void handleMessage (cMessage *msg)
void initializeChurn ()
 ~NoChurn ()

Protected Member Functions

void updateDisplayString ()

Private Attributes

double initialMean
 mean of update interval during initalization phase
double initialDeviation
 deviation of update interval during initalization phase
bool initAddMoreTerminals
 true, if we're still adding more terminals in the init phase
cMessage * mobilityTimer
 message to schedule events

Detailed Description

No churn generating class (only bootstraps a networks).

Definition at line 36 of file NoChurn.h.


Constructor & Destructor Documentation

NoChurn::~NoChurn (  ) 

Definition at line 77 of file NoChurn.cc.

00077                   {
00078     // destroy self timer messages
00079     cancelAndDelete(mobilityTimer);
00080 }


Member Function Documentation

void NoChurn::handleMessage ( cMessage *  msg  )  [virtual]

Implements ChurnGenerator.

Definition at line 45 of file NoChurn.cc.

00046 {
00047     if (!msg->isSelfMessage()) {
00048         throw cRuntimeError("NoChurn::handleMessage(): "
00049                                 "Unknown message received!");
00050         delete msg;
00051         return;
00052     }
00053 
00054     if (msg == mobilityTimer) {
00055         if (terminalCount < targetOverlayTerminalNum) {
00056             TransportAddress* ta = underlayConfigurator->createNode(type);
00057             delete ta; // Address not needed in this churn model
00058         }
00059 
00060         if (terminalCount >= targetOverlayTerminalNum) {
00061             initAddMoreTerminals = false;
00062             underlayConfigurator->initFinished();
00063         } else {
00064             scheduleAt(simTime()
00065                        + truncnormal(initialMean, initialDeviation), msg);
00066         }
00067     }
00068 }

void NoChurn::initializeChurn (  )  [virtual]

Implements ChurnGenerator.

Definition at line 31 of file NoChurn.cc.

00032 {
00033     Enter_Method_Silent();
00034 
00035     initialMean = par("initPhaseCreationInterval");
00036     initialDeviation = initialMean / 3;
00037     targetOverlayTerminalNum = par("targetOverlayTerminalNum");
00038 
00039     initAddMoreTerminals = true;
00040 
00041     mobilityTimer = new cMessage("mobilityTimer");
00042     scheduleAt(simTime(), mobilityTimer);
00043 }

void NoChurn::updateDisplayString (  )  [protected, virtual]

Implements ChurnGenerator.

Definition at line 70 of file NoChurn.cc.

00071 {
00072     char buf[80];
00073     sprintf(buf, "No churn");
00074     getDisplayString().setTagArg("t", 0, buf);
00075 }


Member Data Documentation

true, if we're still adding more terminals in the init phase

Definition at line 49 of file NoChurn.h.

Referenced by handleMessage(), and initializeChurn().

double NoChurn::initialDeviation [private]

deviation of update interval during initalization phase

Definition at line 48 of file NoChurn.h.

Referenced by handleMessage(), and initializeChurn().

double NoChurn::initialMean [private]

mean of update interval during initalization phase

Definition at line 47 of file NoChurn.h.

Referenced by handleMessage(), and initializeChurn().

cMessage* NoChurn::mobilityTimer [private]

message to schedule events

Definition at line 50 of file NoChurn.h.

Referenced by handleMessage(), initializeChurn(), and ~NoChurn().


The documentation for this class was generated from the following files:
Generated on Wed May 26 16:21:18 2010 for OverSim by  doxygen 1.6.3