From b75b1c8e02b65fda852b528a7ba524416a30ccad Mon Sep 17 00:00:00 2001 From: George Lacey Date: Wed, 27 Sep 2017 23:39:44 +0100 Subject: [PATCH] Fix printing --- src/individual.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/individual.py b/src/individual.py index 9fa0c41..5e27443 100644 --- a/src/individual.py +++ b/src/individual.py @@ -19,7 +19,7 @@ class Individual(object): def __str__(self): return "x: %f\ty: %f\tfit: %f\n" %\ - (self.x, self.y, self.fitness) + (self.x, self.y, self.fitness()) def fitness(self): x = self.x @@ -33,6 +33,7 @@ class Individual(object): return one, two def mutate(self): + rand.randint(1, 10) if rand.randint(1, 10) % 2 == 0: self.x = self.get_rand_param() else: