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

Re: Run ns-2 simu a second time?




> Hello ns-2 users,
> 
> can anybody give me a hint how to invoke a second simulation within the same 
> tcl-script? After destroying the (all?) objects for the first simulation, ns 
> crashes when invoking
> 
> 	new DM $ns $n
> 
> for the second time ($ns being the newly created MultiSim object and $n being 
> a newly created node).
> The error message is attached below.
> 
> Also, how do I tell ns-2 to properly delete all objects that were created 
> during the first simulation? Or do I have to keep track of all the objects 
> myself (as I do now) and delete them all seperately? How do I get to know 
> which objects were created by an ns-2 method (the interface hides the 
> details)? > 
> 

Hi Chris,

	I have a script for multiple simulations for multicast, to run 
several scenarios (but over the same topology) [check 
ns-2/tcl/ex/newmcast/pim-test-suite-1.tcl]..

when the first simulation ends, I call '$ns clear-mcast' then '$ns 
run-mcast', to clear the multicast caches/routing tables... etc, and 
restart them,

hope this is useful,

Regards,
-A

>        Regards,
> 
>              -Chris.
> 
> 
> error message produced:
> =======================
> 
> class DM: constructor failed (invalid command name "_o9 _o71"): invalid 
> command name "_o9 _o71"
>     while executing
> "$ns get-nam-traceall"
>     invoked from within
> "set trace [$ns get-nam-traceall]..."
>     (procedure "_o75" line 3)
>     invoked from within
> "$self namtrace-agent $agent"
>     (procedure "_o75" line 21)
>     invoked from within
> "$Node attach $prune"
>     (procedure "_o80" line 5)
>     invoked from within
> "$self initialize"
>     (procedure "_o80" line 7)
>     invoked from within
> "_o80 init _o71 _o75"
>     invoked from within
> "DM create _o80 _o71 _o75"
>     invoked from within
> "if [catch "$className create $o $args" msg] {
> if [string match "__FAILED_SHADOW_OBJECT_" $msg] {
> delete $o
> return ""
> }
> global errorInfo
> error "class $ ..."
>     (procedure "new" line 3)
>     invoked from within
> "new DM $ns $n"
>     ("foreach" body line 7)
>     invoked from within
> "foreach obj $rp(allNodes) {
> puts stdout "$rp(nb_node_setup)"
>         set id [ined id $obj]
>         set n [$ns node]
>     (procedure "setup_topology" line 8)
>     invoked from within
> "setup_topology $ns"
>     (procedure " Start Simulation" line 34)
>     invoked from within
> "{ Start Simulation} {}"
> 
> 
>