[OVC-demo-team] Random ballot generator

From: David Mertz <voting-project_at_gnosis_dot_cx>
Date: Sat Mar 06 2004 - 01:57:36 CST

I have gone ahead and written a random ballot generator. It's usage is:

        $ ./random_ballots.py <<num>>

You can generate as many sample ballots as you like, all in the working
directory (as long as you want fewer than 10000, since that's all the
ballot-id's there are to go around). The ballot-ids chosen are unique
and random.

These ballots match the sample that Jan posted at:


Or directly:


Moreover, I utilized Jan's contests.py file to configure the candidates:


A few notes on what I did:

* I wasn't sure about the "serial" attribute (which Alan recently
described as the CD number). I just hardcoded the value Jan provided
in his example. Should this be a switch? Likewise, all the other
constants like date, precinct, county, etc. are just defined at top. I
could pull them out to a configuration file or the like, if needed.

* I do not zero-pad the "number" attribute (ballot-id) in either file
names or root attribute. Should I?

* I -do- enable "no preference" votes for "pick-one" contests, but I do
not enable random write-ins. Is this important to do for the demo?

* However, for the multi-pick contests, I enable write-ins, mostly
because County Commissioner lets you rank up to eight, but there are
only seven names listed (so I need a write-in if 8 ranks are used).
Side note: how would a voter write-in multiple names in multi-pick

* If no preference is expressed in multi-pick contests, that is
reflected in the absence of <selection> elements, not by the explicit
phrase "No preference indicated" in a selection. This makes more sense
to me, but I can change it if someone tells me this is wrong.

* Contrary to Alan's request, I HAVE NOT weighted the votes against
certain candidates (mostly because the random picks are more generic
than that... but also I hardly like the idea of calling Marx a "bad
guy" :-)). Still, a demo ballot set can be pruned to get desired
outcomes, if needed.

Yours, David...
= The content of this message, with the exception of any external
= quotations under fair use, are released to the Public Domain
Received on Thu Apr 1 02:40:24 2004

This archive was generated by hypermail 2.1.8 : Thu Apr 01 2004 - 02:40:36 CST