projects
/
BK-2020-03.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
style(unitproc/../sleepRand.py):Move output spread adj to top
[BK-2020-03.git]
/
unitproc
/
python
/
sleepRand.py
diff --git
a/unitproc/python/sleepRand.py
b/unitproc/python/sleepRand.py
index 27e98d7d520b0ac511c413145e98814c949ba649..3454d244359baddb01a24a7b3826e141f5978005 100755
(executable)
--- a/
unitproc/python/sleepRand.py
+++ b/
unitproc/python/sleepRand.py
@@
-1,6
+1,6
@@
#!/usr/bin/env python3
# Desc: Pauses a random amount of time. Random distribution is inverse gaussian.
#!/usr/bin/env python3
# Desc: Pauses a random amount of time. Random distribution is inverse gaussian.
-# Version: 0.0.
2
+# Version: 0.0.
3
# Depends: python 3.7.3
# Usage: ./sleepRand.py arg1
# Input: arg1: float seconds (mean of inverse gaussian distribution)
# Depends: python 3.7.3
# Usage: ./sleepRand.py arg1
# Input: arg1: float seconds (mean of inverse gaussian distribution)
@@
-8,6
+8,9
@@
import math, time, random, sys
import math, time, random, sys
+# Adjustments
+lambdaFactor = 4; # spread factor; inversely proportional to variance
+
# Define functions
def randInvGau(mu, lam):
"""Returns random variate of inverse gaussian distribution"""
# Define functions
def randInvGau(mu, lam):
"""Returns random variate of inverse gaussian distribution"""
@@
-32,9
+35,6
@@
def randInvGau(mu, lam):
arg1 = float(sys.argv[1]); # first argument
desMean = arg1;
arg1 = float(sys.argv[1]); # first argument
desMean = arg1;
-# Configure
-lambdaFactor = 4; # spread factor; inversely proportional to variance
-
# Calculate delay
delay = randInvGau(desMean, desMean * lambdaFactor);
#print('DEBUG:delay:' + str(float(delay)));
# Calculate delay
delay = randInvGau(desMean, desMean * lambdaFactor);
#print('DEBUG:delay:' + str(float(delay)));