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

Re: Error Model : 2state



Hi,

Let me say first that I'm not very familiar with errormodel
implementation in NS.  But a quick look in ns-errmodel.tcl reveals
that TwoStateMarkov is broken: there is argument mismatch in its init
instproc when it calls base class init, just like your trace shows.

Try changing the default instproc code to the following:

ErrorModel/TwoStateMarkov instproc init {rate unit trans} {
	# XXX trans isn't used!
	set rv0 [new RandomVariable/Exponential]
	set rv1 [new RandomVariable/Exponential]

	$self next $rv0 $rv1 $unit

	$rv0 set avg_ [lindex $rate 0]
	$rv1 set avg_ [lindex $rate 1]
}

and see what happens (naturally, you'll need to recompile ns).  Please
let me know if this fixes the problem.

BTW, from the code, the third parameter "trans" is not used, so don't
expect any changes when you play with it.

  -Yuri

Ketan Bajaj <[email protected]> writes:

> Hi !
> 
> I'm using ns-2.1b3, for experimenting with the snoop protocol. Snoop.tcl
> works fine with ErrorModel/Expo but on changing the option opt(em) to
> 2state, the ErrorModel/TwoStateMarkov causes problems.
> 
> I looked up the archives but didn't find any related information. 
> The error output is the following:
> 
> 
> 
> no value given for parameter "rv0" to "_o126"
>     (Object next line 1)
>     invoked from within
> "$self next"
>     (procedure "_o126" line 2)
>     (ErrorModel/TwoStateMarkov init line 2)
>     invoked from within
> "_o126 init 25 pkt {0.5 0.5}"
>     (Class create line 1)
>     invoked from within
> "ErrorModel/TwoStateMarkov create _o126 25 pkt {0.5 0.5}"
>     invoked from within
> "catch "$className create $o $args" msg"
>     (procedure "new" line 3)
>     invoked from within
> "new ErrorModel/TwoStateMarkov $rate $unit $trans"
> ....
> 
> 
> Kindly help me through this, if its been corrected in a later version of
> ns, do let me know ..
> 
> thanks,
> 
> ketan