From 7ad142f19dbf6dddb0a5372da4d89b75e972223b Mon Sep 17 00:00:00 2001 From: RunasSudo Date: Sun, 27 Dec 2020 23:28:16 +1100 Subject: [PATCH] Implement prompting for ties --- docs/options.md | 2 +- html/index.html | 1 + html/index.js | 38 +++++++----- html/worker.js | 150 ++++++++++++++++++++++++++++-------------------- pyRCV2/ties.py | 34 +++++++---- 5 files changed, 135 insertions(+), 90 deletions(-) diff --git a/docs/options.md b/docs/options.md index 631403f..3965293 100644 --- a/docs/options.md +++ b/docs/options.md @@ -82,7 +82,7 @@ This dropdown allows you to select how ties (in surplus transfer or exclusion) a * Backwards: Ties are broken according to which tied candidate had the most/fewest votes at the end of the last stage where one tied candidate had more/fewer votes than the others, if such a stage exists. * Random: Ties are broken at random (see *Random seed*). -* Prompt: The user is prompted to break the tie. This option is not available in the web application. +* Prompt: The user is prompted to break the tie. Multiple tie breaking methods can be specified. If the first method cannot resolve the tie, the next is tried, and so on. In the web application, 2 options are available (‘Backwards then random’ and ‘Random’). On the Python command line, the `--ties` option can be specified multiple times (e.g. `--ties backwards --ties random`). diff --git a/html/index.html b/html/index.html index ad2246a..8a3783d 100644 --- a/html/index.html +++ b/html/index.html @@ -115,6 +115,7 @@