Hi,
I didn't want to make fun of you, and I'm sorry if you misunderstood.
Your approach seems reasonable (first check if the algorithm is worth studying, then add the needed parts to make it realistic). I was referring exactly to this very same thing: I've seen too many idiots stopping at the first stage and claiming victory, without realizing that the hard part is the second one.
As a matter of fact, the problem is the information knowledge delay. What you'll have in a few is the code to know the instantaneous (and ideal) node's position and speed. Any realistic algorithm will have to cope with the fact that this information is not really available because:
1) the measure is affected by errors (even if one uses GPS) and
2) there is a delay between the UE measure and the measure delivery to the EPC.
Depending on the speed of the control loop (i.e., how much overhead one wants to introduce in the system), this difference may be quite huge. Just think to a motorbike in a city traffic. You'd have to send speed info every 10th of second to track it decently.
Anyway, you seems well aware of these issue, so you can use the ideal code wisely (it's still an ideal case, useful as a limit).
And now the code.
for (uint32_t i = 0; i < NodeList::GetNNodes (); i++)
{
Ptr<Node> node = NodeList::GetNode (i);
Ptr<MobilityModel> mobility = node->GetObject<MobilityModel>();
if (mobility)
{
std::cout << "node " << i << " is located at " << mobility->GetPosition ();
std::cout << " and its speed is " << mobility->GetVelocity () << std::endl;
}
}
As you see, the code uses two tricks that should used carefully.
1) it pokes *all* the nodes in the simulation (it's up to you to filter the ones you're interested into) and
2) it ask the position and speed directly to the node's mobility model (thus it's not a measure, it's an a-priori knowledge).
Cheers,
T.