spistats.collision package¶
Module contents¶
This module defines an interface to the probability law of the number of collisions per packet sent in a sequential pseudonyms scheme.
- class spistats.collision.Collision(nbr_dev, nbr_adr, adr_per_dev)[source]¶
Bases:
object
Probabaility law of the number of collisions in function of various network parameters.
- __init__(nbr_dev, nbr_adr, adr_per_dev)[source]¶
- Parameters:
nbr_dev (int) – Number of devices in the network.
nbr_adr (int) – Number of addresses to chose from. For instance an 8 bit scheme has 2**8 addresses.
adr_per_dev (int) – Number of pseudonymes maintained by each device.
- cdf(n)[source]¶
Cumulativ distribution function of the number of collision evaluated at n. In other words: P(number of collision <= n):
- Parameters:
n (int) – Number of collisions.
- Returns:
P(number of collision <= n)
- Return type:
float in [0,1]
- cdfinv(p)[source]¶
Inverse function of the cdf. This function return n such that P(number of collision <= n) = p
- Parameters:
p (float in [0,1]) – Probability that the number of collisions is lesser or equal than n.
- Returns:
n such that P(number of collision <= n) = p.
- Return type:
int