LoggingDataStructNode Class Reference

#include <logging-data-struct.h>

Collaboration diagram for LoggingDataStructNode:

Collaboration graph
[legend]

Detailed Description

Definition at line 46 of file logging-data-struct.h.

Public Member Functions

void log (Packet *pkt)
 LoggingDataStructNode (int id, LoggingDataStructNode *next)
void pushbackSent (double limit, double expectedStatusRate)
void registerStatus (double arrRate)
void sentRefresh (double limit)
 ~LoggingDataStructNode ()

Data Fields

int countLessReportedRate_
int gotStatus_
double limit_
LoggingDataStructNodenext_
int nid_
int pushbackSent_
RateEstimatorrateEstimator_
int sentRefresh_
double statusArrivalRate_


Constructor & Destructor Documentation

LoggingDataStructNode::LoggingDataStructNode int  id,
LoggingDataStructNode next
 

Definition at line 178 of file logging-data-struct.cc.

References countLessReportedRate_, gotStatus_, limit_, next_, nid_, pushbackSent_, rateEstimator_, sentRefresh_, and statusArrivalRate_.

00178                                                                                  {
00179   
00180   //printf("LGDSN: Setting up node for %d\n", id);
00181   nid_ = id;
00182   rateEstimator_ = new RateEstimator();
00183 
00184   pushbackSent_ = 0;
00185   limit_ = -1;
00186   gotStatus_ = 0; 
00187   statusArrivalRate_ = -1;
00188   countLessReportedRate_=0;
00189   sentRefresh_=0;
00190   next_ = next;
00191 }

LoggingDataStructNode::~LoggingDataStructNode  ) 
 

Definition at line 242 of file logging-data-struct.cc.

References rateEstimator_.

00242                                               {
00243   delete(rateEstimator_);
00244 }


Member Function Documentation

void LoggingDataStructNode::log Packet pkt  ) 
 

Definition at line 234 of file logging-data-struct.cc.

References RateEstimator::bytesArr_, RateEstimator::estimateRate(), RateEstimator::estRate_, nid_, and rateEstimator_.

Referenced by LoggingDataStruct::log().

00234                                        {
00235   rateEstimator_->estimateRate(pkt);
00236 #ifdef DEBUG_LGDSN
00237   printf("LGDSN: for neighbor %d total = %g rate = %g \n", nid_, 
00238      rateEstimator_->bytesArr_/500.0, rateEstimator_->estRate_);
00239 #endif
00240 }

Here is the call graph for this function:

void LoggingDataStructNode::pushbackSent double  limit,
double  expectedStatusRate
 

Definition at line 194 of file logging-data-struct.cc.

References limit_, pushbackSent_, and statusArrivalRate_.

Referenced by PushbackAgent::pushbackCheck().

00194                                                                            {
00195   pushbackSent_ = 1;
00196   limit_ = limit;
00197   statusArrivalRate_ = expectedStatusRate;
00198 }

void LoggingDataStructNode::registerStatus double  arrRate  ) 
 

Definition at line 207 of file logging-data-struct.cc.

References countLessReportedRate_, gotStatus_, INFINITE_LIMIT, limit_, and statusArrivalRate_.

Referenced by LoggingDataStruct::registerStatus().

00207                                                     {
00208   gotStatus_ = 1;
00209   
00210   //not doing precise math for floating imprecision
00211   if (limit_ < INFINITE_LIMIT - 1 ) {
00212     statusArrivalRate_ = arrRate;
00213     countLessReportedRate_=0;
00214     return;
00215   }
00216 
00217   if (arrRate >= statusArrivalRate_) {
00218     statusArrivalRate_ = arrRate;
00219     countLessReportedRate_=0;
00220     return;
00221   } else {
00222     countLessReportedRate_++;
00223     if (countLessReportedRate_ > 1) {
00224       statusArrivalRate_=(arrRate+statusArrivalRate_)/2;
00225       return;
00226     }
00227     else {
00228       //keep the old rate
00229     }
00230   }
00231 }

void LoggingDataStructNode::sentRefresh double  limit  ) 
 

Definition at line 201 of file logging-data-struct.cc.

References limit_, and sentRefresh_.

Referenced by PushbackAgent::refreshUpstreamLimits().

00201                                                {
00202   sentRefresh_ = 1;
00203   limit_ = limit;
00204 }


Field Documentation

int LoggingDataStructNode::countLessReportedRate_
 

Definition at line 57 of file logging-data-struct.h.

Referenced by LoggingDataStructNode(), and registerStatus().

int LoggingDataStructNode::gotStatus_
 

Definition at line 55 of file logging-data-struct.h.

Referenced by LoggingDataStruct::consolidateStatus(), LoggingDataStructNode(), registerStatus(), and LoggingDataStruct::resetStatus().

double LoggingDataStructNode::limit_
 

Definition at line 52 of file logging-data-struct.h.

Referenced by LoggingDataStructNode(), pushbackSent(), registerStatus(), and sentRefresh().

LoggingDataStructNode* LoggingDataStructNode::next_
 

Definition at line 61 of file logging-data-struct.h.

Referenced by LoggingDataStruct::consolidateStatus(), LoggingDataStruct::getNodeByID(), LoggingDataStructNode(), RateLimitSession::merge(), PushbackAgent::pushbackCancel(), PushbackAgent::pushbackCheck(), PushbackAgent::refreshUpstreamLimits(), LoggingDataStruct::resetStatus(), and LoggingDataStruct::~LoggingDataStruct().

int LoggingDataStructNode::nid_
 

Definition at line 48 of file logging-data-struct.h.

Referenced by LoggingDataStruct::getNodeByID(), log(), LoggingDataStructNode(), RateLimitSession::merge(), PushbackAgent::pushbackCancel(), PushbackAgent::pushbackCheck(), and PushbackAgent::refreshUpstreamLimits().

int LoggingDataStructNode::pushbackSent_
 

Definition at line 51 of file logging-data-struct.h.

Referenced by LoggingDataStructNode(), PushbackAgent::pushbackCheck(), and pushbackSent().

RateEstimator* LoggingDataStructNode::rateEstimator_
 

Definition at line 49 of file logging-data-struct.h.

Referenced by log(), LoggingDataStructNode(), RateLimitSession::merge(), PushbackAgent::pushbackCheck(), and ~LoggingDataStructNode().

int LoggingDataStructNode::sentRefresh_
 

Definition at line 59 of file logging-data-struct.h.

Referenced by LoggingDataStructNode(), PushbackAgent::refreshUpstreamLimits(), and sentRefresh().

double LoggingDataStructNode::statusArrivalRate_
 

Definition at line 56 of file logging-data-struct.h.

Referenced by LoggingDataStruct::consolidateStatus(), LoggingDataStructNode(), RateLimitSession::merge(), pushbackSent(), PushbackAgent::refreshUpstreamLimits(), and registerStatus().


The documentation for this class was generated from the following files:
Generated on Tue Mar 6 17:12:50 2007 for ns2 Network Simulator 2.29 by  doxygen 1.4.6