def get_fitness(self, chromosome):
fitness = self.fitness_cache.get(chromosome.dna)<EOL>if fitness is None:<EOL><INDENT>fitness = self.eval_fitness(chromosome)<EOL>self.fitness_cache[chromosome.dna] = fitness<EOL><DEDENT>return fitness<EOL>
Get the fitness score for a chromosome, using the cached value if available.