|Think about Loose Coupling|
Optimization Algorithm Helpby jdlev (Scribe)
|on Aug 22, 2013 at 07:14 UTC||Need Help??|
jdlev has asked for the
wisdom of the Perl Monks concerning the following question:
Help O wise Monks!
I'm totally stumped on how to develop what I'm calling my "fantasy football optimization algorithm".
Here's the general idear. You have $100,000 to spend for 10 players (2 QB, 2RB, 2WR, 1TE, 2FLEX, 1DEF)...each position player costs you a bit of your $100,000. So say Drew Brees costs you $17,000, while some scrub costs you $5,000. In other words, if you spend a bunch at quarterback, you'll have to get a scrub at running back or vice versa. In building this algorithm, I'm trying to maximize the teams projected points, while staying under $100,000 in total salary.
So what I've done is converted each player's stats into a value based equation. It's simple. Basically, it's a "cost per point" analysis. In the case of Drew Brees, you have to pay $17,000 to get him, and he's projected to score 22 points per game, meaning you would roughly have to pay ~$750 per point.
What I'm trying to develop in perl is a program that looks at the players value rating, and runs through millions of iterations to assemble the team with the most projected points as close to the $100,000 salary cap as I can.
I haven't been able to get very far. Any ideas on how to do something like this? Should I assemble all data in some arrays or use a mysql db? How should I track when one a new "high score" has been reached? Any help is appreciated, and I'll let you guys/gals know how I do in my league once this is complete :)
I love it when a program comes together - jdhannibal