CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2014
    Posts
    2

    Voting bot - every 50th entry wins

    Hello everybody,

    I am supposed to write a simple voting program as a semestral project. There are about 30 people in our class and we are going to compete with our voting bots against each other (+ some random traffic bots). The principle is simple - every 50th entry (vote) wins.

    We are given the results website, where we can see winners and current vote count. Nothing more. Oh, and everybody has only 50 votes (except traffic bots).

    I have already written voting function, function to extract the number of votes from the results website, function to find out server response time and made some voting bots to simulate traffic on the server (voting every 2s, 4s,..., randomly). But now I got stuck with the algorithm which should decide, when to vote.

    I guess that most people in my class are going to use something like "if there are more than 45 votes and less than 50 -> vote" approach.

    I was thinking about measuring average latency and average traffic for first few rounds but there are going to be many 'outliers' just before the 50th votes and based on my bots, the latency is going to drop rapidly (my 2s bot voted 10s late because the server couldn't handle the load). I just don't see the connection between vote count and server response and how to measure the right voting moment accurately.


    Can you help me with the algorithm design please? I don't want you to do my project, I just need you to point me to the right direction. I believe this could be solved with some statistic method or machine learning but we haven't learned it yet.

    Thank you

  2. #2
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,635

    Re: Voting bot - every 50th entry wins

    Seems like if everybody waits until there are 45 votes, nobody would ever vote. I guess that's what the random bots do. Assuming the winning vote isn't selected at random from among every 50 entries, I can't think of anything better than trying to measure voting frequency and latency and vote at the right time. Voting multiple times would probably help, and you'd need to determine the optimal number of times to vote.

  3. #3
    Join Date
    Apr 2000
    Location
    Belgium (Europe)
    Posts
    4,626

    Re: Voting bot - every 50th entry wins

    I'd probably more go for
    getting the count
    if the count is more than somethign as close to 50 as you can afford, vote 50-count times in rappid succession (=try to prevent someone else from sneaking in between).


    or

    If you don't have time to worry about.
    Wait it out until everyone else has spent all their votes (no more rush hour) and only the votebots are left. then get yours in, assuming the votebots aren't too quick, that should be able to net you almost perfect score.

  4. #4
    Join Date
    Oct 2014
    Posts
    2

    Re: Voting bot - every 50th entry wins

    Thank you for your replies, however after some further research I decided to try implementing Queueing theory.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured