Skip to content

Commit

Permalink
Urn samplers for approval ballots
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon-Rey committed Mar 7, 2024
1 parent 0be75ec commit 29261d7
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 31 deletions.
8 changes: 4 additions & 4 deletions docs-source/source/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,10 @@ Reference: :py:mod:`prefsampling.approval`
- | :code:`rel_num_approvals`
| :code:`alpha`
- ---
* - :py:func:`~prefsampling.approval.urn_partylist`
- | :code:`alpha`
| :code:`parties`
-
* - :py:func:`~prefsampling.approval.resampling`
- | :code:`p`
| :code:`phi`
Expand Down Expand Up @@ -161,10 +165,6 @@ Reference: :py:mod:`prefsampling.approval`
| :code:`ordinal_sampler`
| :code:`ordinal_sampler_parameters`
-
* - :py:func:`~prefsampling.approval.urn_partylist`
- | :code:`alpha`
| :code:`parties`
-

Composition of Samplers
-----------------------
Expand Down
8 changes: 4 additions & 4 deletions docs/_sources/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,10 @@ Reference: :py:mod:`prefsampling.approval`
- | :code:`rel_num_approvals`
| :code:`alpha`
- ---
* - :py:func:`~prefsampling.approval.urn_partylist`
- | :code:`alpha`
| :code:`parties`
-
* - :py:func:`~prefsampling.approval.resampling`
- | :code:`p`
| :code:`phi`
Expand Down Expand Up @@ -161,10 +165,6 @@ Reference: :py:mod:`prefsampling.approval`
| :code:`ordinal_sampler`
| :code:`ordinal_sampler_parameters`
-
* - :py:func:`~prefsampling.approval.urn_partylist`
- | :code:`alpha`
| :code:`parties`
-

Composition of Samplers
-----------------------
Expand Down
44 changes: 22 additions & 22 deletions docs/quickstart.html
Original file line number Diff line number Diff line change
Expand Up @@ -484,43 +484,51 @@ <h2>Approval Samplers<a class="headerlink" href="#approval-samplers" title="Link
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p><a class="reference internal" href="reference/approval/index.html#module-prefsampling.approval.identity" title="prefsampling.approval.identity"><code class="xref py py-func docutils literal notranslate"><span class="pre">identity()</span></code></a></p></td>
<tr class="row-even"><td><p><a class="reference internal" href="reference/approval/index.html#prefsampling.approval.identity" title="prefsampling.approval.identity"><code class="xref py py-func docutils literal notranslate"><span class="pre">identity()</span></code></a></p></td>
<td><p><code class="code docutils literal notranslate"><span class="pre">rel_num_approvals</span></code></p></td>
<td><p></p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="reference/approval/index.html#module-prefsampling.approval.empty" title="prefsampling.approval.empty"><code class="xref py py-func docutils literal notranslate"><span class="pre">empty()</span></code></a></p></td>
<tr class="row-odd"><td><p><a class="reference internal" href="reference/approval/index.html#prefsampling.approval.empty" title="prefsampling.approval.empty"><code class="xref py py-func docutils literal notranslate"><span class="pre">empty()</span></code></a></p></td>
<td><p></p></td>
<td><p></p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="reference/approval/index.html#module-prefsampling.approval.full" title="prefsampling.approval.full"><code class="xref py py-func docutils literal notranslate"><span class="pre">full()</span></code></a></p></td>
<tr class="row-even"><td><p><a class="reference internal" href="reference/approval/index.html#prefsampling.approval.full" title="prefsampling.approval.full"><code class="xref py py-func docutils literal notranslate"><span class="pre">full()</span></code></a></p></td>
<td><p></p></td>
<td><p></p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="reference/approval/index.html#module-prefsampling.approval.impartial" title="prefsampling.approval.impartial"><code class="xref py py-func docutils literal notranslate"><span class="pre">impartial()</span></code></a></p></td>
<tr class="row-odd"><td><p><a class="reference internal" href="reference/approval/index.html#prefsampling.approval.impartial" title="prefsampling.approval.impartial"><code class="xref py py-func docutils literal notranslate"><span class="pre">impartial()</span></code></a></p></td>
<td><p><code class="code docutils literal notranslate"><span class="pre">p</span></code></p></td>
<td><p></p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="reference/approval/index.html#module-prefsampling.approval.impartial_constant_size" title="prefsampling.approval.impartial_constant_size"><code class="xref py py-func docutils literal notranslate"><span class="pre">impartial_constant_size()</span></code></a></p></td>
<tr class="row-even"><td><p><a class="reference internal" href="reference/approval/index.html#prefsampling.approval.impartial_constant_size" title="prefsampling.approval.impartial_constant_size"><code class="xref py py-func docutils literal notranslate"><span class="pre">impartial_constant_size()</span></code></a></p></td>
<td><p><code class="code docutils literal notranslate"><span class="pre">rel_num_approvals</span></code></p></td>
<td><p></p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="reference/approval/index.html#module-prefsampling.approval.urn" title="prefsampling.approval.urn"><code class="xref py py-func docutils literal notranslate"><span class="pre">urn()</span></code></a></p></td>
<tr class="row-odd"><td><p><a class="reference internal" href="reference/approval/index.html#prefsampling.approval.urn" title="prefsampling.approval.urn"><code class="xref py py-func docutils literal notranslate"><span class="pre">urn()</span></code></a></p></td>
<td><div class="line-block">
<div class="line"><code class="code docutils literal notranslate"><span class="pre">p</span></code></div>
<div class="line"><code class="code docutils literal notranslate"><span class="pre">alpha</span></code></div>
</div>
</td>
<td><p></p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="reference/approval/index.html#module-prefsampling.approval.urn_constant_size" title="prefsampling.approval.urn_constant_size"><code class="xref py py-func docutils literal notranslate"><span class="pre">urn_constant_size()</span></code></a></p></td>
<tr class="row-even"><td><p><a class="reference internal" href="reference/approval/index.html#prefsampling.approval.urn_constant_size" title="prefsampling.approval.urn_constant_size"><code class="xref py py-func docutils literal notranslate"><span class="pre">urn_constant_size()</span></code></a></p></td>
<td><div class="line-block">
<div class="line"><code class="code docutils literal notranslate"><span class="pre">rel_num_approvals</span></code></div>
<div class="line"><code class="code docutils literal notranslate"><span class="pre">alpha</span></code></div>
</div>
</td>
<td><p></p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="reference/approval/index.html#module-prefsampling.approval.resampling" title="prefsampling.approval.resampling"><code class="xref py py-func docutils literal notranslate"><span class="pre">resampling()</span></code></a></p></td>
<tr class="row-odd"><td><p><a class="reference internal" href="reference/approval/index.html#prefsampling.approval.urn_partylist" title="prefsampling.approval.urn_partylist"><code class="xref py py-func docutils literal notranslate"><span class="pre">urn_partylist()</span></code></a></p></td>
<td><div class="line-block">
<div class="line"><code class="code docutils literal notranslate"><span class="pre">alpha</span></code></div>
<div class="line"><code class="code docutils literal notranslate"><span class="pre">parties</span></code></div>
</div>
</td>
<td></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="reference/approval/index.html#prefsampling.approval.resampling" title="prefsampling.approval.resampling"><code class="xref py py-func docutils literal notranslate"><span class="pre">resampling()</span></code></a></p></td>
<td><div class="line-block">
<div class="line"><code class="code docutils literal notranslate"><span class="pre">p</span></code></div>
<div class="line"><code class="code docutils literal notranslate"><span class="pre">phi</span></code></div>
Expand All @@ -532,23 +540,23 @@ <h2>Approval Samplers<a class="headerlink" href="#approval-samplers" title="Link
</div>
</td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="reference/approval/index.html#module-prefsampling.approval.disjoint_resampling" title="prefsampling.approval.disjoint_resampling"><code class="xref py py-func docutils literal notranslate"><span class="pre">disjoint_resampling()</span></code></a></p></td>
<tr class="row-odd"><td><p><a class="reference internal" href="reference/approval/index.html#prefsampling.approval.disjoint_resampling" title="prefsampling.approval.disjoint_resampling"><code class="xref py py-func docutils literal notranslate"><span class="pre">disjoint_resampling()</span></code></a></p></td>
<td><div class="line-block">
<div class="line"><code class="code docutils literal notranslate"><span class="pre">p</span></code></div>
<div class="line"><code class="code docutils literal notranslate"><span class="pre">phi</span></code></div>
</div>
</td>
<td><p><code class="code docutils literal notranslate"><span class="pre">g</span></code> (defaults to 2)</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="reference/approval/index.html#module-prefsampling.approval.moving_resampling" title="prefsampling.approval.moving_resampling"><code class="xref py py-func docutils literal notranslate"><span class="pre">moving_resampling()</span></code></a></p></td>
<tr class="row-even"><td><p><a class="reference internal" href="reference/approval/index.html#prefsampling.approval.moving_resampling" title="prefsampling.approval.moving_resampling"><code class="xref py py-func docutils literal notranslate"><span class="pre">moving_resampling()</span></code></a></p></td>
<td><div class="line-block">
<div class="line"><code class="code docutils literal notranslate"><span class="pre">p</span></code></div>
<div class="line"><code class="code docutils literal notranslate"><span class="pre">phi</span></code></div>
</div>
</td>
<td><p><code class="code docutils literal notranslate"><span class="pre">num_legs</span></code> (defaults to 1)</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="reference/approval/index.html#module-prefsampling.approval.euclidean" title="prefsampling.approval.euclidean"><code class="xref py py-func docutils literal notranslate"><span class="pre">euclidean()</span></code></a></p></td>
<tr class="row-odd"><td><p><a class="reference internal" href="reference/approval/index.html#prefsampling.approval.euclidean" title="prefsampling.approval.euclidean"><code class="xref py py-func docutils literal notranslate"><span class="pre">euclidean()</span></code></a></p></td>
<td><p></p></td>
<td><div class="line-block">
<div class="line"><code class="code docutils literal notranslate"><span class="pre">radius</span></code> (defaults to 0.5)</div>
Expand All @@ -557,15 +565,15 @@ <h2>Approval Samplers<a class="headerlink" href="#approval-samplers" title="Link
</div>
</td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="reference/approval/index.html#module-prefsampling.approval.noise" title="prefsampling.approval.noise"><code class="xref py py-func docutils literal notranslate"><span class="pre">noise()</span></code></a></p></td>
<tr class="row-even"><td><p><a class="reference internal" href="reference/approval/index.html#prefsampling.approval.noise" title="prefsampling.approval.noise"><code class="xref py py-func docutils literal notranslate"><span class="pre">noise()</span></code></a></p></td>
<td><div class="line-block">
<div class="line"><code class="code docutils literal notranslate"><span class="pre">p</span></code></div>
<div class="line"><code class="code docutils literal notranslate"><span class="pre">phi</span></code></div>
</div>
</td>
<td><p><code class="code docutils literal notranslate"><span class="pre">noise_type</span></code> (defaults to <code class="xref py py-const docutils literal notranslate"><span class="pre">HAMMING</span></code>)</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="reference/approval/index.html#module-prefsampling.approval.truncated_ordinal" title="prefsampling.approval.truncated_ordinal"><code class="xref py py-func docutils literal notranslate"><span class="pre">truncated_ordinal()</span></code></a></p></td>
<tr class="row-odd"><td><p><a class="reference internal" href="reference/approval/index.html#prefsampling.approval.truncated_ordinal" title="prefsampling.approval.truncated_ordinal"><code class="xref py py-func docutils literal notranslate"><span class="pre">truncated_ordinal()</span></code></a></p></td>
<td><div class="line-block">
<div class="line"><code class="code docutils literal notranslate"><span class="pre">rel_num_approvals</span></code></div>
<div class="line"><code class="code docutils literal notranslate"><span class="pre">ordinal_sampler</span></code></div>
Expand All @@ -574,14 +582,6 @@ <h2>Approval Samplers<a class="headerlink" href="#approval-samplers" title="Link
</td>
<td></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="reference/approval/index.html#module-prefsampling.approval.urn_partylist" title="prefsampling.approval.urn_partylist"><code class="xref py py-func docutils literal notranslate"><span class="pre">urn_partylist()</span></code></a></p></td>
<td><div class="line-block">
<div class="line"><code class="code docutils literal notranslate"><span class="pre">alpha</span></code></div>
<div class="line"><code class="code docutils literal notranslate"><span class="pre">parties</span></code></div>
</div>
</td>
<td></td>
</tr>
</tbody>
</table>
</section>
Expand Down Expand Up @@ -651,7 +651,7 @@ <h2>Filters<a class="headerlink" href="#filters" title="Link to this heading">#<
<td><p>Randomly rename the candidates</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="reference/core/index.html#prefsampling.core.filters.resample_as_central_vote" title="prefsampling.core.filters.resample_as_central_vote"><code class="xref py py-func docutils literal notranslate"><span class="pre">resample_as_central_vote()</span></code></a></p></td>
<td><p>Resamples the votes using them as central votes of sampler whose definition include a central vote (e.g., <a class="reference internal" href="reference/ordinal/index.html#prefsampling.ordinal.mallows" title="prefsampling.ordinal.mallows"><code class="xref py py-func docutils literal notranslate"><span class="pre">mallows()</span></code></a> or <a class="reference internal" href="reference/approval/index.html#module-prefsampling.approval.resampling" title="prefsampling.approval.resampling"><code class="xref py py-func docutils literal notranslate"><span class="pre">resampling()</span></code></a>)</p></td>
<td><p>Resamples the votes using them as central votes of sampler whose definition include a central vote (e.g., <a class="reference internal" href="reference/ordinal/index.html#prefsampling.ordinal.mallows" title="prefsampling.ordinal.mallows"><code class="xref py py-func docutils literal notranslate"><span class="pre">mallows()</span></code></a> or <a class="reference internal" href="reference/approval/index.html#prefsampling.approval.resampling" title="prefsampling.approval.resampling"><code class="xref py py-func docutils literal notranslate"><span class="pre">resampling()</span></code></a>)</p></td>
</tr>
</tbody>
</table>
Expand Down
Loading

0 comments on commit 29261d7

Please sign in to comment.