⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 manager.h

📁 WSN仿真一例假定节点0(node[0])周期性广播消息其它节点接收到消息并转发出去
💻 H
字号:
//-------------------------------------------------------------------//  file name: manager.h// //    - header file for the manager class//    - see the .cpp file for more details////-------------------------------------------------------------------#ifndef __MANAGER_H#define __MANAGER_H#include <omnetpp.h>#include "globaldef.h"/** manager simple module class. It is the central module that coordinates the message  * exchange between the sensor nodes. it is responsible for: *- storing position information for all the nodes *- managing the communication between the nodes *- creating and destroying the links between the nodes  * function of the mobility and the transmission range */class manager : public cSimpleModule{	/** omnet++ specific code */	Module_Class_Members(manager,cSimpleModule,16384);		/** initialization function */	void initialize();	/** main loop function */	void activity();	// template specific functions		/** Updates the signal strength. It performs the following functions:	 *- convert the old rwp into a new one and update it everywhere	 *- cancel any connect/disconnect messages of his node and delete all 	 * the connections the node has	 *- compute the new ones according to the new rwp	 */	void updateSignalStrength(cMessage *msg);		/** User defined function.	 *- computes the transmission range out of the signal strength	 */	int distance(int sstrength);	 		// failures & maps stuff	// variables	/** connection matrix */	bool cm[NNODES][NNODES];};Define_Module( manager );#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -