[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ns2] How can I stop the simulator?



>
> From:  "Christoph Haenle" <christoph@starburstcom.com>
> To:    <ns-users@mash.cs.berkeley.edu>
> Subject: [ns2] How can I stop the simulator?
> Date:  Tue, 26 Aug 97 12:08:41 EDT
>
>      Hi everybody,
> 
> I need a means to stop the simulator even though there are still events
> scheduled. I want the simulator to RETURN from the command "$ns run" rather
> than having a callback-function like "finish" launched. In my case it would
> be perfectly fine to do a "$ns halt" from within a callback-function, and
> expected the simulator to terminate after the callback-function returns.
> But "halt" is not a documented feature and it doesn't work for me ("Unable
> to dispatch method halt").
> 
>      Any suggestions?
> 
>    TX,
> 
>      -Chris.

Halt is ok to use, but you need to do it on the scheduler rather
than the simulator... e.g.

	$ns_ instvar scheduler_
	$scheduler $halt

(I believe this will work)..
- K