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

Re: [ns] Dynamic objects



Nothing prevents you from doing that, just like you can new/delete objects
in otcl. But you should be careful how the deleted objects would interact
with other objects, especially if there're pending events scheduled when 
you delete the target object for the events.

Furthermore, you should not new/delete split objects from C++; they should
always be done from otcl so that correct initialization is done. 

Hope this helps. 

- Haobo

On Thu, 23 Mar 2000, Pierre Bacquet wrote:

> Hello,
> 
> I have searched the archive, and I won't swear I am right,
> but I haven't seen so far things concerning dynamic objects.
> 
> Basically, in a mobile environment I would like to dynamically
> create and delete new objects (such as mobile users) with their
> internal protocol stack.
> 
> Since the core of NS2 is C++, new() and delete() operators come
> obviously to the stage. But, is the kernel able to cope with
> dynamic object creation once the simulation has been started ? Through
> the Otcl language I can create nodes which translates somehow
> into a call to new() but this is in general before the scheduler
> is started.
> 
> Is there somebody already having done that ? Or is it simply
> possible ?
> 
> TIA,
> 
> ------------------------------------------------------------------
> Pierre BACQUET,
> Director of Engineering and Research
> 
> DELTA Partners H.Q.
> High Technologies for Telecommunications & Distributed  Systems
> http:	//www.delta.fr
> Tel: 	+33 (0)5 61 39 09 21  	Fax:  +33 (0)5 61 39 15 71
> 
>