Hello 
Can you Please help me with knowing some of functions to be edited while
making a new protocol ,
I am working on ns2 but it really confuses me like how to add a timer ,
scheduler  , agent  . I don't understand where to add . I try but i get some
errors while compiling . If you can Please help me i am putting up at
[email protected] 

svanan77 wrote:
> 
> 
> Dear Hongsheng Lu,
> 
> Scheduler::instance().clock() has 9 decimal point accuracy, most of
> the time it will be different.
> 
> Even you are calling it in the same file and in the same function, you
> might end up completely different timings. You can either use a
> debugger or simply printf statements to understand this.
> 
> For instance, assume you have a topology of two wireless nodes, T and
> R where T transmits a data packet to R using 802.11 MAC.
> 
> Try to put a printf statement calling scheduler::instance().clock()
> directly before send(p,h) at,
> 
>       if(hdr->direction() == hdr_cmn::DOWN) {
>                 send(p, h);
>                 return;
>         }
> 
> and another printf statement directly after the IF loop.
> 
> in Mac802_11::recv function in mac-802_11.cc file
> 
> You will see completely different clock information as it is not a
> systems time but simulated time. The first timing information related
> when T sends a packet and the second timing information related when R
> received a packet at the MAC layer which accounts a link delay among
> other timing parameter.
> 
> By just shifting the printf statement couple of lines in the same
> function you are already at a different node location.
> 
> Good Luck.
> 
> rgds
> Saravanan K
> 
> 
> 
> 
> 
> On Sat, Aug 4, 2012 at 2:45 AM, Hongsheng Lu <[email protected]> wrote:
>>
>> Hi there,
>>
>> I am a newer to NS2. Could anyone tells me
>> how Scheduler::instance().clock() works? In particular,
>> when Scheduler::instance().clock() are called at two different places in
>> the program (might be in different methods or classes), how can I tell
>> whether they return the same or different time? Thanks a lot.
>>
>> --
>> Best Regards,
>> Hongsheng Lu
> 
> 
> 


-----
Ajinkya K
:rules:
-- 
View this message in context: 
http://old.nabble.com/need-help-on-understanding-Scheduler%3A%3Ainstance%28%29.clock%28%29-tp34253457p34273354.html
Sent from the ns-users mailing list archive at Nabble.com.

Reply via email to