pub type DuplicatePattern = Vec<f64>;
Expand description
The duplicate_pattern describes how the packets are duplicated.
The duplicate_pattern is a sequence of conditional probabilities describing how packets are duplicated. The probability is a f64 between 0 and 1.
The meaning of the duplicate_pattern sequence is:
- The probability on index 0 describes how likely a packet will be duplicated if the previous packet was transmitted normally.
- The probability on index 1 describes how likely a packet will be duplicated if the previous packet was duplicated.
- …
For example, if the duplicate_pattern is [0.8, 0.1], and packet 100 is not duplicated, then the probability of packet 101 being duplicated is 0.8.
If the packet 101 is duplicated, the the probability of packet 102 being duplicated is 0.1; if the packet 101 is not duplicated, then the probability of packet 102 being duplicated is still 0.8.
If both packet 101 and 102 were duplicated, then the probability of packet 103 being duplicated is still 0.1, and as long as the packets were duplicated, the probability of the next packet being duplicated is always the last element - in this case, 0.1.
Aliased Type§
pub struct DuplicatePattern { /* private fields */ }