dice_stats 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/Dice_Set.rb +7 -2
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 49cf8ee02d9aa7ef9ee4abb3688726b713c9224b
|
|
4
|
+
data.tar.gz: 650b608be6c55f0265820eff8422763e551ea977
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 64229f6e1210d768cd6a78a718ec03e65ac71f4f58b673426f31b61a7f15fb557e887b510224ae1bd50905505d9a1af3d805c6c6456f261cca3bdff4fbb6dc4e
|
|
7
|
+
data.tar.gz: e8552eaa73ee3f102e87f6a6325f1517da34f00d38862a6ca48a23718530645121338eb31f6941a2ff2581c1a107db3de4d0158ec66b49463f0c563d0a17d8ee
|
data/lib/Dice_Set.rb
CHANGED
|
@@ -174,8 +174,7 @@ module Dice_Stats
|
|
|
174
174
|
##
|
|
175
175
|
# Instantiates and returns a Filtered_distribution. See the documentation for Filtered_distribution.rb.
|
|
176
176
|
def p
|
|
177
|
-
|
|
178
|
-
filtered_distribution = Internal_Utilities::Filtered_distribution.new(weighted_prob_dist)
|
|
177
|
+
filtered_distribution = Internal_Utilities::Filtered_distribution.new(adjusted_distribution)
|
|
179
178
|
return filtered_distribution
|
|
180
179
|
end
|
|
181
180
|
|
|
@@ -184,5 +183,11 @@ module Dice_Stats
|
|
|
184
183
|
def too_complex?
|
|
185
184
|
@aborted_probability_distribution
|
|
186
185
|
end
|
|
186
|
+
|
|
187
|
+
##
|
|
188
|
+
# Add the constant the the probability distribution, useful for printing / output purposes
|
|
189
|
+
def adjusted_distribution
|
|
190
|
+
@probability_distribution.inject(Hash.new) { |m,(k,v)| m[k+@constant] = v; m }
|
|
191
|
+
end
|
|
187
192
|
end
|
|
188
193
|
end
|