About error of making animation of broadcastMAC_example

32 views
Skip to first unread message

Abir Hossain

unread,
Jun 27, 2016, 2:52:54 AM6/27/16
to ns-3-users

Dear
i would like to make an animation of the file broadcastMAC_example under the directory /src/aqua-sim-ng/examples/broadcastMAC_example but it shows error.

as
 
../scratch/broadcast_MAC.cc:179:77: error: invalid conversion from ‘int’ to ‘ns3::Node*’ [-fpermissive]
     anim.SetConstantPosition (nodes, devices.Get(0)->GetIfIndex(), 1.0 , 2.0);
                                                                             ^
/ns3/ptr.h:721:1: error:   initializing argument 1 of ‘ns3::Ptr<T>::Ptr(T*) [with T = ns3::Node]’ [-fpermissive]
 Ptr<T>::Ptr (T *ptr)

please help.
broadcast_MAC.cc

Konstantinos

unread,
Jun 27, 2016, 5:32:50 AM6/27/16
to ns-3-users
Dear Abir,

I do not know which ns-3 release you are using, but in the latest, the SetConstantPosition is defined as follows:
void ns3::AnimationInterface::SetConstantPosition(PtrNode > n,
double x,
double y,
double z = 0 
)

This means that you need to pass the smart pointer for the node, and then its coordinates. 
Your call is not like this at all
anim.SetConstantPosition (nodes, devices.Get(0)->GetIfIndex(), 1.0 , 2.0);

However, I would recommend to use the native ns-3 mobility models to assign the position of the nodes instead of using the AnimationInterface to set it. 
From your code, I see that you already have tried to do this, and I do not understand why you need to use the SetConstantPosition.

Regards,
K.

Abir Hossain

unread,
Jun 27, 2016, 11:24:31 AM6/27/16
to ns-3-users
Dear
My updated files creating nodes successfully. it creates a simulation error as

-----------Initializing simulation-----------
Creating Nodes
Node: 0x16446f0 newDevice: 0x1645510 Position: 0,0,0 freq:25
Node: 0x16448c0 newDevice: 0x16466c0 Position: 2000,0,0 freq:25
Sink: 0x16449e0 newDevice: 0x16472e0 Position: 4000,0,0
02-01-00 &&& 0
02-01-01 &&& 0
-----------Running Simulation-----------
Command ['/home/abir/ns3/ns-allinone-3.25/ns-3.25/build/scratch/broadcast_MAC'] terminated with signal SIGSEGV. Run it under a debugger to get more information (./waf --run <program> --command-template="gdb --args %s <args>").

i could not recognize the problem. please help.
broadcast_MAC.cc

Konstantinos

unread,
Jun 27, 2016, 11:43:18 AM6/27/16
to ns-3-users
Abir,

we have said it hundreds of times, we can not provide support for models not in the main ns-3 codebase or out-dated releases.
The output from the compiler gives you the guidelines on how to go forward "Run it under a debugger to get more information (./waf --run <program> --command-template="gdb --args %s <args>")."

Apart from the usual places to read (tutorial, manual, wiki) where there is information on how to debug your code, I would recommend also this year's training session on debugging.
Reply all
Reply to author
Forward
0 new messages