few bug fixes for trace-drive openair mobility generator (OMG)
git-svn-id: http://svn.eurecom.fr/openair4G/trunk@5697 818b1a75-f10b-46b9-bf7c-635c3b92a50f
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
+26
-12
@@ -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)
|
||||
{
|
||||
|
||||
|
||||
Reference in New Issue
Block a user