NetSim Source Code Help
Loading...
Searching...
No Matches
Mobility.h
Go to the documentation of this file.
1/************************************************************************************
2* Copyright (C) 2020 *
3* TETCOS, Bangalore. India *
4* *
5* Tetcos owns the intellectual property rights in the Product and its content. *
6* The copying, redistribution, reselling or publication of any or all of the *
7* Product or its content without express prior written consent of Tetcos is *
8* prohibited. Ownership and / or any other right relating to the software and all *
9* intellectual property rights therein shall remain at all times with Tetcos. *
10* *
11* Author: Shashi Kant Suman *
12* *
13* ---------------------------------------------------------------------------------*/
14#ifndef _NETSIM_MOBILITY_H_
15#define _NETSIM_MOBILITY_H_
16#ifdef __cplusplus
17extern "C" {
18#endif
19
20#define Mobility_MODEL_DEFAULT _strdup("NO_MOBILITY")
21#define Mobility_GROUP_ID_DEFAULT 1
22#define Mobility_FILE_NAME_DEFAULT _strdup("")
23#define Mobility_STEP_SIZE_DEFAULT 1
24#define Mobility_CALCULATION_INTERVAL_DEFAULT 1
25#define Mobility_MAX_SPEED_M_S_DEFAULT 3
26#define Mobility_MIN_SPEED_M_S_DEFAULT 1
27#define Mobility_STOP_PROBABILITY_DEFAULT 0.5
28#define Mobility_STOP_DURATION_S_DEFAULT 5
29
30
32
35 /** Structure to store the mobility variables */
36
37 typedef enum
38 {
43 /* Enumeration for mobility model*/
45 {
53 };
54
55 double dSimulationArea_X; //Store the simulation area_x
56 double dSimulationArea_Y;//Store the simulationar area_y
57
58 /* Store the mobility variable for each device*/
60 {
61 double dAvgSpeed; //Average speed of device
62 MOBILITY_MODEL nMobilityType; //Mobility model
63 void* pstruMobVar; /*Pointer pointing to addition mobility model variables
64 *That may be used by developer. This can be accessed by
65 *DEVICE[]->Mobility->MobilityVar
66 */
67 struct stru_NetSim_Coordinates* pstruCurrentPosition; //Current position for device
68 struct stru_NetSim_Coordinates* pstruNextPosition; //Next position of device
69 };
70
72 {
73 double dPauseTime; ///< To store the pause time.
74 double dVelocity; ///< To store the velocity.
75 unsigned long ulSeed1; ///< Used to generate random point.
76 unsigned long ulSeed2; ///< Used to generate random point
77 double dLastTime; ///< Represent the devices last move time.
78 NETSIM_ID nGroupId; ///< To store group id of device.
80 //Sumo
82 double step_size;
83 //Pedestrain
84 double Max_Speed;
85 double Min_Speed;
89 double angel;
90 };
91
93 double t,
94 double x,
95 double y,
96 double z);
98 int fn_NMo_RandomPoint(double* X, double* Y,double velocity,double interval,unsigned long *pulSeed1, unsigned long *pulSeed2);
101 int add_to_group(NETSIM_ID group_id, NETSIM_ID dev_id);
103
104 // Sumo Interface
105 double *corr(char* id);
106 void pipes_init();
107 void init_sumo();
108 void sumo_run();
109
110 //File based mobility
114
115 //Office
116 void fn_NetSim_MObility_configureOffice(void* xmlNetSimNode);
117
118#ifdef __cplusplus
119}
120#endif
121#endif
122
unsigned int NETSIM_ID
Definition: Animation.h:45
int FileBasedMobilityPointersFree()
double dSimulationArea_Y
Definition: Mobility.h:56
void mobility_pass_position_to_animation(NETSIM_ID devId, double time, NetSim_COORDINATES *coor)
Definition: Mobility.c:347
void init_sumo()
enum_MobilityModel
Definition: Mobility.h:45
@ MobilityModel_SUMO
Definition: Mobility.h:51
@ MobilityModel_FILEBASEDMOBILITY
Definition: Mobility.h:49
@ MobilityModel_GROUP
Definition: Mobility.h:50
@ MobilityModel_NOMOBILITY
Definition: Mobility.h:46
@ MobilityModel_RANDOMWALK
Definition: Mobility.h:48
@ MobilityModel_PEDESTRAIN
Definition: Mobility.h:52
@ MobilityModel_RANDOMWAYPOINT
Definition: Mobility.h:47
void pipes_init()
double * corr(char *id)
int fn_NetSim_Mobility_Group_init()
Definition: GroupMobility.c:64
int fn_NetSim_MoveGroup()
void sumo_run()
int fn_NMo_RandomPoint(double *X, double *Y, double velocity, double interval, unsigned long *pulSeed1, unsigned long *pulSeed2)
Definition: Mobility.c:547
double dSimulationArea_X
Definition: Mobility.h:55
void fn_NetSim_MObility_configureOffice(void *xmlNetSimNode)
Definition: Building.c:59
void process_filebased_mobility_event()
MOBILTY_SUBEVNET
Definition: Mobility.h:38
@ NODE_JOIN
Definition: Mobility.h:40
@ NODE_LEAVE
Definition: Mobility.h:41
@ MOVE_GROUP
Definition: Mobility.h:39
void add_mobility_animation(NETSIM_ID d, double t, double x, double y, double z)
Definition: Mobility.c:38
int add_to_group(NETSIM_ID group_id, NETSIM_ID dev_id)
Definition: GroupMobility.c:53
enum enum_MobilityModel MOBILITY_MODEL
Definition: Mobility.h:31
int FileBasedMobilityReadingFile()
#define PROTOCOL_MOBILITY
Definition: Stack.h:142
struct stru_NetSim_Coordinates * pstruNextPosition
Definition: Mobility.h:68
struct stru_NetSim_Coordinates * pstruCurrentPosition
Definition: Mobility.h:67
MOBILITY_MODEL nMobilityType
Definition: Mobility.h:62
double dPauseTime
To store the pause time.
Definition: Mobility.h:73
double dCalculationInterval
Definition: Mobility.h:79
double dLastTime
Represent the devices last move time.
Definition: Mobility.h:77
unsigned long ulSeed1
Used to generate random point.
Definition: Mobility.h:75
NETSIM_ID nGroupId
To store group id of device.
Definition: Mobility.h:78
unsigned long ulSeed2
Used to generate random point
Definition: Mobility.h:76
double dVelocity
To store the velocity.
Definition: Mobility.h:74