56 char* tagname = (
char*)var[0];
57 void* xmlNetSimNode=var[2];
70 if(!strcmp(szVal,
"NO_MOBILITY"))
75 else if(!strcmp(szVal,
"RANDOM_WALK"))
79 else if(!strcmp(szVal,
"RANDOM_WAY_POINT"))
83 else if(!strcmp(szVal,
"FILE_BASED_MOBILITY"))
87 else if(!strcmp(szVal,
"GROUP_MOBILITY"))
94 else if (!
_stricmp(szVal,
"PEDESTRIAN_MOBILITY")) {
117 pstruMobilityVar->
dVelocity = atof(szVal);
126 fnNetSimError(
"Calculation_interval can't be 0. Leads infinite loop. Assigning 1 us");
139 pstruMobilityVar->
dLastTime = -1000000*atof(szVal);
168 pstruMobilityVar->
angel = 0;
177 else if(!
_stricmp(tagname,
"NODE_JOIN_PROFILE"))
181 else if (!
_stricmp(tagname,
"PROTOCOL"))
208 printf(
"Mobility---Version number mismatch\nDll Version=%d\nNetSim Version=%d\nFileName=%s\nLine=%d\n",
VERSION,
nVersion_Type/10,__FILE__,__LINE__);
214 temp = getenv(
"NETSIM_SIM_AREA_X");
225 temp = getenv(
"NETSIM_SIM_AREA_Y");
366 coor->
X, coor->
Y, coor->
Z);
391 double dPresentTime = pstruMobilityVar->
dLastTime;
411 memcpy(cor, ncor,
sizeof * cor);
414 if (probability < pstruMobilityVar->Stop_Probability) {
443 memcpy(pos, cor,
sizeof * pos);
468 memcpy(cor, ncor,
sizeof* cor);
485 memcpy(pos,cor,
sizeof* pos);
547int fn_NMo_RandomPoint(
double* X,
double* Y,
double velocity,
double interval,
unsigned long *pulSeed1,
unsigned long *pulSeed2)
555 min = (int)(*X - ldRandNo % ((
int)(velocity * interval /
SECOND) + 1));
559 max = (int)(*X + ldRandNo % ((
int)(velocity * interval /
SECOND) + 1));
572 min = (int)(*Y - ldRandNo % ((
int)(velocity * interval /
SECOND) + 1));
576 max = (int)(*Y + ldRandNo % ((
int)(velocity * interval /
SECOND) + 1));
void animation_add_new_entry(ANIM_HANDLE animHandle, ANIM_TYPE type, void *format,...)
ANIM_HANDLE anim_add_new_menu(ANIM_HANDLE handle, char *name, bool isThreadReq, bool isNewScreen, bool isFile, UINT maxDataLen, ANIMFILETYPE fileType)
void fn_NetSim_MObility_configureOffice(void *xmlNetSimNode)
int FileBasedMobilityPointersFree()
void process_filebased_mobility_event()
int FileBasedMobilityReadingFile()
int fn_NetSim_Mobility_Group_init()
int fn_NetSim_MoveGroup()
int add_to_group(NETSIM_ID group_id, NETSIM_ID dev_id)
#define _declspec(dllexport)
This function is used to trigger the update.
#define fnNetSimError(x,...)
int fn_NetSim_Mobility_Run()
int fnMobilityRegisterCallBackFunction(_fnMobilityCallBack fnCallBack)
_fnMobilityCallBack * fnMobilityCallBack
char * fn_NetSim_Mobility_Trace(NETSIM_ID id)
int fn_NetSim_Mobility_NodeLeaved()
void mobility_pass_position_to_animation(NETSIM_ID devId, double time, NetSim_COORDINATES *coor)
int fn_NetSim_Mobility_NodeJoined()
int fn_NetSim_Mobility_ConfigurePrimitives()
char * fn_NetSim_Mobility_ConfigPacketTrace()
int fn_NetSim_Mobility_Configure(void **var)
int fn_NetSim_Mobility_configure_NodeJoinProfile(void *xmlNode, NETSIM_ID nDeviceId)
int fn_NetSim_Mobility_FreePacket()
int fn_NetSim_Mobility_Finish()
static void init_mobility_animation()
int fn_NetSim_Mobility_CopyPacket()
int fn_NetSim_Mobility_Metrics()
int fn_NMo_RandomPoint(double *X, double *Y, double velocity, double interval, unsigned long *pulSeed1, unsigned long *pulSeed2)
int fn_NetSim_Mobility_NodeJoinInit(NETSIM_ID nDevIndex)
void add_mobility_animation(NETSIM_ID d, double t, double x, double y, double z)
char * fn_NetSim_Mobility_WritePacketTrace()
int fn_NetSim_Mobility_Init(struct stru_NetSim_Network *NETWORK_Formal, NetSim_EVENTDETAILS *pstruEventDetails_Formal, char *pszAppPath_Formal, char *pszWritePath_Formal, int nVersion_Type, void **fnPointer)
static unsigned int nCallBackCount
@ MobilityModel_FILEBASEDMOBILITY
@ MobilityModel_NOMOBILITY
@ MobilityModel_RANDOMWALK
@ MobilityModel_PEDESTRAIN
@ MobilityModel_RANDOMWAYPOINT
NetSim_EVENTDETAILS * pstruEventDetails_Formal
NetSim_EVENTDETAILS char * pszAppPath_Formal
NetSim_EVENTDETAILS char char int nVersion_Type
NetSim_EVENTDETAILS char char * pszWritePath_Formal
NetSim_EVENTDETAILS char char int void ** fnPointer
void fn_NetSim_Coordinate_ConvertCartesianToMap(NetSim_COORDINATES *pos)
EXPORTED char * pszIOPath
char * fn_NetSim_xmlConfig_GetVal(void *xmlNetSimNode, const char *szName, int flag)
#define getXmlVar(var, name, xmlNode, flag, type, protocol)
#define NETSIM_RAND_RN(max, min)
double fn_NetSim_Utilities_GenerateRandomNo(unsigned long *uSeed, unsigned long *uSeed1)
#define DEVICE_CONFIGID(DeviceId)
EXPORTED struct stru_NetSim_Network * NETWORK
EXPORTED char * pszAppPath
int(* _fnMobilityCallBack)(NETSIM_ID nDeviceId)
EXPORTED struct stru_NetSim_EventDetails * pstruEventDetails
int NetSimxmlError(const char *msg, char *val, const void *xmlNetSimNode)
#define PROTOCOL_MOBILITY
#define DEVICE_POSITION(DeviceId)
enum enum_LayerType LAYER_TYPE
#define fnpAddEvent(pstruEvent)
NETSIM_COORDINATETYPE corrType
netsimDEVICE_TYPE nDeviceType
unsigned long ulSeed[SEED_COUNT]
struct stru_NetSim_Coordinates * pstruDevicePosition
struct stru_NetSim_Mobility * pstruDeviceMobility
struct stru_NetSim_Packet * pPacket
netsimDEVICE_TYPE nDeviceType
struct stru_NetSim_Coordinates * pstruNextPosition
struct stru_NetSim_Coordinates * pstruCurrentPosition
MOBILITY_MODEL nMobilityType
double dPauseTime
To store the pause time.
double dCalculationInterval
double dLastTime
Represent the devices last move time.
unsigned long ulSeed1
Used to generate random point.
NETSIM_ID nGroupId
To store group id of device.
unsigned long ulSeed2
Used to generate random point
double dVelocity
To store the velocity.
struct stru_NetSim_Device ** ppstruDeviceList