Skip to content
Snippets Groups Projects
Commit b8ca4403 authored by Sepehr Madani's avatar Sepehr Madani
Browse files

Add overloaded __str__() method for Chromosome

parent ef829bf2
No related branches found
No related tags found
No related merge requests found
......@@ -32,6 +32,9 @@ class Chromosome:
def __hash__(self):
return hash(tuple(self.gene))
def __str__(self):
return "{} [{:.2f}]".format(tuple(self.gene), self.get_score())
def get_score(self):
"""Evaluates a score based on chromosome's pattern"""
return -20 * log10(abs(self.pattern))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment