* update the Openair mobility generator, add steadystatefor RWP, trace-driven mobility, two grid-based mobility models (restricted RWP, and connected domains)

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@5576 818b1a75-f10b-46b9-bf7c-635c3b92a50f
This commit is contained in:
Navid Nikaein
2014-07-22 11:25:09 +00:00
parent a1f4f1e5ff
commit 1ca500d264
37 changed files with 5053 additions and 3149 deletions
+8 -63
View File
@@ -41,62 +41,16 @@
#ifndef MOBILITY_PARSER_H_
#define MOBILITY_PARSER_H_
#include "omg_hashtable.h"
/**
* @struct Simple struct to hold only few information
* @brief The entry in each node is a line from the external mobility file
*/
typedef struct Exnode {
double time;
int vid;
double x;
double y;
double speed;
int visit;
struct Exnode* next;
}Exnode;
/**
* @struct struct acts as gateway to hashtable
* @brief holds vehicle id and initial pointer to the head of the linked list in hastable
*/
typedef struct node_info {
int vid;
int *vid_addr;
struct node_info* next;
//struct node_info* prev;
}node_info;
// head pointer to a linked list containing vid,vid_addr
#include "trace_hashtable.h"
/**
* function just to initialize the head of the linked list to NULL, this can be removed later(check).
*/
struct Exnode* gen_list();
/**
* Function to append the line content to build a linked list.
* @param headRef is the pointer to the head of the existing list to which append has to be done
* @param newNode , item to be appended
*/
void AppendNode(struct Exnode* headRef, struct Exnode* newNode);
/**
* function just prints the linked list (need to be removed, used for testing)
* @param pointer to the head of the linked list
*/
void print_list(struct Exnode* head);
/**
/*
* function reads each line and checks if vehicle has an entry in the hastable,
* if so append append is called else a new linked list to the vehicle is created.
* @param need mobility file to be given
*/
void read_mobility_file(); // mobility file need to be given here, add in omg_param_list, get it from there
void parse_data (char *trace_file, int node_type); // mobility file need to be given here, add in omg_param_list, get it from there
/**
* function builds a linked list which holds vehicle id and its mapping pointer to
@@ -105,23 +59,16 @@ void read_mobility_file(); // mobility file need to be given here, add in omg_pa
* @param vid is the vehicle id
* @param pointer to the head of the linked list to the vehicle entry in the hash table
*/
node_info* build_node_info(node_info* headRef, int vid, int *vid_addr);
void add_node_info (int nid,int n_gid, int node_type);
int find_node_info (int vid, int node_type);
/**
* just counts the number of nodes in the mobility file
*/
int get_num_nodes();
int get_number_of_nodes (int node_type);
/**
* these function are used since there might be a possibility if user provides a mobility
* discription which is out of order.
* @param hashtable
* @param starting pointer for the vehicles linked list
* @param ending pointer of the vehicles linked list
*/
void sort_veh_movement(omg_hash_table_t *table);
void quicksortlist(Exnode *pLeft, Exnode *pRight);
/**
* function returns the node containing next position (just reads the linked list from the hashtable)
@@ -129,10 +76,8 @@ void quicksortlist(Exnode *pLeft, Exnode *pRight);
* @param hashtable from which the node is to be looked
* @param node_id is the nodes whose next location need to be retrieved from the linked list
*/
Exnode* get_next_position(omg_hash_table_t *table,int node_id);
node_data* get_next_data (hash_table_t* table, int vid, int flag);
void reset_visit_status(omg_hash_table_t *table, float time, int node_id);
void clear_llist();
#endif /* MOBILITY_PARSER_H_ */