schulze-vote 2.0.0 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +32 -6
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 221e6311ce305a77a33a9058a5ef6224c301315e
4
- data.tar.gz: 076a63071dd29cad6aec5882a683ea1add159a2f
3
+ metadata.gz: e5f77a19b8cefd291c6e67c45a823eefe6164626
4
+ data.tar.gz: 3cf869a665b2dbc0a4e781cddaf4adb455d1fdc1
5
5
  SHA512:
6
- metadata.gz: 1fc77d9b40c113494e9b9a96f6febdef044d1a90d835247388874790b99f58b7c98b02f3bcfb436e12c257575b6fdd178a728f06d31b981cce0e44ebdc93e1ef
7
- data.tar.gz: ac7f6916c5b290e623a299221b11fef0289200edd62a6025d9b9174db1e7cab017c90c73a874ddbd7318919a7e0cf62f49f8452a28792d1db6a0ff163daef65f
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
- Reference calculation: [Schulze Methode | blog.cgiesel.de (german)](http://blog.cgiesel.de/schulze-methode/)
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
- sb = SchulzeBasic.do File.open('../examples/vote4.list')
148
- sb.rank_abc
149
- #=> ["C:1", "D:2", "B:3", "A:4"]
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.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: schulze-vote
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alessandro Rodi