Max*_*sky 16 .net c# voting openstv
在看到最新的SO博客帖子后,我刚刚下载了OpenSTV,关于主持人选举的结果.杰夫写道,他使用OpenSTV进行选举,并提供了一张包含投票数据的投票文件(.blt).
我的问题是:你如何在C#中创建.BLT文件?
以下两种方式我可以想到投票页面是这样做的:
我有兴趣了解两种可能性如何工作以及如何在C#中实现这一点.提前致谢.哦,我希望杰夫看到这个问题,因为他可能会有一个很好的答案......
Jef*_*ood 24
BLT文件格式的最佳解释如下:
4 2 # four candidates are competing for two seats
-2 # Bob has withdrawn (optional)
1 4 1 3 2 0 # first ballot
1 2 4 1 3 0
1 1 4 2 3 0 # The first number is the ballot weight (>= 1).
1 1 2 4 3 0 # The last 0 is an end of ballot marker.
1 1 4 3 0 # Numbers in between correspond to the candidates
1 3 2 4 1 0 # on the ballot.
1 3 4 1 2 0
1 3 4 1 2 0 # Chuck, Diane, Amy, Bob
1 4 3 2 0
1 2 3 4 1 0 # last ballot
0 # end of ballots marker
"Amy" # candidate 1
"Bob" # candidate 2
"Chuck" # candidate 3
"Diane" # candidate 4
"Gardening Club Election" # title
我所做的只是