Setting it up as Tilly suggests, this also might be a good problem for a genetic algorithm. First, create and fill a hundred or so random lineups from all available teams. Each step of the interation will require playing each line up as randomly as tilly suggests for a game, assigning the total number of runs won as the 'value' of that lineup. For each line up, you could run the game multiple times, the value being the total sum of all scores. When all lineups have been done, sort this set based on scores; remove those lineups that did not perform well (say, less than 2*number of games played*number of innings), and for those that did perform well (say, better than 4*number of games played*number of innings), copy and mutate them. The mutation would be one of two things: either randomly switch the order or two consecutive players on the team, or switch a random player with a random player not currently on the lineup. Clear out all the current 'values' and rerun. After several iterations of this, the top 10 or so lineups should have outstanding results, which you can then compare to the current lineup with.
To make this work better, you should generate a large array of random numbers that would be regenerated on each step, but within each step, each tested lineup would use the same random numbers in the same order, if only to remove a potental bias.
(Yes, I know this is serious overkill, but it's an interesting thought ...)
Dr. Michael K. Neylon - mneylon-pm@masemware.com
||
"You've left the lens cap of your mind on again, Pinky" - The Brain
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.