random_variates 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/random_variates.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ad1287c49c9f598c3134d80f618d0b06f3b1460cd3f994e4fca651b63288c7e7
|
4
|
+
data.tar.gz: 0e20a01d8dd315c5efbc53786c46e057cebaccf4d2b9b89383f552489ea10f91
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6e016c6d0cd2a78cef0370e012a1626cc3fb10164deb23e7d76024526210b0865da56bcfc9bbda8b190bead7c32fb18e671a3dce2370b7ac29dc17af47c7d006
|
7
|
+
data.tar.gz: 9b9966f833c456c1bdee865380fe74b8fbe93b58f3273d13e430cace05b2b38e40223f7dcb66902ce2e231d9c7526f03727fdbee58c2d93a08fcdecf348dbf9e
|
data/lib/random_variates.rb
CHANGED
@@ -79,9 +79,9 @@ class Triangle
|
|
79
79
|
loop do
|
80
80
|
u = rng.next
|
81
81
|
if u < crossover_p
|
82
|
-
yielder << min + Math.sqrt(range * (mode - min) * u)
|
82
|
+
yielder << min + Math.sqrt(@range * (mode - min) * u)
|
83
83
|
else
|
84
|
-
yielder << max - Math.sqrt(range * (max - mode) * (1.0 - u))
|
84
|
+
yielder << max - Math.sqrt(@range * (max - mode) * (1.0 - u))
|
85
85
|
end
|
86
86
|
end
|
87
87
|
end
|