pydfs-lineup-optimizer
pydfs-lineup-optimizer copied to clipboard
Multiple Settings
Is there a way to run the optimizer with multiple groups of settings? Let's say I wanted 500 lineups, 150 4-man stack, 150 3-man stack and 100 unstacked, is there a way to accomplish this with a for loop perhaps
The reason I ask is I want a mixture of stack types while keeping under a certain max_exposure threshold
This issue is close to #276, I'll add the ability to exclude lineups from optimizations. So it will be possible to generate the first batch of lineups with provided configs then change configs and generate a second batch of lineups with excluded lineups from the first step to avoid lineups duplications. But in this approach, you will specify max_exposure for each batch but the overall exposure should be equal to the batch exposures but spread across different configs.
In version 3.6.1 you can do this:
lineups = []
optimizer.add_stack(TeamStack(4))
for lineup in optimizer.optimize(150):
lineups.append(lineup)
optimizer.reset_stacks()
optimizer.add_stack(TeamStack(3))
for lineup in optimizer.optimize(150, exclude_lineups=lineups):
lineups.append(lineup)
optimizer.reset_stacks()
for lineup in optimizer.optimize(100, exclude_lineups=lineups):
lineups.append(lineup)
for lineup in lineups:
print(lineup)
optimizer.print_statistic(with_excluded=True)
@Scottw1105 Were you able to get this code working? And if YES, would you be able to share an example? I was the one that actually requested #276 but I'm having difficulty with it. Getting the old ".......pydfs_lineup_optimizer.exceptions.LineupOptimizerException: Unable to build lineup....." errors
With this code how do u add in randomness
@Denwen12 you would need to add settings with randomness per the docs tutorial. It will work the same this way. BTW, in my opinion, if you're adding randomness to multiple optimizations, its still just random. I understand that certain stacking or constraints can change, just curious why you would need multiple different lineup optimization strategies if you are in fact using random
I tried but didn't work like usually after the count
On Thu, Dec 9, 2021, 7:15 PM Owen-Slater @.***> wrote:
@Denwen12 https://github.com/Denwen12 you would need to add settings with randomness per the docs tutorial. It will work the same this way. BTW, in my opinion, if you're adding randomness to multiple optimizations, its still just random.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/DimaKudosh/pydfs-lineup-optimizer/issues/288#issuecomment-990432574, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANBWO7VKGIDW4MAUSMCCPYLUQFBCHANCNFSM5CVRKSSQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
@Denwen12 are you replacing the code for your optimizer settings between EACH optimization? This is how it works, you must reload all of the settings with each optimization
I tried it like this
lineups = [] optimizer.add_stack(TeamStack(4)) for lineup in optimizer.optimize(50, randomness=true): lineups.append(lineup) optimizer.reset_stacks() optimizer.add_stack(TeamStack(3)) for lineup in optimizer.optimize(50, exclude_lineups=lineups, randomness=true): lineups.append(lineup) optimizer.reset_stacks() for lineup in optimizer.optimize(50, exclude_lineups=lineups, randomness=true): lineups.append(lineup) for lineup in lineups: print(lineup) optimizer.print_statistic(with_excluded=True)
On Thu, Dec 9, 2021, 8:17 PM Owen-Slater @.***> wrote:
@Denwen12 https://github.com/Denwen12 are you replacing the code for your optimizer settings between EACH optimization? This is how it works, you must reload all of the settings with each optimization
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/DimaKudosh/pydfs-lineup-optimizer/issues/288#issuecomment-990482117, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANBWO7WWIATHNXWYG32X5CLUQFIJRANCNFSM5CVRKSSQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.