Don't return fitness
This commit is contained in:
parent
42e33b0399
commit
b4d9ea26bf
|
@ -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
|
||||||
|
|
|
@ -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())
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user