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.

cdf(k)[source]

Cumulativ distribution function of the number of desynchronizations evaluated at k. In other words: P(number of desynchronization <= n):

Parameters:

k (int) – Number of collisions.

Returns:

P(number of desynchronization <= n)

Return type:

float in [0,1]

cdf_position()[source]

Indicate the position of the CDF in R+.

mass(k)[source]

Mass function of the number of number of desynchronization for each device evluated at k. In other words: P(number of desynchronization = n).

Parameters:

k (int) – Number of desynchronization.

Returns:

P(number of desynchronization = n)

Return type:

float in [0,1]

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_multin(N)[source]

N : nombre de messages

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

eigenvalues()[source]

Computes the eigenvalues to solve the recursive sequence.

mass(N)[source]

Mass function of the number of packet before desynchronization. In other words return P(desynchronization of N packets sent). :param N: Number of packets. :type N: int :return: P(desynchronization of N packets sent) :rtype: float in [0,1]

mean()[source]

Expectation of the number of packet sent before desynchronization computed using.

Returns:

E(D) where D is the number of packet sent before desynchronization.

Return type:

int

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]

cdf_position()[source]

Return the position of the CDF in R+. :return: (start, end) where cdf(start)=0.01 and cdf(end)=0.99. :rtype: flot in R+

Module contents

This packet contains utilities to study the odds of desynchronization in the sequential pseudonym scheme.