Initialise randomly
This commit is contained in:
parent
80cebfe5fa
commit
5e80a61064
|
@ -4,10 +4,10 @@ from random import Random
|
||||||
|
|
||||||
class Individual(object):
|
class Individual(object):
|
||||||
|
|
||||||
def __init__(self, x, y):
|
def __init__(self):
|
||||||
self.x = x
|
|
||||||
self.y = y
|
|
||||||
self.rand = Random()
|
self.rand = Random()
|
||||||
|
self.x = self.rand.random()
|
||||||
|
self.y = self.rand.random()
|
||||||
|
|
||||||
def fitness_function(self):
|
def fitness_function(self):
|
||||||
x = self.x
|
x = self.x
|
||||||
|
|
Loading…
Reference in New Issue
Block a user