OverSim
ChurnGenerator Class Reference

Base class for different churn models. More...

#include <ChurnGenerator.h>

Inheritance diagram for ChurnGenerator:
LifetimeChurn NoChurn ParetoChurn RandomChurn TraceChurn

Public Member Functions

virtual int numInitStages () const
virtual void initialize (int stage)
virtual void initializeChurn ()=0
virtual void handleMessage (cMessage *msg)=0
void setNodeType (const NodeType &t)
const NodeTypegetNodeType ()

Public Attributes

bool init
 still in initialization phase?
int terminalCount
 current number of overlay terminals

Protected Member Functions

virtual void updateDisplayString ()=0

Protected Attributes

UnderlayConfiguratorunderlayConfigurator
int targetOverlayTerminalNum
 final number of overlay terminals
NodeType type
 the nodeType this generator is responsible for

Detailed Description

Base class for different churn models.

Definition at line 57 of file ChurnGenerator.h.

Member Function Documentation

const NodeType& ChurnGenerator::getNodeType ( )
inline

Definition at line 65 of file ChurnGenerator.h.

{ return type; }
virtual void ChurnGenerator::handleMessage ( cMessage *  msg)
pure virtual
void ChurnGenerator::initialize ( int  stage)
virtual

Definition at line 27 of file ChurnGenerator.cc.

{
// because of IPAddressResolver, we need to wait until interfaces are registered,
// address auto-assignment takes place etc.
if (stage != MAX_STAGE_UNDERLAY)
return;
if (type.typeID == -1) {
opp_error("NodeType not set when initializing ChurnGenerator");
}
// get desired # of terminals
targetOverlayTerminalNum = par("targetOverlayTerminalNum");
type.channelTypesTx = cStringTokenizer(par("channelTypes"), " ").asVector();
type.channelTypesRx = cStringTokenizer(par("channelTypesRx"), " ").asVector();
if (type.channelTypesRx.size() != type.channelTypesTx.size()) {
}
init = true;
WATCH(terminalCount);
}
virtual void ChurnGenerator::initializeChurn ( )
pure virtual

Implemented in ParetoChurn, LifetimeChurn, NoChurn, TraceChurn, and RandomChurn.

Referenced by initialize().

virtual int ChurnGenerator::numInitStages ( ) const
inlinevirtual

Definition at line 60 of file ChurnGenerator.h.

{ return MAX_STAGE_UNDERLAY + 1; }
void ChurnGenerator::setNodeType ( const NodeType t)
inline

Definition at line 64 of file ChurnGenerator.h.

Referenced by UnderlayConfigurator::initialize().

{ type = t; }
virtual void ChurnGenerator::updateDisplayString ( )
protectedpure virtual

Implemented in ParetoChurn, TraceChurn, LifetimeChurn, NoChurn, and RandomChurn.

Referenced by initialize().

Member Data Documentation

bool ChurnGenerator::init

still in initialization phase?

Definition at line 66 of file ChurnGenerator.h.

Referenced by initialize().

int ChurnGenerator::targetOverlayTerminalNum
protected
int ChurnGenerator::terminalCount

current number of overlay terminals

Definition at line 67 of file ChurnGenerator.h.

Referenced by RandomChurn::handleMessage(), NoChurn::handleMessage(), and initialize().

NodeType ChurnGenerator::type
protected

the nodeType this generator is responsible for

Definition at line 73 of file ChurnGenerator.h.

Referenced by LifetimeChurn::createNode(), ParetoChurn::createNode(), getNodeType(), RandomChurn::handleMessage(), NoChurn::handleMessage(), initialize(), and setNodeType().


The documentation for this class was generated from the following files: