-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Better tests, better __main__.py
, no duplicates on teams
#53
Conversation
…l on one team in some functions
I've also ensured that pokemon cannot be modified in-place by storing them in a |
oh aaaaaaand there's support again to write-out teams in the main function -- see |
i've requested a couple reviews:
|
All tests are passing on latest commit for me. |
I'm gonna merge this since I think it's a good base to build on -- we can work out any creases in the genetic algorithm with separate PRs :) |
This is scary in terms of performance, no? |
from what? i haven't noticed a slowdown, don't think that the object types here are an issue -- feel free to benchmark something and show me! |
Also, @phinate https://github.com/alan-turing-institute/p2lab-pokemon/actions/runs/5399005143/jobs/9805574268 any thoughts on this does this need to be raised as an issue? |
Ty, just made #57 |
turns out the use of
deepcopy
in theTeam
class in #36 #40 #41 didn't actually fix our issue -- the cause is probably right since it always happens with duplicate pokemon, but this didn't make the pokemon separate from the point of view of the bot.this fixes the issue indirectly in
fitness_mutate
andmutate
by forcing a resampling whenever duplicate pokemon are generated for the same team. additionally, there's a hard guard to this inTeam
now which checks the pokemon upon initialisation.what's not protected against is modifying the
.pokemon
attribute directly, so I've made this a tuple for now -- needs some ironing out for use in the crossover methods, since they've been designed for numpy arrays. (i cast once or twice atm to get partially around this).