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

[ns] Re: Calculate link bandwidth in C++




I change the SimpleLink to Link, got the same result.

When I try to use the following way,
  tcl.evalf("[Simulator instance] link %d %d",src, dst);
  tcl.evalf("%s set bandwidth_", tcl.result());

I got 

ns: _o225 set bandwidth_: can't read "bandwidth_": no such variable
    (Object set line 1)
    invoked from within
"_o225 set bandwidth_"



> 
> I want to get the bandwidth of some link in C++
> however the following instproc failed.
> (Called by evalf(), it always returns 1000.)
> Would you like to tell me how to do that?
> Thanks,
> 
> Lee
> 
> SimpleLink instproc bandwidth? {} {
> 	$self instvar bandwidth_
> 	if ![info exists bandwidth_] {
> 		set bandwidth_ 1000
> 	}
> 	set bandwidth_
> }
> 
> Link is created using
> $ns duplex-link $src $dst $bw $delay DropTail
> 
> 


****************************
* VP Communication, CSSA   *
* www.ualberta.ca/~cssa    *
********==(*^_^*)==*********