diff --git a/openair2/UTIL/OMG/TRACE/README.TXT b/openair2/UTIL/OMG/TRACE/README.TXT index 525d0e951e1775fec5b6f938106e712167a73715..cc592be40ca933020d24cb553618a496c731c3fe 100644 --- a/openair2/UTIL/OMG/TRACE/README.TXT +++ b/openair2/UTIL/OMG/TRACE/README.TXT @@ -11,12 +11,17 @@ Notes: - OMG TRACE support mobility input given in the following format: - TIME(s) NODE_ID NODE_POS_X NODE_POS_Y NODE_SPEED(m/s) + EXPECTED_TIME(s) NODE_ID NODE_POS_X NODE_POS_Y NODE_SPEED(m/s) - Note: OMG uses the speed (NODE_SPEED) at this time (TIME) from this position (NODE_POS_X,NODE_POS_Y) for this NODE_ID - - each input may be ordered (in time) or not - - - The mobility described in the mobility file strictly follows the simulation time, only condition where it doesn't follow is, when a node fails to reach its next point (in time) from where it has to start next journey. + Notes: + 1) OMG uses the speed (NODE_SPEED) at this time (TIME) from this position (NODE_POS_X,NODE_POS_Y) for this NODE_ID + 2) each input may be ordered (in time) or not + 3) early arrivals at each points cause a sleep for a duration of the time difference + 4) late arrivals for each points cause nothing (no jump), the point will be reached later in time. + 5) all the points will be reached based on their expected times. + 6) if the first expected time is greater than zero, then the node will be in a pause state at the initial position for the duration of the expected time + 7) The mobility described in the mobility file strictly follows the simulation time, only condition where it doesn't follow is, when a node fails to reach its next point (in time) from where it has to start next journey. + 8) the speed for the last expected time is ignored ---------------------------------------------------------------------------------- The OpenAirInterface Team diff --git a/openair2/UTIL/OMG/TRACE/handover.tr b/openair2/UTIL/OMG/TRACE/handover.tr index d865d3445cb5d0ed73dce966ae9a7ed9a500e220..cbfa892d8c1c860da09db0fef5d14d8c34972d4b 100644 --- a/openair2/UTIL/OMG/TRACE/handover.tr +++ b/openair2/UTIL/OMG/TRACE/handover.tr @@ -1,7 +1,13 @@ -0 0 867 1440 20 -25 0 965 1560 20 -50 0 867 1440 20 -75 0 965 1560 20 -100 0 867 1440 20 -125 0 965 1560 20 - +0 0 867 1440 40 +1 0 887 1460 40 +2 0 907 1480 30 +3 0 927 1500 30 +4 0 947 1520 30 +5 0 967 1540 30 +6 0 987 1560 30 +7 0 1007 1580 30 +8 0 1027 1600 30 +9 0 1047 1620 30 +10 0 1067 1640 30 +11 0 1087 1660 30 +12 0 1107 1680 30 diff --git a/openair2/UTIL/OMG/trace.c b/openair2/UTIL/OMG/trace.c index c9e685951a5513888eb05bf1cd17e82ff4bb8393..080e4326a6f27243c60e4f04c1b6f99f9b469fb6 100644 --- a/openair2/UTIL/OMG/trace.c +++ b/openair2/UTIL/OMG/trace.c @@ -254,16 +254,18 @@ sleep_trace_node (pair_struct * pair, node_data * n_data, double cur_time) node->y_pos = node->mob->y_to; //sleep duration + /* */ if (n_data->x_pos == n_data->next->x_pos && n_data->y_pos == n_data->next->y_pos) { node->mob->sleep_duration = n_data->next->time - n_data->time; - + LOG_D(OMG,"[TRACE] curretn and next lcoation are the same : sleep for %f\n",node->mob->sleep_duration); } - else + else /* early arrival*/ { //sleep case 2 - node->mob->target_time - (journeytime + node->mob->start_journey); - + //node->mob->sleep_duration = node->mob->target_time - (journeytime + node->mob->start_journey); + node->mob->sleep_duration = node->mob->target_time - pair->next_event_t; + LOG_D(OMG,"[TRACE] Early Arrival (target time > journeytime), sleep for %f target time was %f\n",node->mob->sleep_duration,node->mob->target_time); } node->mob->start_journey = cur_time; @@ -292,7 +294,12 @@ update_trace_nodes (double cur_time) my_node = tmp->pair->b; node_n = get_next_data (table[my_node->type], my_node->gid, DATA_ONLY); - if (node_n->next->next == NULL) + + //case1:time to next event equals to current time + if (tmp->pair != NULL && tmp->pair->next_event_t >= cur_time - eps + && tmp->pair->next_event_t <= cur_time ) + { + if (node_n->next->next == NULL) { tmp->pair->b->x_pos = tmp->pair->b->mob->x_to; tmp->pair->b->mob->x_from = tmp->pair->b->x_pos; @@ -305,12 +312,6 @@ update_trace_nodes (double cur_time) continue; } - - - //case1:time to next event equals to current time - if (tmp->pair != NULL && tmp->pair->next_event_t >= cur_time - eps - && tmp->pair->next_event_t <= cur_time + eps) - { //LOG_D (OMG, "[TRACE] last data for all nodes\n"); if (my_node->mobile == 1) { @@ -366,8 +367,21 @@ update_trace_nodes (double cur_time) } //case2: current time is greater than the time to next event - else if (tmp->pair != NULL && cur_time - eps > tmp->pair->next_event_t) + else if (tmp->pair != NULL && cur_time > tmp->pair->next_event_t) + { + if (node_n->next->next == NULL) { + tmp->pair->b->x_pos = tmp->pair->b->mob->x_to; + tmp->pair->b->mob->x_from = tmp->pair->b->x_pos; + tmp->pair->b->y_pos = tmp->pair->b->mob->y_to; + tmp->pair->b->mob->y_from = tmp->pair->b->y_pos; + tmp->pair->b->mobile = 0; + tmp->pair->b->mob->speed = 0.0; + // LOG_D (OMG, "[TRACE] last data for all nodes\n"); + tmp = tmp->next; + continue; + } + while (cur_time >= tmp->pair->next_event_t) { diff --git a/targets/SIMU/USER/oaisim.c b/targets/SIMU/USER/oaisim.c index fc35dea4a2fb400a2bb4f8a969067f068c155082..97d472680fc176f5614bd751ec9f82c10d04bfe0 100644 --- a/targets/SIMU/USER/oaisim.c +++ b/targets/SIMU/USER/oaisim.c @@ -631,7 +631,7 @@ void *l2l1_task(void *args_p) { oai_emulation.info.frame = frame; //oai_emulation.info.time_ms += 1; - oai_emulation.info.time_s += 0.1; // emu time in s, each frame lasts for 10 ms // JNote: TODO check the coherency of the time and frame (I corrected it to 10 (instead of 0.01) + oai_emulation.info.time_s += 0.01; // emu time in s, each frame lasts for 10 ms // JNote: TODO check the coherency of the time and frame (I corrected it to 10 (instead of 0.01) // if n_frames not set by the user or is greater than max num frame then set adjust the frame counter if ((oai_emulation.info.n_frames_flag == 0) || (oai_emulation.info.n_frames >= 0xffff)) { frame %= (oai_emulation.info.n_frames - 1); diff --git a/targets/SIMU/USER/oaisim_functions.c b/targets/SIMU/USER/oaisim_functions.c index 39c450d2ba047d488db7977da9a14100e23133e0..d75f87e80a495c17245e4c5a703ddc0a4d01ee4b 100644 --- a/targets/SIMU/USER/oaisim_functions.c +++ b/targets/SIMU/USER/oaisim_functions.c @@ -1000,8 +1000,8 @@ 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); @@ -1039,8 +1039,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); + //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");