pub fn classify(&mut self, interarrival_time: f64, num_lost_packets: u32) -> PacketLoss {
        assert!(num_lost_packets > 0);

        if interarrival_time < self.interarrival_time_min {
            self.interarrival_time_min = interarrival_time;
        }

        let a = (num_lost_packets as f64 + self.lower_window_limit) * self.interarrival_time_min;
        let b = (num_lost_packets as f64 + self.upper_window_limit) * self.interarrival_time_min;

        if a <= interarrival_time && interarrival_time < b {
            PacketLoss::Wireless
        } else {
            PacketLoss::Congestion
        }
    }
/// Classifies if the `n` lost packets are lost due to congestion or wireless errors.
///
/// This function classifies the reason of packet loss between two consecutive packets
/// P(i) and P(i + n + 1) where the numbers inside the brackets correspond to some sequence
/// number.
/// Therefor this function should only be called if there has been more than one lost packet.
///
/// # Arguments
///
/// - `interarrival_time`: interarrival time between packet P(i) and packet P(i + n + 1).
/// - `num_lost_packets`: number of packets that have been lost.
Classifies if the `n` lost packets are lost due to congestion or wireless errors.
This function classifies the reason of packet loss between two consecutive packets
P(i) and P(i + n + 1) where the numbers inside the brackets correspond to some sequence
number.
Therefor this function should only be called if there has been more than one lost packet.
Classifies if the ` n ` lost packets are lost due to congestion or wireless errors . This function classifies the reason of packet loss between two consecutive packets P ( i ) and P ( i + n + 1 ) where the numbers inside the brackets correspond to some sequence number . Therefor this function should only be called if there has been more than one lost packet .
pub fn classify(&mut self, interarrival_time: f64, num_lost_packets: u32) -> PacketLoss {
        assert!(num_lost_packets > 0);
        if interarrival_time < self.interarrival_time_min {
            self.interarrival_time_min = interarrival_time;
        }
        let a = (num_lost_packets as f64 + self.lower_window_limit) * self.interarrival_time_min;
        let b = (num_lost_packets as f64 + self.upper_window_limit) * self.interarrival_time_min;
        if a <= interarrival_time && interarrival_time < b {
            PacketLoss::Wireless
        } else {
            PacketLoss::Congestion
        }
    }
pub fn classify ( & mut self , interarrival_time : f64 , num_lost_packets : u32 ) -> PacketLoss { assert ! ( num_lost_packets 0 ) ; if interarrival_time < self . interarrival_time_min { self . interarrival_time_min = interarrival_time ; } let a = ( num_lost_packets as f64 + self . lower_window_limit ) * self . interarrival_time_min ; let b = ( num_lost_packets as f64 + self . upper_window_limit ) * self . interarrival_time_min ; if a <= interarrival_time && interarrival_time < b { PacketLoss :: Wireless } else { PacketLoss :: Congestion } }
Classifies if the `n` lost packets are lost due to congestion or wireless errors.
Classifies if the ` n ` lost packets are lost due to congestion or wireless errors .
&mut self
interarrival_time
f64
interarrival time between packet P(i) and packet P(i + n + 1).
interarrival time between packet P ( i ) and packet P ( i + n + 1 ) .
num_lost_packets
u32
number of packets that have been lost.
number of packets that have been lost .