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

Allow printing of individual with fitness=None for all objectives #383

Open
jakobj opened this issue Feb 12, 2024 · 0 comments
Open

Allow printing of individual with fitness=None for all objectives #383

jakobj opened this issue Feb 12, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@jakobj
Copy link
Member

jakobj commented Feb 12, 2024

At the moment one can not print an individual before its fitness (for any objective) is determined. Ultimately this is caused by, e.g., this call sequence IndividualSingleGenome::__repr__->IndividualBase::fitness in which the following check breaks

if len(fitness_all_objectives) == 0:
    raise runtimeerror(f"fitness of individual {self.idx} is none for all objectives.")

https://github.com/Happy-Algorithms-League/hal-cgp/blob/master/cgp/individual.py#L49

Not sure why this was introduced in the first place, but we should make sure nothing else breaks when removing this check.

@jakobj jakobj added the bug Something isn't working label Feb 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant