2021-01-05 19:47:07 +11:00
|
|
|
<!--
|
|
|
|
pyRCV2: Preferential vote counting
|
|
|
|
Copyright © 2020–2021 Lee Yingtong Li (RunasSudo)
|
|
|
|
|
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU Affero General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU Affero General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Affero General Public License
|
|
|
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
-->
|
2020-10-18 18:58:24 +11:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<meta charset="utf-8">
|
|
|
|
<title>pyRCV2</title>
|
2021-01-05 19:47:07 +11:00
|
|
|
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.1/normalize.min.css" integrity="sha512-NhSC1YmyruXifcj/KFRWoC561YpHpc5Jtzgvbuzx5VozKpWvQ+4nXhPdFgmx8xqexRcpAglTj9sIBWINXa8x5w==" crossorigin="anonymous" />
|
|
|
|
<link rel="stylesheet" type="text/css" href="main.css?v=GITVERSION">
|
2020-10-18 18:58:24 +11:00
|
|
|
</head>
|
|
|
|
<body>
|
2021-01-05 01:59:24 +11:00
|
|
|
<div class="menudiv">
|
2020-10-18 18:58:24 +11:00
|
|
|
<input type="file" id="bltFile">
|
|
|
|
<button onclick="clickCount()">Count</button>
|
|
|
|
<label>
|
|
|
|
Preset:
|
|
|
|
<select id="selPreset" onchange="changePreset()">
|
|
|
|
<option value="scottish" selected>Scottish STV</option>
|
2021-01-04 02:45:24 +11:00
|
|
|
<!--<option value="stvc">pyRCV STV-C</option>-->
|
2020-12-30 02:33:09 +11:00
|
|
|
<option value="senate">Australian Senate STV</option>
|
2020-10-18 21:47:59 +11:00
|
|
|
<option value="wright">Wright STV</option>
|
2020-12-27 21:25:40 +11:00
|
|
|
<option value="prsa77">PRSA 1977</option>
|
2021-01-01 22:26:57 +11:00
|
|
|
<option value="ers97">ERS97</option>
|
2020-10-18 18:58:24 +11:00
|
|
|
</select>
|
|
|
|
</label>
|
|
|
|
<button id="btnAdvancedOptions" onclick="clickAdvancedOptions()">Show advanced options</button>
|
2020-12-27 21:25:40 +11:00
|
|
|
<!--GITREV-->
|
2020-12-24 21:33:09 +11:00
|
|
|
<a href="https://yingtongli.me/blog/2020/12/24/pyrcv2.html">Information and instructions</a>
|
2020-10-18 18:58:24 +11:00
|
|
|
</div>
|
|
|
|
|
2021-01-05 01:59:24 +11:00
|
|
|
<div id="divAdvancedOptions" class="menudiv" style="display: none;">
|
2021-01-05 20:28:31 +11:00
|
|
|
<label class="padafter">
|
2021-01-01 22:26:57 +11:00
|
|
|
Numbers:
|
|
|
|
<select id="selNumbers">
|
|
|
|
<option value="native">Native</option>
|
|
|
|
<option value="rational">Rational</option>
|
|
|
|
<option value="fixed" selected>Fixed</option>
|
|
|
|
</select>
|
|
|
|
</label>
|
|
|
|
<label>
|
|
|
|
Decimal places (if Numbers = Fixed):
|
|
|
|
<input type="number" id="txtDP" value="5" style="width: 3em;">
|
|
|
|
</label>
|
|
|
|
<br>
|
2020-10-18 18:58:24 +11:00
|
|
|
<label>
|
|
|
|
Quota:
|
|
|
|
<select id="selQuotaCriterion">
|
|
|
|
<option value="geq" selected>>=</option>
|
|
|
|
<option value="gt">></option>
|
|
|
|
</select>
|
|
|
|
</label>
|
|
|
|
<label>
|
|
|
|
<select id="selQuota">
|
|
|
|
<option value="droop" selected>Droop</option>
|
|
|
|
<option value="droop_exact">Droop (exact)</option>
|
|
|
|
<option value="hare">Hare</option>
|
|
|
|
<option value="hare_exact">Hare (exact)</option>
|
|
|
|
</select>
|
|
|
|
</label>
|
2021-01-05 20:28:31 +11:00
|
|
|
<label class="padafter">
|
2021-01-01 22:26:57 +11:00
|
|
|
<select id="selQuotaMode">
|
|
|
|
<option value="static" selected>Static quota</option>
|
|
|
|
<option value="progressive">Progressive quota</option>
|
|
|
|
<option value="ers97">Static with ERS97 rules</option>
|
|
|
|
</select>
|
2020-10-18 18:58:24 +11:00
|
|
|
</label>
|
2021-01-05 20:28:31 +11:00
|
|
|
<label class="padafter">
|
2020-12-27 18:27:41 +11:00
|
|
|
<input type="checkbox" id="chkBulkElection" checked>
|
|
|
|
Bulk election
|
|
|
|
</label>
|
2021-01-05 20:28:31 +11:00
|
|
|
<label class="padafter">
|
2020-10-18 18:58:24 +11:00
|
|
|
<input type="checkbox" id="chkBulkExclusion">
|
2021-01-01 22:26:57 +11:00
|
|
|
Bulk exclusion
|
|
|
|
</label>
|
2021-01-05 20:28:31 +11:00
|
|
|
<label class="padafter">
|
2021-01-01 22:26:57 +11:00
|
|
|
<input type="checkbox" id="chkDeferSurpluses">
|
|
|
|
Defer surpluses
|
2020-10-18 18:58:24 +11:00
|
|
|
</label>
|
|
|
|
<br>
|
|
|
|
<label>
|
2021-01-01 22:26:57 +11:00
|
|
|
<input type="checkbox" id="chkRoundQuota" checked>
|
|
|
|
Round quota to
|
2020-10-18 18:58:24 +11:00
|
|
|
</label>
|
2021-01-05 20:28:31 +11:00
|
|
|
<label class="padafter">
|
2021-01-05 19:47:07 +11:00
|
|
|
<input type="number" id="txtRoundQuota" value="0" min="0" style="width: 3em;">
|
2021-01-01 22:26:57 +11:00
|
|
|
d.p.
|
2020-10-18 18:58:24 +11:00
|
|
|
</label>
|
2021-01-03 01:23:11 +11:00
|
|
|
<label>
|
|
|
|
<input type="checkbox" id="chkRoundVotes">
|
|
|
|
Round votes to
|
|
|
|
</label>
|
2021-01-05 20:28:31 +11:00
|
|
|
<label class="padafter">
|
2021-01-05 19:47:07 +11:00
|
|
|
<input type="number" id="txtRoundVotes" value="0" min="0" style="width: 3em;">
|
2021-01-03 01:23:11 +11:00
|
|
|
d.p.
|
|
|
|
</label>
|
2021-01-01 22:26:57 +11:00
|
|
|
<label>
|
|
|
|
<input type="checkbox" id="chkRoundTVs">
|
|
|
|
Round transfer values to
|
|
|
|
</label>
|
2021-01-05 20:28:31 +11:00
|
|
|
<label class="padafter">
|
2021-01-05 19:47:07 +11:00
|
|
|
<input type="number" id="txtRoundTVs" value="0" min="0" style="width: 3em;">
|
2021-01-01 22:26:57 +11:00
|
|
|
d.p.
|
|
|
|
</label>
|
2021-01-03 01:23:11 +11:00
|
|
|
<label>
|
|
|
|
<input type="checkbox" id="chkRoundWeights">
|
|
|
|
Round ballot weights to
|
|
|
|
</label>
|
|
|
|
<label>
|
2021-01-05 19:47:07 +11:00
|
|
|
<input type="number" id="txtRoundWeights" value="0" min="0" style="width: 3em;">
|
2021-01-03 01:23:11 +11:00
|
|
|
d.p.
|
|
|
|
</label>
|
2020-10-18 18:58:24 +11:00
|
|
|
<br>
|
2021-01-05 20:28:31 +11:00
|
|
|
<label class="padafter">
|
2020-10-18 18:58:24 +11:00
|
|
|
Surplus order:
|
|
|
|
<select id="selSurplus">
|
|
|
|
<option value="size" selected>By size</option>
|
|
|
|
<option value="order">By order</option>
|
|
|
|
</select>
|
|
|
|
</label>
|
|
|
|
<label>
|
2020-10-18 21:47:59 +11:00
|
|
|
Method:
|
2020-10-18 18:58:24 +11:00
|
|
|
<select id="selTransfers">
|
|
|
|
<option value="wig" selected>Weighted inclusive Gregory</option>
|
|
|
|
<option value="uig">Unweighted inclusive Gregory</option>
|
2020-12-29 02:43:37 +11:00
|
|
|
<option value="eg">Exclusive Gregory (last bundle)</option>
|
2020-10-18 21:47:59 +11:00
|
|
|
<option value="wright">Wright STV</option>
|
2020-10-18 18:58:24 +11:00
|
|
|
</select>
|
|
|
|
</label>
|
2021-01-05 20:28:31 +11:00
|
|
|
<label class="padafter">
|
2020-12-29 02:43:37 +11:00
|
|
|
<select id="selPapers">
|
|
|
|
<option value="both" selected>Include non-transferable papers</option>
|
|
|
|
<option value="transferable">Use transferable papers only</option>
|
|
|
|
</select>
|
|
|
|
</label>
|
|
|
|
<label>
|
2021-01-05 20:28:31 +11:00
|
|
|
Exclusion:
|
2020-12-29 02:43:37 +11:00
|
|
|
<select id="selExclusion">
|
|
|
|
<option value="one_round" selected>Exclude in one round</option>
|
|
|
|
<option value="parcels_by_order">Exclude by parcel (by order)</option>
|
2020-12-31 16:43:50 +11:00
|
|
|
<!--<option value="parcels_by_value">Exclude by parcel (by value)</option>-->
|
|
|
|
<option value="by_value">Exclude by value</option>
|
2021-01-03 18:57:56 +11:00
|
|
|
<option value="wright">Wright method (re-iterate)</option>
|
2020-12-29 02:43:37 +11:00
|
|
|
</select>
|
|
|
|
</label>
|
2020-10-18 18:58:24 +11:00
|
|
|
<br>
|
2021-01-05 20:28:31 +11:00
|
|
|
<label class="padafter">
|
2020-12-24 00:04:30 +11:00
|
|
|
Ties:
|
2020-10-18 18:58:24 +11:00
|
|
|
<select id="selTies">
|
2020-12-24 01:36:39 +11:00
|
|
|
<option value="backwards_random" selected>Backwards then random</option>
|
2021-01-05 01:27:30 +11:00
|
|
|
<option value="forwards_random">Forwards then random</option>
|
2020-10-18 18:58:24 +11:00
|
|
|
<option value="random">Random</option>
|
2020-12-27 23:28:16 +11:00
|
|
|
<option value="prompt">Prompt</option>
|
2020-10-18 18:58:24 +11:00
|
|
|
</select>
|
|
|
|
</label>
|
|
|
|
<label>
|
|
|
|
Random seed:
|
2020-12-24 00:04:30 +11:00
|
|
|
<input type="text" id="txtSeed" value="">
|
2020-10-18 18:58:24 +11:00
|
|
|
</label>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<table id="result"></table>
|
|
|
|
|
2020-12-24 20:23:55 +11:00
|
|
|
<script src="vendor/BigInt_BigRat-a5f89e2.min.js"></script>
|
2020-12-31 16:44:17 +11:00
|
|
|
<script src="vendor/big-6.0.0.min.js"></script>
|
|
|
|
<script src="vendor/sjcl-1.0.8.min.js"></script>
|
2021-01-05 19:47:07 +11:00
|
|
|
<script src="bundle.js?v=GITVERSION"></script>
|
|
|
|
<script src="index.js?v=GITVERSION"></script>
|
2020-10-18 18:58:24 +11:00
|
|
|
</body>
|
|
|
|
</html>
|