[ns] problem regarding Weibull distribution in ns
Geoffrey M. Garner
gmg1 at att.net
Wed Feb 25 11:27:38 PST 2004
Sandoche,
The usual cause of these warnings (at least, in my experience) is that the
respective variables are not initialized with
default values. The variables can be initialized by adding the following to
ns-default.tcl (for ns-2.26, this
is in ns-2.26/tcl/lib):
RandomVariable/Weibull set shape_ 0.3
RandomVariable/Weibull set scale_ 0.0085
(or whatever values you want to use as defaults)
After adding this, you need to run 'make' in the ns-2.26 directory.
I assume you have bound the "shape_" and "scale_" OTcl variables
to the respective C++ class variables (as explained in the ns-2 manual).
One minor question -- you indicated you added code to random.cc, random.h,
and rng.h.
I would have thought that much of the code would have been added to
ranvar.cc and ranvar.h, as that is where analogous code for the other
distributions is.
I hope this helps.
Regards,
Geoff Garner
gmg1 at att.net
----- Original Message -----
From: "sandoche balakrishnan" <sandoche2k2 at hotmail.com>
To: <ns-users at ISI.EDU>
Sent: Wednesday, February 25, 2004 11:18 AM
Subject: [ns] problem regarding Weibull distribution in ns
>
> hi all,
>
> I wanted to implement a "weibull distribution" for traffic
> generation. Eventhough its not already integrated with ns i got a sample
> code from the ns mailing list and added this code for "weibull
distribution"
> in files random.cc random.h and rng.h etc. I installed again ns and with
> some modifications in the code i was able to install ns again.
> Now in my otcl script which simulates my traffic generation i
> added like this
>
> set interArr_onPeriod [new RandomVariable/Weibull]
> $interArr_onPeriod set shape_ 0.3
> $interArr_onPeriod set scale_ 0.0085
> Eventhough the simulation works it gives a warning message
> saying
> "warning: no class variable RandomVariable/Weibull::shape_
> see tcl-object.tcl in tclcl for info about this warning.
> warning: no class variable RandomVariable/Weibull::scale_
> warning: no class variable RandomVariable/Weibull::shape_
> see tcl-object.tcl in tclcl for info about this warning.
>
> I am not sure whether the "weibull distribution" i have added is correct.
is
> there any other weibull distribution for ns, which works correctly. I
would
> be grateful for any info regarding this. Also is there any method to set
> parameters for the "shape" and "scale" parameter for the weibull
> distribution from an Empirical data.
>
> Thanks
> Sandoche
>
> _________________________________________________________________
> Contact brides & grooms FREE! http://www.shaadi.com/ptnr.php?ptnr=hmltag
> Only on www.shaadi.com. Register now!
>
More information about the Ns-users
mailing list