Fixed chromosome so now it adds to the database and added __str__ to chromo
This commit is contained in:
@ -68,10 +68,8 @@ class SQL_Database:
|
||||
""" Insert current generations population """
|
||||
|
||||
# Structure the insert data
|
||||
db_chromosome_list = [
|
||||
(ga.current_generation, chromosome.fitness, '[chromosome]')
|
||||
for chromosome in ga.population.get_chromosome_list()
|
||||
]
|
||||
db_chromosome_list = [(ga.current_generation, chromosome.fitness, chromosome.__str__())
|
||||
for chromosome in ga.population.get_chromosome_list() ]
|
||||
|
||||
# Create sql query structure
|
||||
sql = ''' INSERT INTO data(generation,fitness,chromosome)
|
||||
|
||||
Reference in New Issue
Block a user