On 5/17/19 5:31 AM, KonstantinosDim wrote:
> Hello everyone, i am new to ns3 and i have a question regarding the
> lena-x2-handover-measures.cc example.
> I implemented it using 10 UEs and 8 eNBs and used custom positions and
> speed for the UEs.
> I want to get the position of UEs frequently, for example before and
> after a handover.
> This is the code i added to get positions, but it doesnt show any
> output. Any ideas what i am doing wrong?
Make sure that you are working with a debug build; otherwise, the
NS_LOG_UNCOND () statement will not happen. Or else change
NS_LOG_UNCOND() to std::cout ...
>
> Code for function :(above main)
>
> |
> Εισαγωγήκώδικαεδώ...void
> CourseChange(std::stringcontext,Ptr<constMobilityModel>model)
> {
> Vectorposition =model->GetPosition();
> NS_LOG_UNCOND (context <<
> " x = "<<position.x <<", y = "<<position.y);
> }
> |
> Code for trace :(before Simulation ::Stop)
>
> |
> std::ostringstream oss;
> oss
> <<"/NodeList/"<<ueNodes.Get(numberOfUes-1)->GetId()<<"/$ns3::MobilityModel/CourseChange";
> Config::Connect(oss.str (),MakeCallback(&CourseChange));Εισαγωγήκώδικαεδώ...
> |
>
The above will trace the course of the last UE in the ueNodes container,
not all UEs (your message above suggested that you would like all UEs).
This string can be used to get course change of all nodes:
"/NodeList/*/$ns3::MobilityModel/CourseChange"
> I suppose i have to add it and somewhere else but since i am new with
> this i would appreciate any kind of help :)
>
> --
> Posting to this group should follow these guidelines
>
https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting
> ---
> You received this message because you are subscribed to the Google
> Groups "ns-3-users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to
ns-3-users+...@googlegroups.com
> <mailto:
ns-3-users+...@googlegroups.com>.
> To post to this group, send email to
ns-3-...@googlegroups.com
> <mailto:
ns-3-...@googlegroups.com>.
> Visit this group at
https://groups.google.com/group/ns-3-users.
> To view this discussion on the web visit
>
https://groups.google.com/d/msgid/ns-3-users/5d3ecd09-f831-4cb6-9928-d778a198190b%40googlegroups.com
> <
https://groups.google.com/d/msgid/ns-3-users/5d3ecd09-f831-4cb6-9928-d778a198190b%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit
https://groups.google.com/d/optout.