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

Do some renaming and refactors #158

Merged
merged 6 commits into from
Apr 2, 2023
Merged

Do some renaming and refactors #158

merged 6 commits into from
Apr 2, 2023

Conversation

Saethox
Copy link
Collaborator

@Saethox Saethox commented Apr 1, 2023

  • Rename Population to Populations.
  • Rename some convenience methods of State, most notably population_stack to populations.
  • Make State generic over the problem type, so best_individual and such don't need a type annotation.

These were some changes that I think are more elegant that came up when writing the Tech Report. Making State generic might sound unintuitive because it doesn't actually depend on P aside from the convenience methods, but I think those are important enough that omitting the type parameter there is more intuitive. It also integrated quite nicely with logging, so there's that. When writing the Python wrapper, I actually needed to wrap State into a wrapper that is generic over P anyway, so that was a first indicator that this might be more elegant.

@Saethox Saethox requested a review from luleyleo April 1, 2023 16:52
Copy link
Collaborator

@luleyleo luleyleo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks convenient!

src/state/container/mod.rs Outdated Show resolved Hide resolved
src/state/container/mod.rs Outdated Show resolved Hide resolved
src/state/common.rs Show resolved Hide resolved
Saethox added 4 commits April 2, 2023 16:27
- Rename Population to Populations and rename some methods
- Make State generic over the problem type
- Switch initialization order of condition in Loop
@Saethox Saethox merged commit d8d5f98 into master Apr 2, 2023
@Saethox Saethox deleted the state-refactors branch April 2, 2023 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants