Skip to main content

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)

Source distribution for neslab-find 0.0.4
File Size Uploaded
neslab-find-0.0.4.tar.gz 5.5 kB Details

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

Release history Release notifications | RSS feed

This release

0.0.4 This release

1 release file

0.0.2

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page