|
-
Sep 21st, 2010, 04:38 AM
#1
[RESOLVED] Simple to understand, complex to code; help!
I'm writing a Fantasy Football GM/Coach evaluator.
Quickly, in FF you pick a set of NFL players who score fantasy points for you based on what they do in their real game. Each fantasy team has arond 16 players on it, around 9 of whom "start" each week. You only score points from your 9 starters.
In the real NFL, the General Manager (GM) makes personnel decisions. He (along with input from the coach) decides what players to draft, trade, sign and cut. The head coach then takes all the players the GM gives him and decides who should get the most playing time.
In fantasy, a common source of "Doh!" is when you don't start a guy who has a monster game. Those points don't count for you, which is annoying.
The purpose of my GM/Coach evaluator is to go through each team and calculate the most points you could have scored if you started all the right people. In other words, how good a job the fantasy player did in assembling their raw team. The Coach part will be a percentage, the actual score / potential score. Given your raw talent, how good a job did you do deciding who to start?
This is all very simple and straightforward and, in fact, mostly implemented. The complex logic comes in with flex spots. A typical FF starting roster looks like this:
1 QB
2 RB
2 WR
1 TE
1 DEF
1 K
If that were all there was, I'd already be done with it. But flex spots let you choose who to start. The three flavors of flex spots are:
WR/RB
WR/TE
RB/WR/TE
To further complicate things, some actual NFL players are listed as having multiple positions. For example, a guy could be listed as "RB,WR" for position, meaning you can start him at RB, WR, WR/RB, or RB/WR/TE. Some of these guys are high scorers, so they can't be ignored.
I'm having trouble designing the logic to calculate who the best 9 starters should be. If you want to just post a high-concept description of how to do it in narrative (instead of code) form, by all means please do so. If you want to take a crack at the actual coding logic, in the next post is attached the project as it stands now.
My logic so far is to go through every dedicated (non-flex) position and pick the highest-scoring guy of that position who isn't already starting.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|