Hi Hugh,
I have some suggestions for your code.
This,
{ } swap [ candidate? suffix ] each
this could be written using map instead, ie
[ candidate? ] map
And this,
[ ballot get nth . ] each
can be simplified to
ballot get [ . ] each
or
ballot get stack.
Finally,
[ count>> + ] each
Can be written using the sigma combinator:
[ count>> ] sigma
One more piece of advice: you might want to wrap your top-level
word(s) in a with-scope, so that the temporary dynamic variables you
use with get/set don't clutter the namespace of the caller.
Slava
On Sun, Jun 7, 2009 at 11:42 PM, Hugh Aguilar<[email protected]> wrote:
> This has been a rough week for me due to automotive problems. I did find
> time however to put together a simple voting simulation package:
> www.rosycrew.com/votsim.factor. I am only supporting plurality voting (PV),
> approval voting (AV), and borda voting at this time. Maybe later I will
> provide hare voting as well. That one is somewhat discredited as it tends to
> be susceptible to voting paradoxes. It is also quite complicated and tends
> to confuse the average voter. AV has the advantage of being easy to explain,
> which helps convince people to vote.
>
> The most important next step will be some code to determine a condorcet
> winner. This is very much a work in progress, so any suggestions on what you
> would like to see would be appreciated.
>
> I still like approval voting. The borda system looks good at first glance
> because it takes into account ranking, but it has weaknesses. The results
> are dependent upon how many candidates there are. If there is a liberal
> qualification method, then there might be a lot of candidates in the
> election (Communist Party, Free-Beer Party, etc.) who have no chance of
> winning. This would effect how the borda system tallies the votes for the
> important candidates and could even change the outcome, even though the
> marginal candidates aren't receiving hardly any votes at all.
>
> Thoughts?
>
>
> ------------------------------------------------------------------------------
> OpenSolaris 2009.06 is a cutting edge operating system for enterprises
> looking to deploy the next generation of Solaris that includes the latest
> innovations from Sun and the OpenSource community. Download a copy and
> enjoy capabilities such as Networking, Storage and Virtualization.
> Go to: http://p.sf.net/sfu/opensolaris-get
> _______________________________________________
> Factor-talk mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/factor-talk
>
------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises
looking to deploy the next generation of Solaris that includes the latest
innovations from Sun and the OpenSource community. Download a copy and
enjoy capabilities such as Networking, Storage and Virtualization.
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
Factor-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/factor-talk