Don't return fitness

This commit is contained in:
George Lacey 2017-09-23 19:08:49 +01:00
parent 42e33b0399
commit b4d9ea26bf
2 changed files with 0 additions and 3 deletions

View File

@ -15,7 +15,6 @@ class Individual(object):
y = self.y y = self.y
n = 9 n = 9
self.fitness = pow(15*x*y*(1-x)*(1-y)*sin(n*pi*x)*sin(n*pi*y), 2) self.fitness = pow(15*x*y*(1-x)*(1-y)*sin(n*pi*x)*sin(n*pi*y), 2)
return self.fitness
def crossover(self, spouse): def crossover(self, spouse):
temp = self.x temp = self.x

View File

@ -6,5 +6,3 @@ args.add_argument("pop", help="Population size", type=int)
args = args.parse_args() args = args.parse_args()
pop = Population(10) pop = Population(10)
print("%d" % pop.fitness_function())