bsagent.h
来自「无线传感器网络中,LEACH路由协议在NS-2仿真环境的下实现的源代码」· C头文件 代码 · 共 61 行
H
61 行
/************************************************************************* * * This code was developed as part of the MIT uAMPS project. (June, 2000) * *************************************************************************/#ifdef MIT_uAMPS#ifndef ns_bsagent_h#define ns_bsagent_h#include "math.h"#include "object.h"#include "agent.h"#include "app.h"#include "trace.h"#include "packet.h"#include "mac.h"#include "random.h"class BSAgent : public Agent {public: BSAgent(); ~BSAgent(); void sendmsg(int data_size, const char* meta_data, int destination, int sendto, double dist_to_dest, int code); void recv(Packet*, Handler*);// void log(const char *msg); void BSsetup(void); void itoa(int n, char s[]); double find_min_dist(double*, double*, int, double*, double*, int, int*, int*); int command(int argc, const char*const* argv); double nodesX_[1000]; // node X-coordinates double nodesY_[1000]; // node Y-coordinates double currentE_[1000]; // current node energies int p_; // desired number of clusters per round int iters_; // num of iters for the sim annealing algorithm int nn_; // total number of nodes in the network double max_epsilon_; // amount of perturbation of CH coeffs int recv_code_; // 0 == packet from ll, 1 == BS setup returnprotected: int packetMsg_; // message type int packetSize_; // message sizeprivate: NsObject *ll; // link layer object Mac *mac; // MAC layer object Trace *log_target; // log target};#endif#endif /* MIT_uAMPS */
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?