Download data/modules/process/random_delay.py from introvoyz041/FAS-Simulator: direct link, hf CLI and curl.
- Browser
- Download file 244 Bytes
-
https://huggingface.co/datasets/introvoyz041/FAS-Simulator/resolve/main/data/modules/process/random_delay.py
- Command line
-
hf download hf://datasets/introvoyz041/FAS-Simulator/data/modules/process/random_delay.py
-
curl -L -o random_delay.py https://huggingface.co/datasets/introvoyz041/FAS-Simulator/resolve/main/data/modules/process/random_delay.py
244 Bytes
| import random | |
| from numpy.random import normal | |
| def delay(duration, percentage_variation): | |
| stdev = percentage_variation / 100.0 * duration | |
| random_additive_noise = normal(0, stdev) | |
| return max(0, int(duration + random_additive_noise)) | |