Re: [ns] Random time to send a packet

2012-10-03 Thread Rafael P B Mota
Thanks for the response Christos!! I tried the while solution with no success. Is there any way to wait, for instance, 100ms, before the command send(pktret,0) is executed ? I guess it's a simple issue, but until now I was not able to solve. Does anyone can suggest something to do ? Thanks

Re: [ns] Random time to send a packet

2012-10-03 Thread Rafael P B Mota
Hello Natalya, I tryed the solution: srand(time(NULL)); int tempo = rand() % 400 + 100; Scheduler sch = Scheduler::instance(); sch.schedule(target_,pktret,tempo); //send(pktret,0); But the packet is not sent. If I uncomment the line

Re: [ns] Random time to send a packet

2012-10-03 Thread Rafael P B Mota
Hello Natalya, I found a problem in my random number generator. The number generated was to high. I tried to use your solution (Random::uniform(0,1)) but the compiler was unable to find the function and class Random. What library should I include to use Random::uniform ? Another question: If I

Re: [ns] Random time to send a packet

2012-10-03 Thread Rafael P B Mota
Hello Natalya Thank you very much for your help. Now my agent is working properly. It delays x random seconds. Rafael 2012/10/3 Natalya Rozhnova rojnovanatha...@yandex.ru Hi Rafael, In order to use the Random class of ns2 you should include random.h in your code. I guess there are some