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

📄 randomdirection.h

📁 OMNET++仿真三色算法的源码,三色算法是无线传感器中一个典型的分簇算法
💻 H
字号:
//#ifndef MOBILITY_H#define MOBILITY_H#include "omnetpp.h"#include "costants.h"#include "physic.h"class RandomDirection : public cSimpleModule{	//Macro that contains the costructor,destructor	//and other Omnett++ stuff	Module_Class_Members(RandomDirection,cSimpleModule,0)	virtual void initialize();	virtual void handleMessage(cMessage* );	virtual void finish();	//	   private:	//check if a bound has benn reached	bool checkBounds(int,int);	//returns the time intervall	//to the next move	double randomDirection(int&, int&);	//quoantum of time between to moves	//e.g. 1s if the speed is in m/sec	cPar* moveInterval;	cPar* pauseTime;	cPar* moveKind;	cPar* maxSpeed;	cPar* minSpeed;	//pointer of the physic module wich	//store the actual <x,y> position	Physic*  physic;	//size of the movement field	int minX,maxX,minY,maxY;	//direction flag	int dX, dY;	//statistics vars	int stepsNum;	double partial;};	#endif	

⌨️ 快捷键说明

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