FIND model
This directory provides a Python implementation of the FIND model and protocol.
The provided code allows to calculate the probability for each node in a clique to become active in any slot, the probability for any individual link to be discovered in any slot as well as the network discovery latency.
Installation
Depending on your setup, install the python package together with the requirements for the examples using
pipenv install neslab.find[examples]
or
pip install neslab.find[examples]
Usage
Instantiate the model with a uniform distribution with scale 10 and three nodes with charging times of 100, 125 and 200 that become active for the first time without an offset:
import matplotlib.pyplot as plt
from neslab.find import Model
m = Model(10, "Uniform", [100, 125, 200], offset=0)
Compute for every node the probability of being active in a slot and plot the results:
act = m.activity()
plt.plot(act[:2000])
plt.show()
Compute the cumulative distribution function (cdf) of the slot in which each of the three links between the three nodes is discovered and plot the results:
cdfs = m.cdf()
plt.plot(cdfs)
plt.show()
Compute the fraction of discovered links and plot the result:
dff = m.disco_frac()
plt.plot(dff)
plt.show()
Compute the discovery latency:
lat = m.disco_latency())
print(f"Discovery latency: {lat} slots")
Examples
We provide more involved example scripts in the examples directory:
To compare the probability of activity and the cdf of the corresponding discovery latency of two nodes with a charging time of 30 and 60 slots, using a uniform delay distribution, call
python examples/plot_example.py
To compare the discovery latency of two nodes when using different distributions across a range of their scale parameters, run
python examples/compare_dists.py
To plot the discovery latency of a clique of nodes over the node density, run
python examples/plot_density.py
To optimize the scale parameter of the geometric distribution to a range of charging times, run
python examples/optimize_scale.py
Reproduce key results
We used the code provided in this directory to gain the insights presented in section 2 of our paper. We invite you to reproduce our results with the scripts provided in the reproducibility directory. Some of the calculations take significant computing resources and require a high performance computing system with a large number of CPUs.
Metadata
Release files for neslab-find 0.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| neslab-find-0.0.4.tar.gz | 5.5 kB | Without provenance | Details for neslab-find-0.0.4.tar.gz |
Release files / neslab-find-0.0.4.tar.gz
| Download URL | neslab-find-0.0.4.tar.gz |
|---|---|
| Size | 5.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b9c5a2b885d4464852b84c219c4587a361e41c4df5fedd89234875c4a4b508e9
|
|
BLAKE2b-256 checksum How to use checksums |
272cdb3622c142777b1a2c99ac219135adcacb37fef3edb00d7947e711ab2633
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/54.0.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.6.7
|
Security for neslab-find 0.0.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.