schulze-vote 2.0.1 → 2.0.2
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/README.md +18 -5
- 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: 006f9611d7d1ce402ba8a73529940c2917b1e19e
|
4
|
+
data.tar.gz: 93cb87c111879d5fa7279cbf5f8dbde945bbd028
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f0ab924ee00d937d049adfffaae4d0411e32074fe50614244c0591c342976b87de6af4a48a9de41b97865d7783fe229979117d31d361e7cfba16efb1faf25c3f
|
7
|
+
data.tar.gz: de2a95d3062b1d0523458e723009ec86ce88e1f085fa7b0eacfd031ff651b1582484b32d86ad4304db08d6ddead6ba29752ef3f806c14e82965ebed547418ee8
|
data/README.md
CHANGED
@@ -137,6 +137,8 @@ Output:
|
|
137
137
|
|
138
138
|
## Example
|
139
139
|
|
140
|
+
Example 1 from Wikipedia
|
141
|
+
|
140
142
|
https://en.wikipedia.org/wiki/User:MarkusSchulze/Schulze_method_examples
|
141
143
|
|
142
144
|
Result should be:
|
@@ -169,16 +171,27 @@ puts_m vs.play_matrix
|
|
169
171
|
[25, 28, 28, 0, 24]
|
170
172
|
[25, 28, 28, 31, 0]
|
171
173
|
|
172
|
-
puts vs.
|
174
|
+
puts vs.winners_array.to_s
|
175
|
+
|
176
|
+
#=> [0, 0, 0, 0, 1]
|
177
|
+
|
178
|
+
puts_m vs.result_matrix
|
173
179
|
|
174
|
-
|
175
|
-
|
180
|
+
#=> [0, 1, 1, 1, 0]
|
181
|
+
[0, 0, 0, 1, 0]
|
182
|
+
[0, 1, 0, 1, 0]
|
183
|
+
[0, 0, 0, 0, 0]
|
184
|
+
[1, 1, 1, 1, 0]
|
185
|
+
|
186
|
+
vs.classifications.each do |classification|
|
187
|
+
puts classification.map { |e| idx_to_chr(e) }.to_s
|
188
|
+
end
|
189
|
+
|
190
|
+
#=> ["E", "A", "C", "B", "D"]
|
176
191
|
```
|
177
192
|
|
178
193
|
which is the same result of the reference above.
|
179
194
|
|
180
|
-
The result strings are always in format `Candidate:Position`, because it's possible that multiple candidates can be on the same rank.
|
181
|
-
|
182
195
|
## Contributing to schulze-vote
|
183
196
|
|
184
197
|
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
|