Page 1 of 1

Implement Instant Runoff voting for polls [paid code]

Posted: Thu Jun 30, 2016 12:08 am
by oranges
So lets try this again

I need an instant runoff voting implementation built into our poll system:
https://en.wikipedia.org/wiki/Instant-runoff_voting

Implementation
Randomly sort ballot per user to avoid the people who just rank things in order out of lazyness

User ranks each item from 1 - N where N is the max

results should be hidden until an appropriately ranked user allows calculation

votes from accounts with connections less than y and account age less than x should be ignored

x and y should of course be config options

Comment if you're interested in

oh also payment is 200usd, via paypal or some other means (amazon voucher?)

Re: Implement Instant Runoff voting for polls [paid code]

Posted: Thu Jun 30, 2016 12:14 am
by oranges
just to clarify how the voting mechanic should work

tally all voters first choice - if no one has majority (configurable, maybe 85%?) eliminate the lowest ranked candidate
tally voters choices using second choice for voters who's first choice candidate was chosen
if no majority eliminate someone again

repeat until someone has majority.

Re: Implement Instant Runoff voting for polls [paid code]

Posted: Thu Jun 30, 2016 12:15 am
by oranges
it's arguable but I think we should let people leave some entries blank, if all their ranked choices are gone then their vote will just be discounted.

Re: Implement Instant Runoff voting for polls [paid code]

Posted: Thu Jun 30, 2016 12:26 am
by Incoming
Well expecting people to rank a field of 30 is a bit much, people would just give up.

Re: Implement Instant Runoff voting for polls [paid code]

Posted: Thu Jun 30, 2016 1:45 am
by oranges
https://github.com/RemieRichards/-tg-st ... db1da6ab90

remie was kind enough to implement the basics of the system and then wouldn't implement any more so you can build on that.

Re: Implement Instant Runoff voting for polls [paid code]

Posted: Thu Jun 30, 2016 10:25 am
by Jordie0608
I'm going to try and finish this, however I won't be doing much until after the 2nd, so it won't be ready by the time our elections start (not that I'd do it in a day anyway).

Re: Implement Instant Runoff voting for polls [paid code]

Posted: Tue Jul 05, 2016 5:34 pm
by MrStonedOne
I'll have something up for this by the end of the day.

Re: Implement Instant Runoff voting for polls [paid code]

Posted: Wed Jul 06, 2016 1:24 am
by MrStonedOne
https://github.com/tgstation/tgstation/pull/19153


This adds the game code to track the votes.

The code to calculate it will be done later, and most likely in php. I'll release it into the site repo once its coded.