Type Alias LossPattern

Source
pub type LossPattern = Vec<f64>;
Expand description

The loss_pattern describes how the packets are dropped when going through.

The loss_pattern is a sequence of conditional probabilities describing how packets are dropped. The probability is a f64 between 0 and 1.

The meaning of the loss_pattern sequence is as follows:

  • The probability on index 0 describes how likely a packet will be dropped if the previous packet was not lost.
  • The probability on index 1 describes how likely a packet will be dropped if the previous packet was lost.
  • The probability on index 2 describes how likely a packet will be dropped if the previous 2 packet was lost.

For example, if the loss_pattern is [0.1, 0.2], and packet 100 is not lost, then the probability of packet 101 being lost is 0.1.

If the packet 101 is lost, then the probability of packet 102 being lost is 0.2. If the packet 101 is not lost, then the probability of packet 102 being lost is still 0.1.

Aliased Type§

pub struct LossPattern { /* private fields */ }