BenBrostoff / draftfast

A tool to automate and optimize DraftKings and FanDuel lineup construction.
278 stars 113 forks source link

Cannot find solutions when using WNBA ruleset. #147

Closed dfshead closed 4 years ago

dfshead commented 4 years ago

`from draftfast import rules from draftfast.optimize import run from draftfast.orm import Player from draftfast.csv_parse import salary_download

player_pool = [ Player(name='A1', cost=1800, proj=43, pos='PG/SG'), Player(name='A2', cost=4500, proj=18, pos='PG/SG'), Player(name='A3', cost=5500, proj=24, pos='PG/SG'), Player(name='A7', cost=4500, proj=55, pos='SF/PF'), Player(name='A8', cost=5500, proj=55, pos='SF/PF'), Player(name='A9', cost=5500, proj=55, pos='SF/PF'), Player(name='A10', cost=1500, proj=55, pos='SF/PF'), Player(name='A17', cost=5500, proj=55, pos='SF/PF'), Player(name='A18', cost=5500, proj=26, pos='SF/PF'), Player(name='A19', cost=1500, proj=38, pos='SF/PF'), Player(name='A20', cost=5500, proj=55, pos='SF/PF'), ]

roster = run( rule_set=rules.DK_WNBA_RULE_SET, player_pool=player_pool, verbose=True, )

` I changed the pos figures in the rules.py file. The WNBA ruleset worked once.

Every other time the prompt tells me solution not found, and to lower constraints.

I lowered prices to definitely allow it to work. It has the same problem if I take the example usage from this site and put all salaries at 15000+.

IDK what to make of this.

BenBrostoff commented 4 years ago

Hey @dfshead - I did notice there are no tests that include DK_WNBA_RULE_SET so it's possible the rule consts aren't updated and are definitely not being tested against an actual CSV from DK. If you want to make a PR fixing this, that would be the first step I'd take.

Based on your description, this sounds related to the constants in DK_WNBA_RULE_SET as well as the player pool you're passing into the optimizer. I'd need specific examples to do a better debugging investigation here - can you give me a few passing examples and a few failing examples so I can try to determine exactly what's wrong?