Re: [ns] [Wireless - AODV] HOWTO stop simulation right after a node dies?

2011-05-10 Thread Clederson
Thank you very much for your answer. My problem is now solved! []'s On Sat, May 7, 2011 at 11:43 AM, fivos wrote: > My previous answer is wrong i think but you get the point. You need to > return (TCL_ERROR) at the c++ function that was called by TCL. > You can then catch the error at your tcl

Re: [ns] [Wireless - AODV] HOWTO stop simulation right after a node dies?

2011-05-07 Thread fivos
My previous answer is wrong i think but you get the point. You need to return (TCL_ERROR) at the c++ function that was called by TCL. You can then catch the error at your tcl script and do what you want when that error is raised. On Sat, May 7, 2011 at 5:40 PM, fivos wrote: > try : return (TCL_

Re: [ns] [Wireless - AODV] HOWTO stop simulation right after a node dies?

2011-05-07 Thread fivos
try : return (TCL_ERROR); instead of: exit(1); On Sat, May 7, 2011 at 4:53 PM, Clederson wrote: > In my case it'd be stopping completely the simulation. > I've been trying to abort the execution in the Mobilenode::log_energy method. > I'm doing something like this: > void > MobileNode::log_ener

Re: [ns] [Wireless - AODV] HOWTO stop simulation right after a node dies?

2011-05-07 Thread Clederson
In my case it'd be stopping completely the simulation. I've been trying to abort the execution in the Mobilenode::log_energy method. I'm doing something like this: void MobileNode::log_energy(int flag) { if (!log_target_) return; Scheduler &s = Scheduler::instance(); if (flag) { //sp

Re: [ns] [Wireless - AODV] HOWTO stop simulation right after a node dies?

2011-05-07 Thread fivos
You mean stopping completely or pausing and then resuming the simulation? I am positive the first is possible with some slight modifications while the second is doubtful or at least very hard to accomplish. Maybe someone else can shed some light on the second possibility. cheers, Fivos On Sat, M

[ns] [Wireless - AODV] HOWTO stop simulation right after a node dies?

2011-05-07 Thread Clederson
Hello, I'd like to know how could I stop the simulation in the moment a mobile node have energy = 0. In tcl scripts I've only seen people stopping the simulation by time. Is it possible to be done? Thank you in advance. -- Clederson