formula for calculate available bandwidth source code in vanet

34 views
Skip to first unread message

fekair mohammed

unread,
Nov 19, 2014, 4:58:46 AM11/19/14
to
i found this formula for calculate available bandwidth but i not understand how it is work . please any expert now how it work tell me

double DynVehApp::calculateStimulus(){

//remove old received messages
if(!recentMessageCount.empty()){
while((!recentMessageCount.empty()) && (recentMessageCount.front() < simTime().dbl() - pBandwidthLength)){
recentMessageCount.pop_front();
recentMessageSize.pop_front();
}
}
double totalBytesReceived = 0;

if(!recentMessageSize.empty()){
std::list<int>::iterator listIt;
for(listIt = recentMessageSize.begin(); listIt != recentMessageSize.end(); listIt++){
totalBytesReceived += (*listIt);
}
}

return  std::max((( (double)1 - ( ((double)totalBytesReceived) / (double)pStimulusConstant) ) ),0.0d);
}



 where in omnetpp.ini 

*.node[*].appl.pStimulusConstant = 1000


fekair mohammed

unread,
Jan 26, 2015, 6:02:32 AM1/26/15
to omn...@googlegroups.com
any help please 
Reply all
Reply to author
Forward
0 new messages