Skip to content
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

Add an argument specifying tournament (pool) size in the tournament selection operator #19

Closed
3 tasks
gnypit opened this issue Jan 9, 2025 · 4 comments
Closed
3 tasks
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@gnypit
Copy link
Owner

gnypit commented Jan 9, 2025

In genal/selection_operators.py tournament selection operator by default treats the number of mating parents as the tournament (pool) size. There should be an argument specifying the pool size, which is:

  • an integer such that 0 < pool size <= number of parents mating;
  • stored within the Generation class;
  • passd on to each Generation class' instance within the Genetic Algorithm.

Probably firstly the relationship between Generation and GeneticAlgorithm classes should be cleaned up and reorganised. However, solving this example might be a good example on how to handle args for different operators between various generations in the genetic algorithm.

@gnypit gnypit added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels Jan 9, 2025
@alguiguilo098
Copy link
Contributor

@gnypit, what's up?
Should I try to resolve this issue?

@gnypit
Copy link
Owner Author

gnypit commented Jan 14, 2025

Hi @alguiguilo098 ! That would be great 😄

@alguiguilo098
Copy link
Contributor

@gnypit what, up ?

you want Generation class stored pool size, send argument in constructor ?

@gnypit
Copy link
Owner Author

gnypit commented Jan 21, 2025

Hi! I saw you added it as a field in Generation class, that's great ;) thanks for the help!

@gnypit gnypit closed this as completed Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants