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

MultiState Error Model Changes




Here are the changes to MultiState Error Model to transition between error
states based on the time spent in the current state.

Eddie


Diff files included (diffs.tar): (delta May 7, 98 daily)
- diff errmodel.cc errmodel.cc.org > errmodel.cc.diff
- diff errmodel.h errmodel.h.org > errmodel.h.diff
- diff ns-default.tcl ns-default.tcl.org > ns-default.tcl.diff
- diff ns-errmodel.tcl ns-errmodel.tcl.org > ns-errmodel.tcl.diff

Modified files included (files.tar)
- errmodel.cc
- errmodel.h
- ns-default.tcl
- ns-errmodel.tcl


MultiState ErrorModel

Time-based error state transitions: Transitions to the next 
error state at the end of the current state's period. The
next error state is then selected as before, using the 
transition state model matrix.

To select time-based transitions, set sttype to 'time'; otherwise
set sttype to 'pkt' to bypass time-based transition function.

MultiState/ErrorModel argument list (added periods and sttype):
- states: an array of states (error models)
- periods: an array of state durations
- trans: the transition state model matrix
- transunit: is pkt/byte/time
- sttype: type of state transitions to use, time/pkt
- nstates: number of states
- start: the start state

A script fragment is listed below to show how to create a 
multistate error model object. The fragment can be inserted
in Mr. Haobo Yu's script for using NS's error model. (See
Simulator instproc insert-loss {} in Mr. Yu's script).

set tmp [new ErrorModel/Uniform 0 pkt]
set tmp1 [new ErrorModel/Uniform .9 pkt]
set tmp2 [new ErrorModel/Uniform .5 pkt]

# Array of states (error models)
set m_states [list $tmp $tmp1 $tmp2]
# Durations for each of the states,
# tmp, tmp1, and tmp2, respectively
set m_periods [list 0 .0075 .00375]
# Transition state model matrix
set m_transmx { {0.95 0.05 0}
                {0   0   1}
                {1   0   0} }
set m_trunit pkt
# Use time-based transition
set m_sttype time
set m_nstates 3
set m_nstart [lindex $m_states 0]

set em [new ErrorModel/MultiState $m_states $m_periods $m_transmx \
	$m_trunit $m_sttype $m_nstates $m_nstart]

diffs.tar