manager.h

来自「四色算法的改进算法」· C头文件 代码 · 共 66 行

H
66
字号
//-------------------------------------------------------------------
//  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
 */

struct nodepos			/** 2D position structure */	
  {
     int x;		/**< x position	*/
     int y;		/**< y position	*/
  };

class manager : public cSimpleModule
{

	/** omnet++ specific code */
	Module_Class_Members(manager,cSimpleModule,16384);
	
	/** initialization function */
	void initialize();

	//handle the messages received
	void activity();
	
	void finish();

	//choose a new node to begin the topology request
	void choosehead();

	nodepos pos[NNODES];

	//the number of run
	int numofrun;

	//output the topo
	void topo();

};

Define_Module( manager );


#endif



⌨️ 快捷键说明

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