* breakdown MAC into multiple files based on the transport channel
* update oaisim event handler to manage configuration event on runtime git-svn-id: http://svn.eurecom.fr/openair4G/trunk@5577 818b1a75-f10b-46b9-bf7c-635c3b92a50f
This commit is contained in:
@@ -30,7 +30,7 @@
|
||||
<UE_MOBILITY>
|
||||
<UE_INITIAL_DISTRIBUTION>random</UE_INITIAL_DISTRIBUTION>
|
||||
<RANDOM_UE_DISTRIBUTION>
|
||||
<NUMBER_OF_NODES>1</NUMBER_OF_NODES>
|
||||
<NUMBER_OF_NODES>2</NUMBER_OF_NODES>
|
||||
</RANDOM_UE_DISTRIBUTION>
|
||||
<UE_MOBILITY_TYPE>RWP</UE_MOBILITY_TYPE>
|
||||
</UE_MOBILITY>
|
||||
@@ -38,7 +38,7 @@
|
||||
<eNB_MOBILITY>
|
||||
<eNB_INITIAL_DISTRIBUTION>random</eNB_INITIAL_DISTRIBUTION>
|
||||
<RANDOM_eNB_DISTRIBUTION>
|
||||
<NUMBER_OF_CELLS>1</NUMBER_OF_CELLS>
|
||||
<NUMBER_OF_CELLS>2</NUMBER_OF_CELLS>
|
||||
</RANDOM_eNB_DISTRIBUTION>
|
||||
<eNB_MOBILITY_TYPE>STATIC</eNB_MOBILITY_TYPE>
|
||||
</eNB_MOBILITY>
|
||||
|
||||
@@ -12,6 +12,9 @@
|
||||
<NUMBER_OF_NODES>1</NUMBER_OF_NODES>
|
||||
</RANDOM_UE_DISTRIBUTION>
|
||||
<UE_MOBILITY_TYPE>RWP</UE_MOBILITY_TYPE>
|
||||
<GRID_WALK>
|
||||
<GRID_MAP>RESTRICTED</GRID_MAP>
|
||||
</GRID_WALK>
|
||||
<UE_MOVING_DYNAMICS>
|
||||
<MIN_SPEED_mps>0.01</MIN_SPEED_mps>
|
||||
<MAX_SPEED_mps>10</MAX_SPEED_mps>
|
||||
@@ -30,7 +33,7 @@
|
||||
<eNB_MOBILITY_TYPE>STATIC</eNB_MOBILITY_TYPE>
|
||||
</eNB_MOBILITY>
|
||||
</MOBILITY>
|
||||
<OMV>1</OMV>
|
||||
<!--OMV>1</OMV-->
|
||||
</TOPOLOGY_CONFIG>
|
||||
|
||||
<EMULATION_CONFIG>
|
||||
|
||||
@@ -46,8 +46,8 @@
|
||||
<RANDOM_eNB_DISTRIBUTION>
|
||||
<NUMBER_OF_CELLS>1</NUMBER_OF_CELLS>
|
||||
</RANDOM_eNB_DISTRIBUTION>
|
||||
<eNB_MOBILITY_TYPE>STATIC</eNB_MOBILITY_TYPE>
|
||||
<!-- <TRACE_MOBILITY_FILE>static_1enb.tr</TRACE_MOBILITY_FILE> --> <!-- file should be located at $(OPENAIR2)/UTIL/OMG/TRACE/, see README there-->
|
||||
<eNB_MOBILITY_TYPE>STATIC</eNB_MOBILITY_TYPE>
|
||||
<!--<TRACE_MOBILITY_FILE>static_1enb.tr</TRACE_MOBILITY_FILE>--> <!-- file should be located at $(OPENAIR2)/UTIL/OMG/TRACE/, see README there-->
|
||||
</eNB_MOBILITY>
|
||||
</MOBILITY>
|
||||
</TOPOLOGY_CONFIG>
|
||||
|
||||
+2992
-272
File diff suppressed because it is too large
Load Diff
@@ -41,7 +41,9 @@
|
||||
|
||||
void add_event(Event_t event);
|
||||
|
||||
void schedule(Event_Type_t type, int frame, char * key, void* value);
|
||||
void schedule(Operation_Type_t op, Event_Type_t type, int frame, char * key, void* value, int ue, int lcid);
|
||||
|
||||
void schedule_delayed(Operation_Type_t op, Event_Type_t type, char * key, void* value, char * time, int ue, int lcid);
|
||||
|
||||
void schedule_events(void);
|
||||
|
||||
@@ -50,15 +52,18 @@ void execute_events(frame_t frame);
|
||||
|
||||
void update_oai_model(char * key, void * value);
|
||||
|
||||
void update_sys_model(char * key, void * value);
|
||||
void update_sys_model(Event_t event);
|
||||
|
||||
void update_topo_model(char * key, void * value);
|
||||
void update_topo_model(Event_t event);
|
||||
|
||||
void update_app_model(char * key, void * value);
|
||||
void update_app_model(Event_t event);
|
||||
|
||||
void update_emu_model(char * key, void * value);
|
||||
void update_emu_model(Event_t event);
|
||||
|
||||
void update_mac(Event_t event);
|
||||
|
||||
int validate_mac(Event_t event);
|
||||
|
||||
void update_mac(char * key, void * value);
|
||||
|
||||
/*
|
||||
void schedule_end_of_simulation(End_Of_Sim_Event_Type type, int value);
|
||||
|
||||
@@ -49,6 +49,7 @@
|
||||
|
||||
//#ifdef OPENAIR2
|
||||
#include "LAYER2/MAC/defs.h"
|
||||
#include "LAYER2/MAC/proto.h"
|
||||
#include "LAYER2/MAC/vars.h"
|
||||
#include "pdcp.h"
|
||||
#ifndef CELLULAR
|
||||
@@ -138,8 +139,8 @@ channel_desc_t *UE2eNB[NUMBER_OF_UE_MAX][NUMBER_OF_eNB_MAX];
|
||||
node_desc_t *enb_data[NUMBER_OF_eNB_MAX];
|
||||
node_desc_t *ue_data[NUMBER_OF_UE_MAX];
|
||||
// Added for PHY abstraction
|
||||
extern Node_list ue_node_list;
|
||||
extern Node_list enb_node_list;
|
||||
extern node_list* ue_node_list;
|
||||
extern node_list* enb_node_list;
|
||||
extern int pdcp_period, omg_period;
|
||||
|
||||
extern double **s_re, **s_im, **r_re, **r_im, **r_re0, **r_im0;
|
||||
@@ -313,14 +314,14 @@ static void set_cli_start(module_id_t module_idP, uint8_t start) {
|
||||
#endif
|
||||
|
||||
#ifdef OPENAIR2
|
||||
int omv_write(int pfd, Node_list enb_node_list, Node_list ue_node_list, Data_Flow_Unit omv_data) {
|
||||
int omv_write(int pfd, node_list* enb_node_list, node_list* ue_node_list, Data_Flow_Unit omv_data) {
|
||||
module_id_t i, j;
|
||||
omv_data.end = 0;
|
||||
//omv_data.total_num_nodes = NB_UE_INST + NB_eNB_INST;
|
||||
for (i = 0; i < NB_eNB_INST; i++) {
|
||||
if (enb_node_list != NULL) {
|
||||
omv_data.geo[i].x = (enb_node_list->node->X_pos < 0.0) ? 0.0 : enb_node_list->node->X_pos;
|
||||
omv_data.geo[i].y = (enb_node_list->node->Y_pos < 0.0) ? 0.0 : enb_node_list->node->Y_pos;
|
||||
omv_data.geo[i].x = (enb_node_list->node->x_pos < 0.0) ? 0.0 : enb_node_list->node->x_pos;
|
||||
omv_data.geo[i].y = (enb_node_list->node->y_pos < 0.0) ? 0.0 : enb_node_list->node->y_pos;
|
||||
omv_data.geo[i].z = 1.0;
|
||||
omv_data.geo[i].mobility_type = oai_emulation.info.omg_model_enb;
|
||||
omv_data.geo[i].node_type = 0; //eNB
|
||||
@@ -339,8 +340,8 @@ int omv_write(int pfd, Node_list enb_node_list, Node_list ue_node_list, Data_Flo
|
||||
}
|
||||
for (i = NB_eNB_INST; i < NB_UE_INST + NB_eNB_INST; i++) {
|
||||
if (ue_node_list != NULL) {
|
||||
omv_data.geo[i].x = (ue_node_list->node->X_pos < 0.0) ? 0.0 : ue_node_list->node->X_pos;
|
||||
omv_data.geo[i].y = (ue_node_list->node->Y_pos < 0.0) ? 0.0 : ue_node_list->node->Y_pos;
|
||||
omv_data.geo[i].x = (ue_node_list->node->x_pos < 0.0) ? 0.0 : ue_node_list->node->x_pos;
|
||||
omv_data.geo[i].y = (ue_node_list->node->y_pos < 0.0) ? 0.0 : ue_node_list->node->y_pos;
|
||||
omv_data.geo[i].z = 1.0;
|
||||
omv_data.geo[i].mobility_type = oai_emulation.info.omg_model_ue;
|
||||
omv_data.geo[i].node_type = 1; //UE
|
||||
@@ -645,11 +646,13 @@ void *l2l1_task(void *args_p) {
|
||||
}
|
||||
#endif
|
||||
#ifdef DEBUG_OMG
|
||||
/*
|
||||
if ((((int) oai_emulation.info.time_s) % 100) == 0) {
|
||||
for (UE_inst = oai_emulation.info.first_ue_local; UE_inst < (oai_emulation.info.first_ue_local + oai_emulation.info.nb_ue_local); UE_inst++) {
|
||||
get_node_position (UE, UE_inst);
|
||||
}
|
||||
}
|
||||
*/
|
||||
#endif
|
||||
|
||||
update_ocm ();
|
||||
@@ -1124,6 +1127,7 @@ int main(int argc, char **argv) {
|
||||
smbv_write_config_from_frame_parms(smbv_fname, &PHY_vars_eNB_g[0]->lte_frame_parms);
|
||||
#endif
|
||||
// add events to future event list: Currently not used
|
||||
//oai_emulation.info.oeh_enabled = 1;
|
||||
if (oai_emulation.info.oeh_enabled == 1)
|
||||
schedule_events();
|
||||
|
||||
@@ -1569,4 +1573,12 @@ void oai_shutdown(void) {
|
||||
|
||||
LOG_N(EMU, ">>>>>>>>>>>>>>>>>>>>>>>>>>> OAIEMU shutdown <<<<<<<<<<<<<<<<<<<<<<<<<<\n\n");
|
||||
}
|
||||
eNB_MAC_INST* get_eNB_mac_inst()
|
||||
{
|
||||
return eNB_mac_inst;
|
||||
}
|
||||
|
||||
OAI_Emulation* get_OAI_emulation()
|
||||
{
|
||||
return &oai_emulation;
|
||||
}
|
||||
|
||||
@@ -17,6 +17,8 @@
|
||||
#include "UTIL/OMV/structures.h"
|
||||
#endif
|
||||
|
||||
eNB_MAC_INST* get_eNB_mac_inst(void);
|
||||
OAI_Emulation* get_OAI_emulation(void);
|
||||
void init_channel_vars(LTE_DL_FRAME_PARMS *frame_parms, double ***s_re,double ***s_im,double ***r_re,double ***r_im,double ***r_re0,double ***r_im0);
|
||||
|
||||
void do_UL_sig(double **r_re0,double **r_im0,double **r_re,double **r_im,double **s_re,double **s_im,channel_desc_t *UE2eNB[NUMBER_OF_UE_MAX][NUMBER_OF_eNB_MAX],node_desc_t *enb_data[NUMBER_OF_eNB_MAX],node_desc_t *ue_data[NUMBER_OF_UE_MAX],uint16_t next_slot,uint8_t abstraction_flag,LTE_DL_FRAME_PARMS *frame_parms, uint32_t);
|
||||
@@ -25,7 +27,7 @@ void do_DL_sig(double **r_re0,double **r_im0,double **r_re,double **r_im,double
|
||||
|
||||
void init_ue(node_desc_t *ue_data, UE_Antenna ue_ant);//Abstraction changes
|
||||
void init_enb(node_desc_t *enb_data, eNB_Antenna enb_ant);//Abstraction changes
|
||||
void extract_position(Node_list input_node_list, node_desc_t**, int nb_nodes);//Abstraction changes
|
||||
void extract_position(node_list* input_node_list, node_desc_t**, int nb_nodes);//Abstraction changes
|
||||
void get_beta_map(void);//Abstraction changes
|
||||
void get_MIESM_param(void);
|
||||
|
||||
@@ -46,7 +48,7 @@ void reset_opp_meas(void);
|
||||
void print_opp_meas(void);
|
||||
|
||||
#ifdef OPENAIR2
|
||||
int omv_write (int pfd, Node_list enb_node_list, Node_list ue_node_list, Data_Flow_Unit omv_data);
|
||||
int omv_write (int pfd, node_list* enb_node_list, node_list* ue_node_list, Data_Flow_Unit omv_data);
|
||||
void omv_end (int pfd, Data_Flow_Unit omv_data);
|
||||
#endif
|
||||
|
||||
|
||||
@@ -49,6 +49,7 @@
|
||||
#include "OCG.h"
|
||||
#include "OCG_extern.h"
|
||||
#include "UTIL/OMG/omg.h"
|
||||
#include "UTIL/OMG/grid.h"
|
||||
#include "UTIL/OTG/otg_tx.h"
|
||||
#include "UTIL/OTG/otg.h"
|
||||
#include "UTIL/OTG/otg_vars.h"
|
||||
@@ -92,9 +93,19 @@ mapping omg_model_names[] =
|
||||
{"RWALK", RWALK},
|
||||
{"TRACE", TRACE},
|
||||
{"SUMO", SUMO},
|
||||
{"STEADY_RWP", STEADY_RWP},
|
||||
{"MAX_NUM_MOB_TYPES", MAX_NUM_MOB_TYPES},
|
||||
{NULL, -1}
|
||||
};
|
||||
// subtypes for RWP in grid map
|
||||
mapping omg_rwp_names[] =
|
||||
{
|
||||
{"MIN_RWP_TYPES", MIN_RWP_TYPES},
|
||||
{"RESTRICTED_RWP",RESTIRICTED_RWP},
|
||||
{"CONNECTED_DOMAIN", CONNECTED_DOMAIN},
|
||||
{"MAX_RWP_TYPES", MAX_RWP_TYPES},
|
||||
{NULL, -1}
|
||||
};
|
||||
mapping otg_multicast_app_type_names[] = {
|
||||
{"no_predefined_multicast_traffic", 0},
|
||||
{"mscbr", 1},
|
||||
@@ -241,8 +252,9 @@ void init_oai_emulation(void) {
|
||||
oai_emulation.topology_config.cell_type.selected_option = "macrocell";
|
||||
oai_emulation.topology_config.relay.number_of_relays = 0;
|
||||
oai_emulation.topology_config.mobility.UE_mobility.UE_mobility_type.selected_option = "STATIC";
|
||||
oai_emulation.topology_config.mobility.UE_mobility.grid_walk.grid_map.horizontal_grid = 1;
|
||||
oai_emulation.topology_config.mobility.UE_mobility.grid_walk.grid_map.vertical_grid = 1;
|
||||
oai_emulation.topology_config.mobility.UE_mobility.grid_walk.grid_map.selected_option="MAX_RWP_TYPES";
|
||||
//oai_emulation.topology_config.mobility.UE_mobility.grid_walk.grid_map.horizontal_grid = 1;
|
||||
//oai_emulation.topology_config.mobility.UE_mobility.grid_walk.grid_map.vertical_grid = 1;
|
||||
oai_emulation.topology_config.mobility.UE_mobility.grid_walk.grid_trip_type.selected_option = "random_destination";
|
||||
oai_emulation.topology_config.mobility.UE_mobility.UE_initial_distribution.selected_option = "random";
|
||||
oai_emulation.topology_config.mobility.UE_mobility.random_UE_distribution.number_of_nodes = 1;
|
||||
@@ -286,7 +298,7 @@ void init_oai_emulation(void) {
|
||||
oai_emulation.application_config.predefined_traffic.background[i] = "disable";
|
||||
oai_emulation.application_config.predefined_traffic.aggregation_level[i] = 1;
|
||||
oai_emulation.application_config.predefined_traffic.flow_start[i] = (i+1)*25;
|
||||
oai_emulation.application_config.predefined_traffic.flow_duration[i] = 100;
|
||||
oai_emulation.application_config.predefined_traffic.flow_duration[i] = 0xffff;
|
||||
|
||||
oai_emulation.application_config.predefined_traffic.destination_id[i] = 0;
|
||||
|
||||
@@ -389,6 +401,7 @@ void init_oai_emulation(void) {
|
||||
oai_emulation.info.omg_model_enb=STATIC; //default to static mobility model
|
||||
oai_emulation.info.omg_model_rn=STATIC; //default to static mobility model
|
||||
oai_emulation.info.omg_model_ue=STATIC; //default to static mobility model
|
||||
oai_emulation.info.omg_rwp_type = RESTIRICTED_RWP;
|
||||
oai_emulation.info.omg_model_ue_current=STATIC; //default to static mobility model
|
||||
oai_emulation.info.otg_traffic="no_predefined_traffic";
|
||||
oai_emulation.info.otg_bg_traffic_enabled = 0; // G flag
|
||||
@@ -478,6 +491,10 @@ void oaisim_config(void) {
|
||||
g_log->log_component[OTG_OWD].filelog = 1;*/
|
||||
ocg_config_app(); // packet generator
|
||||
}
|
||||
// add a var to control this, and pass this var to OMG
|
||||
set_component_filelog(OMG);
|
||||
LOG_I(OMG,"setting OMG file log \n");
|
||||
|
||||
}
|
||||
|
||||
int olg_config(void) {
|
||||
@@ -584,121 +601,161 @@ int ocg_config_env(void) {
|
||||
}
|
||||
int ocg_config_topo(void) {
|
||||
|
||||
// omg
|
||||
init_omg_global_params();
|
||||
|
||||
// setup params for openair mobility generator
|
||||
//common params
|
||||
|
||||
omg_param_list.min_X = 0;
|
||||
omg_param_list.max_X = oai_emulation.topology_config.area.x_m;
|
||||
omg_param_list.min_Y = 0;
|
||||
omg_param_list.max_Y = oai_emulation.topology_config.area.y_m;
|
||||
// init values
|
||||
omg_param_list.min_speed = 0.1;
|
||||
omg_param_list.max_speed = 20.0;
|
||||
omg_param_list.min_journey_time = 0.1;
|
||||
omg_param_list.max_journey_time = 10.0;
|
||||
omg_param_list.min_azimuth = 0; // ???
|
||||
omg_param_list.max_azimuth = 360; // ???
|
||||
omg_param_list.min_sleep = 0.1;
|
||||
omg_param_list.max_sleep = 8.0;
|
||||
|
||||
|
||||
// init OMG for eNBs
|
||||
if ((oai_emulation.info.omg_model_enb = map_str_to_int(omg_model_names, oai_emulation.topology_config.mobility.eNB_mobility.eNB_mobility_type.selected_option))== -1)
|
||||
oai_emulation.info.omg_model_enb = STATIC;
|
||||
LOG_I(OMG,"eNB mobility model is (%s, %d)\n",
|
||||
oai_emulation.topology_config.mobility.eNB_mobility.eNB_mobility_type.selected_option,
|
||||
oai_emulation.info.omg_model_enb);
|
||||
|
||||
if (oai_emulation.info.omg_model_enb == TRACE) {
|
||||
omg_param_list.mobility_file = (char*) malloc(256);// user-specific trace file "%s/UTIL/OMG/mobility.txt",getenv("OPENAIR2_DIR")
|
||||
//memset(oai_emulation.topology_config.mobility.UE_mobility.trace_config.trace_mobility_file,0,256);
|
||||
//sprintf(omg_param_list.mobility_file,"%s",oai_emulation.topology_config.mobility.UE_mobility.trace_config.trace_mobility_file);
|
||||
sprintf(omg_param_list.mobility_file,"%s/UTIL/OMG/TRACE/%s",
|
||||
getenv("OPENAIR2_DIR"),
|
||||
oai_emulation.topology_config.mobility.eNB_mobility.trace_config.trace_mobility_file);
|
||||
LOG_I(OMG,"TRACE file at %s\n", omg_param_list.mobility_file);
|
||||
}
|
||||
|
||||
omg_param_list.mobility_type = oai_emulation.info.omg_model_enb;
|
||||
omg_param_list.nodes_type = eNB; //eNB or eNB + RN
|
||||
if (strcmp(oai_emulation.topology_config.mobility.eNB_mobility.eNB_initial_distribution.selected_option, "fixed") == 0) {
|
||||
omg_param_list.user_fixed = true;
|
||||
omg_param_list.fixed_X = (double)oai_emulation.topology_config.mobility.eNB_mobility.fixed_eNB_distribution.pos_x;
|
||||
omg_param_list.fixed_Y = (double)oai_emulation.topology_config.mobility.eNB_mobility.fixed_eNB_distribution.pos_y;
|
||||
}
|
||||
omg_param_list.nodes = oai_emulation.info.nb_enb_local + oai_emulation.info.nb_rn_local;
|
||||
omg_param_list.seed = oai_emulation.info.seed; // specific seed for enb and ue to avoid node overlapping
|
||||
|
||||
// at this moment, we use the above moving dynamics for mobile eNB
|
||||
int i;
|
||||
// omg
|
||||
init_omg_global_params();
|
||||
|
||||
// setup params for openair mobility generator
|
||||
//common params
|
||||
for(i=0; i < MAX_NUM_NODE_TYPES; i++) {
|
||||
|
||||
omg_param_list[i].min_x = 0;
|
||||
omg_param_list[i].max_x = oai_emulation.topology_config.area.x_m;
|
||||
omg_param_list[i].min_y = 0;
|
||||
omg_param_list[i].max_y= oai_emulation.topology_config.area.y_m;
|
||||
// init values
|
||||
omg_param_list[i].min_speed = 0.1;
|
||||
omg_param_list[i].max_speed = 20.0;
|
||||
omg_param_list[i].min_journey_time = 0.1;
|
||||
omg_param_list[i].max_journey_time = 10.0;
|
||||
omg_param_list[i].min_azimuth = 0; // ???
|
||||
omg_param_list[i].max_azimuth = 360; // ???
|
||||
omg_param_list[i].min_sleep = 0.1;
|
||||
omg_param_list[i].max_sleep = 8.0;
|
||||
omg_param_list[i].nodes_type = i;
|
||||
omg_param_list[i].nodes=0;
|
||||
omg_param_list[i].mobility_type=STATIC;
|
||||
|
||||
// init OMG for eNBs
|
||||
|
||||
if(i==eNB) {
|
||||
if ((oai_emulation.info.omg_model_enb = map_str_to_int(omg_model_names, oai_emulation.topology_config.mobility.eNB_mobility.eNB_mobility_type.selected_option))== -1)
|
||||
oai_emulation.info.omg_model_enb = STATIC;
|
||||
|
||||
LOG_I(OMG,"eNB mobility model is (%s, %d)\n",
|
||||
oai_emulation.topology_config.mobility.eNB_mobility.eNB_mobility_type.selected_option,
|
||||
oai_emulation.info.omg_model_enb);
|
||||
|
||||
omg_param_list[i].mobility_type = oai_emulation.info.omg_model_enb;
|
||||
omg_param_list[i].nodes = oai_emulation.info.nb_enb_local + oai_emulation.info.nb_rn_local;
|
||||
omg_param_list[i].seed = oai_emulation.info.seed; // specific seed for enb and ue to avoid node overlapping
|
||||
|
||||
|
||||
if (oai_emulation.info.omg_model_enb == TRACE) {
|
||||
omg_param_list[i].mobility_file = (char*) malloc(256);// user-specific trace file "%s/UTIL/OMG/mobility.txt",getenv("OPENAIR2_DIR")
|
||||
//memset(oai_emulation.topology_config.mobility.UE_mobility.trace_config.trace_mobility_file,0,256);
|
||||
//sprintf(omg_param_list.mobility_file,"%s",oai_emulation.topology_config.mobility.UE_mobility.trace_config.trace_mobility_file);
|
||||
sprintf(omg_param_list[i].mobility_file,"%s/UTIL/OMG/TRACE/%s",
|
||||
getenv("OPENAIR2_DIR"),
|
||||
oai_emulation.topology_config.mobility.eNB_mobility.trace_config.trace_mobility_file);
|
||||
LOG_I(OMG,"TRACE file at %s\n", omg_param_list[i].mobility_file);
|
||||
// notify the user if the file is not found
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (strcmp(oai_emulation.topology_config.mobility.eNB_mobility.eNB_initial_distribution.selected_option, "fixed") == 0) {
|
||||
omg_param_list[i].user_fixed = true;
|
||||
omg_param_list[i].fixed_x = (double)oai_emulation.topology_config.mobility.eNB_mobility.fixed_eNB_distribution.pos_x;
|
||||
omg_param_list[i].fixed_y = (double)oai_emulation.topology_config.mobility.eNB_mobility.fixed_eNB_distribution.pos_y;
|
||||
}
|
||||
|
||||
/*// at this moment, we use the above moving dynamics for mobile eNB
|
||||
if (omg_param_list.nodes >0 )
|
||||
init_mobility_generator(omg_param_list);
|
||||
init_mobility_generator(omg_param_list);*/
|
||||
|
||||
}
|
||||
else if (i== UE) { // init OMG for UE
|
||||
|
||||
|
||||
// input of OMG: STATIC: 0, RWP: 1, RWALK 2, or TRACE 3, or SUMO or STEADY_RWP
|
||||
if ((oai_emulation.info.omg_model_ue = map_str_to_int(omg_model_names, oai_emulation.topology_config.mobility.UE_mobility.UE_mobility_type.selected_option))== -1)
|
||||
oai_emulation.info.omg_model_ue = STATIC;
|
||||
|
||||
LOG_I(OMG,"UE mobility model is (%s, %d)\n",
|
||||
oai_emulation.topology_config.mobility.UE_mobility.UE_mobility_type.selected_option,
|
||||
oai_emulation.info.omg_model_ue);
|
||||
|
||||
if (oai_emulation.info.omg_model_ue == RWP) {
|
||||
oai_emulation.info.omg_rwp_type = map_str_to_int(omg_rwp_names,oai_emulation.topology_config.mobility.UE_mobility.grid_walk.grid_map.selected_option);
|
||||
if (oai_emulation.info.omg_rwp_type == -1){
|
||||
LOG_I(OMG,"Apply standard RWP model \n");
|
||||
}else {
|
||||
LOG_I(OMG,"Apply %s mobility model (%d) \n", oai_emulation.topology_config.mobility.UE_mobility.grid_walk.grid_map.selected_option,
|
||||
oai_emulation.info.omg_rwp_type);
|
||||
omg_param_list[i].rwp_type= oai_emulation.info.omg_rwp_type;
|
||||
omg_param_list[i].max_vertices =
|
||||
max_vertices_ongrid (omg_param_list[i]);
|
||||
|
||||
omg_param_list[i].max_block_num =
|
||||
max_connecteddomains_ongrid (omg_param_list[i]);
|
||||
}
|
||||
}
|
||||
|
||||
omg_param_list[i].mobility_type = oai_emulation.info.omg_model_ue;
|
||||
omg_param_list[i].nodes = oai_emulation.info.nb_ue_local+ oai_emulation.info.nb_rn_local;
|
||||
omg_param_list[i].seed = oai_emulation.info.seed + oai_emulation.info.nb_ue_local; //fixme: specific seed for enb and ue to avoid node overlapping
|
||||
|
||||
// init OMG for UE
|
||||
// input of OMG: STATIC: 0, RWP: 1, RWALK 2, or TRACE 3, or SUMO
|
||||
if ((oai_emulation.info.omg_model_ue = map_str_to_int(omg_model_names, oai_emulation.topology_config.mobility.UE_mobility.UE_mobility_type.selected_option))== -1)
|
||||
oai_emulation.info.omg_model_ue = STATIC;
|
||||
LOG_I(OMG,"UE mobility model is (%s, %d)\n",
|
||||
oai_emulation.topology_config.mobility.UE_mobility.UE_mobility_type.selected_option,
|
||||
oai_emulation.info.omg_model_ue);
|
||||
omg_param_list.mobility_type = oai_emulation.info.omg_model_ue;
|
||||
omg_param_list.nodes_type = UE;//UE
|
||||
omg_param_list.nodes = oai_emulation.info.nb_ue_local+ oai_emulation.info.nb_rn_local;
|
||||
omg_param_list.seed = oai_emulation.info.seed + oai_emulation.info.nb_ue_local; //fixme: specific seed for enb and ue to avoid node overlapping
|
||||
omg_param_list[i].min_speed = (oai_emulation.topology_config.mobility.UE_mobility.UE_moving_dynamics.min_speed_mps == 0) ? 0.1 : oai_emulation.topology_config.mobility.UE_mobility.UE_moving_dynamics.min_speed_mps;
|
||||
|
||||
omg_param_list.min_speed = (oai_emulation.topology_config.mobility.UE_mobility.UE_moving_dynamics.min_speed_mps == 0) ? 0.1 : oai_emulation.topology_config.mobility.UE_mobility.UE_moving_dynamics.min_speed_mps;
|
||||
omg_param_list.max_speed = (oai_emulation.topology_config.mobility.UE_mobility.UE_moving_dynamics.max_speed_mps == 0) ? 0.1 : oai_emulation.topology_config.mobility.UE_mobility.UE_moving_dynamics.max_speed_mps;
|
||||
omg_param_list[i].max_speed = (oai_emulation.topology_config.mobility.UE_mobility.UE_moving_dynamics.max_speed_mps == 0) ? 0.1 : oai_emulation.topology_config.mobility.UE_mobility.UE_moving_dynamics.max_speed_mps;
|
||||
|
||||
omg_param_list.min_journey_time = (oai_emulation.topology_config.mobility.UE_mobility.UE_moving_dynamics.min_journey_time_ms == 0) ? 0.1 : oai_emulation.topology_config.mobility.UE_mobility.UE_moving_dynamics.min_journey_time_ms;
|
||||
omg_param_list.max_journey_time = (oai_emulation.topology_config.mobility.UE_mobility.UE_moving_dynamics.max_journey_time_ms == 0) ? 0.1 : oai_emulation.topology_config.mobility.UE_mobility.UE_moving_dynamics.max_journey_time_ms;
|
||||
omg_param_list[i].min_journey_time = (oai_emulation.topology_config.mobility.UE_mobility.UE_moving_dynamics.min_journey_time_ms == 0) ? 0.1 : oai_emulation.topology_config.mobility.UE_mobility.UE_moving_dynamics.min_journey_time_ms;
|
||||
|
||||
omg_param_list.min_azimuth = 0.1; // wait for advanced OSD
|
||||
omg_param_list.max_azimuth = 360;
|
||||
omg_param_list[i].max_journey_time = (oai_emulation.topology_config.mobility.UE_mobility.UE_moving_dynamics.max_journey_time_ms == 0) ? 0.1 : oai_emulation.topology_config.mobility.UE_mobility.UE_moving_dynamics.max_journey_time_ms;
|
||||
|
||||
omg_param_list.min_sleep = (oai_emulation.topology_config.mobility.UE_mobility.UE_moving_dynamics.min_sleep_ms == 0) ? 0.1 : oai_emulation.topology_config.mobility.UE_mobility.UE_moving_dynamics.min_sleep_ms;
|
||||
omg_param_list.max_sleep = (oai_emulation.topology_config.mobility.UE_mobility.UE_moving_dynamics.max_sleep_ms == 0) ? 0.1 : oai_emulation.topology_config.mobility.UE_mobility.UE_moving_dynamics.max_sleep_ms;
|
||||
omg_param_list[i].min_azimuth = 0.1; // wait for advanced OSD
|
||||
omg_param_list[i].max_azimuth = 360;
|
||||
|
||||
omg_param_list[i].min_sleep = (oai_emulation.topology_config.mobility.UE_mobility.UE_moving_dynamics.min_sleep_ms == 0) ? 0.1 : oai_emulation.topology_config.mobility.UE_mobility.UE_moving_dynamics.min_sleep_ms;
|
||||
|
||||
omg_param_list[i].max_sleep = (oai_emulation.topology_config.mobility.UE_mobility.UE_moving_dynamics.max_sleep_ms == 0) ? 0.1 : oai_emulation.topology_config.mobility.UE_mobility.UE_moving_dynamics.max_sleep_ms;
|
||||
|
||||
|
||||
if (oai_emulation.info.omg_model_ue == TRACE) {
|
||||
omg_param_list.mobility_file = (char*) malloc(256);// user-specific trace file "%s/UTIL/OMG/mobility.txt",getenv("OPENAIR2_DIR")
|
||||
omg_param_list[i].mobility_file = (char*) malloc(256);// user-specific trace file "%s/UTIL/OMG/mobility.txt",getenv("OPENAIR2_DIR")
|
||||
//memset(oai_emulation.topology_config.mobility.UE_mobility.trace_config.trace_mobility_file,0,256);
|
||||
//sprintf(omg_param_list.mobility_file,"%s",oai_emulation.topology_config.mobility.UE_mobility.trace_config.trace_mobility_file);
|
||||
sprintf(omg_param_list.mobility_file,"%s/UTIL/OMG/TRACE/%s",
|
||||
sprintf(omg_param_list[i].mobility_file,"%s/UTIL/OMG/TRACE/%s",
|
||||
getenv("OPENAIR2_DIR"),
|
||||
oai_emulation.topology_config.mobility.UE_mobility.trace_config.trace_mobility_file);
|
||||
LOG_I(OMG,"TRACE file at %s\n", omg_param_list.mobility_file);
|
||||
LOG_I(OMG,"TRACE file at %s\n", omg_param_list[i].mobility_file);
|
||||
|
||||
} else if (oai_emulation.info.omg_model_ue == SUMO){
|
||||
omg_param_list.sumo_command = (char*) malloc(20);
|
||||
sprintf(omg_param_list.sumo_command, "%s", oai_emulation.topology_config.mobility.UE_mobility.sumo_config.command);
|
||||
omg_param_list.sumo_config = (char*) malloc(256);
|
||||
sprintf(omg_param_list.sumo_config, "%s", oai_emulation.topology_config.mobility.UE_mobility.sumo_config.file);
|
||||
omg_param_list.sumo_start = oai_emulation.topology_config.mobility.UE_mobility.sumo_config.start;
|
||||
}
|
||||
else if (oai_emulation.info.omg_model_ue == SUMO) {
|
||||
omg_param_list[i].sumo_command = (char*) malloc(20);
|
||||
sprintf(omg_param_list[i].sumo_command, "%s", oai_emulation.topology_config.mobility.UE_mobility.sumo_config.command);
|
||||
omg_param_list[i].sumo_config = (char*) malloc(256);
|
||||
sprintf(omg_param_list[i].sumo_config, "%s", oai_emulation.topology_config.mobility.UE_mobility.sumo_config.file);
|
||||
omg_param_list[i].sumo_start = oai_emulation.topology_config.mobility.UE_mobility.sumo_config.start;
|
||||
|
||||
if (oai_emulation.topology_config.mobility.UE_mobility.sumo_config.end > 0 )
|
||||
omg_param_list.sumo_end = oai_emulation.topology_config.mobility.UE_mobility.sumo_config.end;
|
||||
omg_param_list[i].sumo_end = oai_emulation.topology_config.mobility.UE_mobility.sumo_config.end;
|
||||
else
|
||||
omg_param_list.sumo_end = (oai_emulation.info.n_frames_flag == 1 ) ? oai_emulation.info.n_frames : 1024 ; // fixme: the else case is infinity
|
||||
omg_param_list[i].sumo_end = (oai_emulation.info.n_frames_flag == 1 ) ? oai_emulation.info.n_frames : 1024 ; // fixme: the else case is infinity
|
||||
|
||||
omg_param_list.sumo_step = oai_emulation.topology_config.mobility.UE_mobility.sumo_config.step=1; // 1000ms
|
||||
omg_param_list.sumo_host = (char*) malloc(40);
|
||||
sprintf(omg_param_list.sumo_host,"%s",oai_emulation.topology_config.mobility.UE_mobility.sumo_config.hip);
|
||||
omg_param_list.sumo_port = oai_emulation.topology_config.mobility.UE_mobility.sumo_config.hport ;
|
||||
omg_param_list[i].sumo_step = oai_emulation.topology_config.mobility.UE_mobility.sumo_config.step=1; // 1000ms
|
||||
omg_param_list[i].sumo_host = (char*) malloc(40);
|
||||
sprintf(omg_param_list[i].sumo_host,"%s",oai_emulation.topology_config.mobility.UE_mobility.sumo_config.hip);
|
||||
omg_param_list[i].sumo_port = oai_emulation.topology_config.mobility.UE_mobility.sumo_config.hport ;
|
||||
LOG_D(OMG, "opt (%s,%d) cmd (%s,%s) config_file (%s,%s) hip (%s,%s) \n",
|
||||
oai_emulation.topology_config.mobility.UE_mobility.UE_mobility_type.selected_option,oai_emulation.info.omg_model_ue,
|
||||
omg_param_list.sumo_command, oai_emulation.topology_config.mobility.UE_mobility.sumo_config.command,
|
||||
omg_param_list.sumo_config, oai_emulation.topology_config.mobility.UE_mobility.sumo_config.file,
|
||||
omg_param_list.sumo_host, oai_emulation.topology_config.mobility.UE_mobility.sumo_config.hip);
|
||||
omg_param_list[i].sumo_command, oai_emulation.topology_config.mobility.UE_mobility.sumo_config.command,
|
||||
omg_param_list[i].sumo_config, oai_emulation.topology_config.mobility.UE_mobility.sumo_config.file,
|
||||
omg_param_list[i].sumo_host, oai_emulation.topology_config.mobility.UE_mobility.sumo_config.hip);
|
||||
}
|
||||
if (omg_param_list.nodes >0 )
|
||||
init_mobility_generator(omg_param_list);
|
||||
|
||||
if (oai_emulation.topology_config.omv == 1 )
|
||||
oai_emulation.info.omv_enabled = 1;
|
||||
|
||||
return 1;
|
||||
|
||||
}
|
||||
|
||||
if (oai_emulation.topology_config.omv == 1 )
|
||||
oai_emulation.info.omv_enabled = 1;
|
||||
|
||||
}//for
|
||||
|
||||
|
||||
init_mobility_generator(omg_param_list);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -43,6 +43,9 @@
|
||||
#include "PHY/extern.h"
|
||||
#include "MAC_INTERFACE/extern.h"
|
||||
#include "LAYER2/MAC/extern.h"
|
||||
#ifdef OPENAIR2
|
||||
#include "LAYER2/MAC/proto.h"
|
||||
#endif
|
||||
#include "LAYER2/PDCP_v10.1.0/pdcp.h"
|
||||
#include "LAYER2/PDCP_v10.1.0/pdcp_primitives.h"
|
||||
#include "RRC/LITE/extern.h"
|
||||
@@ -108,11 +111,10 @@ int map1,map2;
|
||||
double **ShaF = NULL;
|
||||
// pointers signal buffers (s = transmit, r,r0 = receive)
|
||||
double **s_re, **s_im, **r_re, **r_im, **r_re0, **r_im0;
|
||||
Node_list ue_node_list = NULL;
|
||||
Node_list enb_node_list = NULL;
|
||||
int pdcp_period = 0;
|
||||
node_list* ue_node_list = NULL;
|
||||
node_list* enb_node_list = NULL;
|
||||
int omg_period = 0;
|
||||
|
||||
int pdcp_period = 0;
|
||||
|
||||
// time calibration for soft realtime mode
|
||||
struct timespec time_spec;
|
||||
@@ -990,11 +992,11 @@ void update_omg (frame_t frameP) {
|
||||
|
||||
if ((frameP % omg_period) == 0 ) { // call OMG every 10ms
|
||||
update_nodes(oai_emulation.info.time_s);
|
||||
display_node_list(enb_node_list);
|
||||
display_node_list(ue_node_list);
|
||||
//display_node_list(enb_node_list);
|
||||
//display_node_list(ue_node_list);
|
||||
if (oai_emulation.info.omg_model_ue >= MAX_NUM_MOB_TYPES){ // mix mobility model
|
||||
for(UE_id=oai_emulation.info.first_ue_local; UE_id<(oai_emulation.info.first_ue_local+oai_emulation.info.nb_ue_local);UE_id++){
|
||||
new_omg_model = randomGen(STATIC,RWALK);
|
||||
new_omg_model = randomgen(STATIC,RWALK);
|
||||
LOG_D(OMG, "[UE] Node of ID %d is changing mobility generator ->%d \n", UE_id, new_omg_model);
|
||||
// reset the mobility model for a specific node
|
||||
set_new_mob_type (UE_id, UE, new_omg_model, oai_emulation.info.time_s);
|
||||
@@ -1003,7 +1005,7 @@ void update_omg (frame_t frameP) {
|
||||
|
||||
if (oai_emulation.info.omg_model_enb >= MAX_NUM_MOB_TYPES) { // mix mobility model
|
||||
for (eNB_id = oai_emulation.info.first_enb_local; eNB_id < (oai_emulation.info.first_enb_local + oai_emulation.info.nb_enb_local); eNB_id++) {
|
||||
new_omg_model = randomGen (STATIC, RWALK);
|
||||
new_omg_model = randomgen (STATIC, RWALK);
|
||||
LOG_D (OMG,"[eNB] Node of ID %d is changing mobility generator ->%d \n", eNB_id, new_omg_model);
|
||||
// reset the mobility model for a specific node
|
||||
set_new_mob_type (eNB_id, eNB, new_omg_model, oai_emulation.info.time_s);
|
||||
@@ -1013,8 +1015,10 @@ void update_omg (frame_t frameP) {
|
||||
}
|
||||
|
||||
void update_omg_ocm() {
|
||||
enb_node_list = get_current_positions(oai_emulation.info.omg_model_enb, eNB, oai_emulation.info.time_s);
|
||||
ue_node_list = get_current_positions(oai_emulation.info.omg_model_ue, UE, oai_emulation.info.time_s);
|
||||
|
||||
enb_node_list=get_current_positions(oai_emulation.info.omg_model_enb, eNB, oai_emulation.info.time_s);
|
||||
ue_node_list=get_current_positions(oai_emulation.info.omg_model_ue, UE, oai_emulation.info.time_s);
|
||||
|
||||
}
|
||||
|
||||
void update_ocm() {
|
||||
@@ -1027,6 +1031,8 @@ void update_ocm() {
|
||||
/* check if the openair channel model is activated used for PHY abstraction : path loss*/
|
||||
if ((oai_emulation.info.ocm_enabled == 1)&& (ethernet_flag == 0 )) {
|
||||
//LOG_D(OMG," extracting position of eNb...\n");
|
||||
display_node_list(enb_node_list);
|
||||
display_node_list(ue_node_list);
|
||||
extract_position(enb_node_list, enb_data, NB_eNB_INST);
|
||||
//extract_position_fixed_enb(enb_data, NB_eNB_INST,frame);
|
||||
//LOG_D(OMG," extracting position of UE...\n");
|
||||
|
||||
@@ -48,19 +48,19 @@ extern double MI_map_64qam[3][227];
|
||||
*/
|
||||
// Extract the positions of UE and ENB from the mobility model
|
||||
|
||||
void extract_position (Node_list input_node_list, node_desc_t **node_data, int nb_nodes) {
|
||||
void extract_position (node_list* input_node_list, node_desc_t **node_data, int nb_nodes) {
|
||||
|
||||
int i;
|
||||
for (i=0;i<nb_nodes;i++) {
|
||||
if ((input_node_list != NULL) && (node_data[i] != NULL)) {
|
||||
|
||||
node_data[i]->x = input_node_list->node->X_pos;
|
||||
node_data[i]->x = input_node_list->node->x_pos;
|
||||
if (node_data[i]->x <0.0)
|
||||
node_data[i]->x = 0.0;
|
||||
node_data[i]->y = input_node_list->node->Y_pos;
|
||||
node_data[i]->y = input_node_list->node->y_pos;
|
||||
if (node_data[i]->y <0.0)
|
||||
node_data[i]->y = 0.0;
|
||||
LOG_D(OCM, "extract_position: added node_data %d with position X: %f and Y: %f \n", i,input_node_list->node->X_pos, input_node_list->node->Y_pos );
|
||||
LOG_D(OCM, "extract_position: added node_data %d with position X: %f and Y: %f \n", i,input_node_list->node->x_pos, input_node_list->node->y_pos );
|
||||
input_node_list = input_node_list->next;
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user