schedule Destroy for

24 views
Skip to first unread message

Francisco Eduardo Balart Sanchez

unread,
Jul 28, 2018, 8:46:36 PM7/28/18
to ns-3-users
Good day:

I have several counters of packets, and other attributes on a MAC layer i have made (inheriting from AdhocWifiMac)
I would like to get the values of such counters and other attributes of each node at the end of simulation

I would like to use the ScheduleDestroy so i can obtain such values when the simulation comes
     
    EventId ns3::Simulator::ScheduleDestroy(const PtrEventImpl > & event)

Basically i would like to go throw each onde and the access such values and log them for further post proccessing

The documentation at the manual:  https://www.nsnam.org/docs/manual/html/events.html?highlight=scheduledestroy does not give an example

I have read the few threads in which people use this:

I would really appreciate any pointers on this

pdbarnes

unread,
Jul 29, 2018, 5:19:57 PM7/29/18
to ns-3-users
While you *could* use ScheduleDestroy for this purpose, there will probably be some subtle gotchas, since you don’t control the order of calling the events.

A more typical approach is to collect and report your statistics from your main script, after Simulator::Run returns, and before you call Simulator::Destroy.

Peter

Francisco Eduardo Balart Sanchez

unread,
Jul 31, 2018, 7:16:19 PM7/31/18
to ns-3-users
Good day:

Thanks for the quick response, i see.
But in case i wanted to do it, can you provide a example of the code on ScheduleDestroy ?
Reply all
Reply to author
Forward
0 new messages