schulze-vote 2.0.0 → 2.0.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/README.md +32 -6
- 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: e5f77a19b8cefd291c6e67c45a823eefe6164626
|
4
|
+
data.tar.gz: 3cf869a665b2dbc0a4e781cddaf4adb455d1fdc1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3e2582afe8d5fb85b18ca1ce4210b8efb7d72e0968e729ec2d5e42380a3aa8db2389b2836df424ef72c31aaf1e1d7c4d43ee7eb49b08bbb828294315a3436b92
|
7
|
+
data.tar.gz: a081d192a256023d18469f7c34d584e73739f827537ab49ed814842455d7f08b1a02eeb6d3fdbb91a1748efa9d22cecbe2e14b7444001e6e230fd90d3b0a160c
|
data/README.md
CHANGED
@@ -137,16 +137,42 @@ Output:
|
|
137
137
|
|
138
138
|
## Example
|
139
139
|
|
140
|
-
|
141
|
-
|
142
|
-
Example file under `examples/vote4.list`
|
140
|
+
https://en.wikipedia.org/wiki/User:MarkusSchulze/Schulze_method_examples
|
143
141
|
|
144
142
|
Result should be:
|
145
143
|
|
146
144
|
``` ruby
|
147
|
-
|
148
|
-
|
149
|
-
|
145
|
+
votestring = <<EOF
|
146
|
+
5=A;C;B;E;D
|
147
|
+
5=A;D;E;C;B
|
148
|
+
8=B;E;D;A;C
|
149
|
+
3=C;A;B;E;D
|
150
|
+
7=C;A;E;B;D
|
151
|
+
2=C;B;A;D;E
|
152
|
+
7=D;C;E;B;A
|
153
|
+
8=E;B;A;D;C
|
154
|
+
EOF
|
155
|
+
vs = SchulzeBasic.do votestring, 5
|
156
|
+
puts_m vs.vote_matrix
|
157
|
+
|
158
|
+
#=> [0, 20, 26, 30, 22]
|
159
|
+
[25, 0, 16, 33, 18]
|
160
|
+
[19, 29, 0, 17, 24]
|
161
|
+
[15, 12, 28, 0, 14]
|
162
|
+
[23, 27, 21, 31, 0]
|
163
|
+
|
164
|
+
puts_m vs.play_matrix
|
165
|
+
|
166
|
+
#=> [0, 28, 28, 30, 24]
|
167
|
+
[25, 0, 28, 33, 24]
|
168
|
+
[25, 29, 0, 29, 24]
|
169
|
+
[25, 28, 28, 0, 24]
|
170
|
+
[25, 28, 28, 31, 0]
|
171
|
+
|
172
|
+
puts vs.
|
173
|
+
|
174
|
+
expect(vs.ranks).to eq [3, 1, 2, 0, 4] # E > A > C > B > D
|
175
|
+
end
|
150
176
|
```
|
151
177
|
|
152
178
|
which is the same result of the reference above.
|