astyle --recursive --indent=spaces=2 --style=kr --indent-col1-comments --break-blocks --convert-tabs --max-code-length=200
This is done for better merging branch/LG_PRE_RELEASE_0.3 into trunk (same process is applied on this branch) git-svn-id: http://svn.eurecom.fr/openair4G/trunk@7073 818b1a75-f10b-46b9-bf7c-635c3b92a50f
This commit is contained in:
+59
-58
@@ -28,12 +28,12 @@
|
||||
*******************************************************************************/
|
||||
|
||||
/*! \file rwalk.c
|
||||
* \brief static mobility generator
|
||||
* \brief static mobility generator
|
||||
* \author M. Mahersi, N. Nikaein, J. Harri
|
||||
* \date 2011
|
||||
* \version 0.1
|
||||
* \company Eurecom
|
||||
* \email:
|
||||
* \email:
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
@@ -56,19 +56,20 @@ start_static_generator (omg_global_param omg_param_list)
|
||||
srand (omg_param_list.seed + STATIC);
|
||||
|
||||
LOG_I (OMG, "Static mobility model for %d %d nodes\n", omg_param_list.nodes,
|
||||
omg_param_list.nodes_type);
|
||||
for (id = n_id; id < (omg_param_list.nodes + n_id); id++)
|
||||
{
|
||||
omg_param_list.nodes_type);
|
||||
|
||||
node = create_node ();
|
||||
mobility = create_mobility ();
|
||||
for (id = n_id; id < (omg_param_list.nodes + n_id); id++) {
|
||||
|
||||
node = create_node ();
|
||||
mobility = create_mobility ();
|
||||
|
||||
node->id = id;
|
||||
node->type = omg_param_list.nodes_type;
|
||||
node->mob = mobility;
|
||||
node->generator = STATIC;
|
||||
place_static_node (node); //initial positions
|
||||
}
|
||||
|
||||
node->id = id;
|
||||
node->type = omg_param_list.nodes_type;
|
||||
node->mob = mobility;
|
||||
node->generator = STATIC;
|
||||
place_static_node (node); //initial positions
|
||||
}
|
||||
n_id += omg_param_list.nodes;
|
||||
|
||||
|
||||
@@ -79,53 +80,53 @@ start_static_generator (omg_global_param omg_param_list)
|
||||
void
|
||||
place_static_node (node_struct * node)
|
||||
{
|
||||
if (omg_param_list[node->type].user_fixed && node->type == eNB)
|
||||
{
|
||||
if (omg_param_list[node->type].fixed_x <=
|
||||
omg_param_list[node->type].max_x
|
||||
&& omg_param_list[node->type].fixed_x >=
|
||||
omg_param_list[node->type].min_x)
|
||||
node->x_pos = omg_param_list[node->type].fixed_x;
|
||||
else
|
||||
node->x_pos =
|
||||
(double) ((int)
|
||||
(randomgen
|
||||
(omg_param_list[node->type].min_x,
|
||||
omg_param_list[node->type].max_x) * 100)) / 100;
|
||||
node->mob->x_from = node->x_pos;
|
||||
node->mob->x_to = node->x_pos;
|
||||
if (omg_param_list[node->type].fixed_y <=
|
||||
omg_param_list[node->type].max_y
|
||||
&& omg_param_list[node->type].fixed_y >=
|
||||
omg_param_list[node->type].min_y)
|
||||
node->y_pos = omg_param_list[node->type].fixed_y;
|
||||
else
|
||||
node->y_pos =
|
||||
(double) ((int)
|
||||
(randomgen
|
||||
(omg_param_list[node->type].min_y,
|
||||
omg_param_list[node->type].max_y) * 100)) / 100;
|
||||
node->mob->y_from = node->y_pos;
|
||||
node->mob->y_to = node->y_pos;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
if (omg_param_list[node->type].user_fixed && node->type == eNB) {
|
||||
if (omg_param_list[node->type].fixed_x <=
|
||||
omg_param_list[node->type].max_x
|
||||
&& omg_param_list[node->type].fixed_x >=
|
||||
omg_param_list[node->type].min_x)
|
||||
node->x_pos = omg_param_list[node->type].fixed_x;
|
||||
else
|
||||
node->x_pos =
|
||||
(double) ((int)
|
||||
(randomgen
|
||||
(omg_param_list[node->type].min_x,
|
||||
omg_param_list[node->type].max_x) * 100)) / 100;
|
||||
node->mob->x_from = node->x_pos;
|
||||
node->mob->x_to = node->x_pos;
|
||||
(double) ((int)
|
||||
(randomgen
|
||||
(omg_param_list[node->type].min_x,
|
||||
omg_param_list[node->type].max_x) * 100)) / 100;
|
||||
|
||||
node->mob->x_from = node->x_pos;
|
||||
node->mob->x_to = node->x_pos;
|
||||
|
||||
if (omg_param_list[node->type].fixed_y <=
|
||||
omg_param_list[node->type].max_y
|
||||
&& omg_param_list[node->type].fixed_y >=
|
||||
omg_param_list[node->type].min_y)
|
||||
node->y_pos = omg_param_list[node->type].fixed_y;
|
||||
else
|
||||
node->y_pos =
|
||||
(double) ((int)
|
||||
(randomgen
|
||||
(omg_param_list[node->type].min_y,
|
||||
omg_param_list[node->type].max_y) * 100)) / 100;
|
||||
node->mob->y_from = node->y_pos;
|
||||
node->mob->y_to = node->y_pos;
|
||||
}
|
||||
(double) ((int)
|
||||
(randomgen
|
||||
(omg_param_list[node->type].min_y,
|
||||
omg_param_list[node->type].max_y) * 100)) / 100;
|
||||
|
||||
node->mob->y_from = node->y_pos;
|
||||
node->mob->y_to = node->y_pos;
|
||||
} else {
|
||||
|
||||
node->x_pos =
|
||||
(double) ((int)
|
||||
(randomgen
|
||||
(omg_param_list[node->type].min_x,
|
||||
omg_param_list[node->type].max_x) * 100)) / 100;
|
||||
node->mob->x_from = node->x_pos;
|
||||
node->mob->x_to = node->x_pos;
|
||||
node->y_pos =
|
||||
(double) ((int)
|
||||
(randomgen
|
||||
(omg_param_list[node->type].min_y,
|
||||
omg_param_list[node->type].max_y) * 100)) / 100;
|
||||
node->mob->y_from = node->y_pos;
|
||||
node->mob->y_to = node->y_pos;
|
||||
}
|
||||
|
||||
node->mob->speed = 0.0;
|
||||
node->mob->journey_time = 0.0;
|
||||
|
||||
Reference in New Issue
Block a user