def eval_fitness(self, chromosome):
score = <NUM_LIT:0><EOL>number = self.translator.translate_gene(chromosome.genes[<NUM_LIT:0>])<EOL>for factor in self.factors:<EOL><INDENT>if number % factor == <NUM_LIT:0>:<EOL><INDENT>score += <NUM_LIT:1><EOL><DEDENT>else:<EOL><INDENT>score -= <NUM_LIT:1><EOL><DEDENT><DEDENT>if score == len(self.factors):<EOL><INDENT>min_product = functools.reduce(lambda a,b: a * b, self.factors)<EOL>if number + min_product > self.max_encoded_val:<EOL><INDENT>print("<STR_LIT>", number)<EOL>self.found_best = True<EOL><DEDENT><DEDENT>return score * number / self.max_encoded_val<EOL>
Convert a 1-gene chromosome into an integer and calculate its fitness
by checking it against each required factor.

return:  fitness value