spistats.desynchronization package¶
Submodules¶
spistats.desynchronization.dsync_count module¶
This module contains an interfaces to the probability law of the number of desynchronization of one device when sending n packets.
- class spistats.desynchronization.dsync_count.NumberOfDsync(p, m, n)[source]¶
Bases:
object
Probability law of the number of desynchronization of one device when sending n packets.
- __init__(p, m, n)[source]¶
- Parameters:
p (float in [0,1]) – Probability of packet loss.
m (int) – Size of the list of indentifiers maintained by each device.
n (int) – Number of packet recived by the device.
spistats.desynchronization.law module¶
This module defnies an interface to the probability law of the number of packet sent by a device befor desynchronization when using the sequential pseudonym scheme.
- class spistats.desynchronization.law.Law(p, m)[source]¶
Bases:
object
Probability law of the number of packet sent by a device dbefore desynchronization.
- __init__(p, m)[source]¶
- Parameters:
p (float in [0,1]) – Probability to lose connection.
m (int) – Number of pseudonyms maintained by the device.
- cdf(N)[source]¶
Cumulative distribution function of the number of packet before desynchronization. In other words return P(send less than N packets beforedesynchronization).
- Parameters:
N (int) – number of packets.
- Returns:
P(send less than N packets beforedesynchronization).
- Return type:
float in [0,1]
- cdf_inv(s)[source]¶
Inverse cumulative distribution function.
- Parameters:
s (float in [0,1]) – Probability that the number of packet sent before desynchronization is at most N
- Returns:
Return N such that P(send less than N packets beforedesynchronization) = N.
- Return type:
int
- cdf_position()[source]¶
Return the position of the cumulative distribution function.
- Returns:
(start, end) such that the cumulative distribution function is greater than 0.01 after start and less than 0.99 after end.
- Return type:
tuple of floats
spistats.desynchronization.law_multi module¶
This module defines an interface for the probability law of the number of packet before desynchronization when the probability to lose connection varies from a device to another.
- class spistats.desynchronization.law_multi.Law_multip(p, m)[source]¶
Bases:
object
probability law of the number of packet before desynchronization when the probability to lose connection varies from a device to another.
- __init__(p, m)[source]¶
- Parameters:
p (float in [0,1]) – Probability for a divice to lose connection.
m – Number of addresses per in each list managed by the devices.
:type m :int
- cdf(n)[source]¶
Cumulativ distribution function of the number of packets before desynchronization. In other words: P(number of packets before desynchronization <= n):
- Parameters:
n (int) – Number of packets before desynchronization.
- Returns:
P(number of pakets before desynchronization <= n)
- Return type:
float in [0,1]
Module contents¶
This packet contains utilities to study the odds of desynchronization in the sequential pseudonym scheme.