📄 protocol.cpp
字号:
#include "Protocol.h"
#include "Agent.h"
#include "Topology.h"
Protocol::~Protocol(void){
unsigned int i = 0;
for( ; i< mAgents.size(); i++)
if( mAgents[i] != NULL)
delete mAgents[i];
}
double Protocol::getAgentDelay( unsigned int ID1, unsigned int ID2){
float ret = -1;
if( ID1> mAgentNum ||ID2>mAgentNum){
printf("protocol:getAgentDelay id1 %d id2 %d\n", ID1, ID2);
return -1;
}
else
ret = mTopology->getDelay( mAgents[ID1]->getNode()->getID(), mAgents[ID2]->getNode()->getID());
if( ret < 0){
printf("protocol ::getAgentDelay: ret %f < 0 Id1 %d id2 %d\n", ret, ID1, ID2);
exit(-1);
}
return ret;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -