ns.cppyy.cppdef("""
using namespace ns3;
static void CourseChange(std::string context, Ptr<const MobilityModel> mobility)
{
Vector pos = mobility->GetPosition();
Vector vel = mobility->GetVelocity();
std::cout << Simulator::Now() << ", model=" << mobility << ", POS: x=" << pos.x
<< ", y=" << pos.y << ", z=" << pos.z << "; VEL:" << vel.x << ", y=" << vel.y
<< ", z=" << vel.z << std::endl;
}
""")
....
....
....
ns.core.Connect("/NodeList/*/$ns3::MobilityModel/CourseChange",ns.MakeCallback(ns.cppyy.gbl.CourseChange))