Fixed insert_chromosome

This commit is contained in:
SimpleArt
2020-11-19 09:52:31 -05:00
parent 8eb436d6a5
commit d3174a9c8a

View File

@ -52,10 +52,10 @@ class SQL_Database:
""" Insert one chromosome into the database""" """ Insert one chromosome into the database"""
# Structure the insert data # Structure the insert data
db_chromosome = (generation, chromosome.fitness, '[chromosome]') db_chromosome = (generation, chromosome.fitness, repr(chromosome))
# Create sql query structure # Create sql query structure
sql = ''' INSERT INTO data(generation,fitness,chromosome) sql = ''' INSERT INTO data(generation, fitness, chromosome)
VALUES(?,?,?) ''' VALUES(?,?,?) '''
cur = self.conn.cursor() cur = self.conn.cursor()
@ -135,6 +135,7 @@ class SQL_Database:
return sql return sql
def insert_config(self,ga): def insert_config(self,ga):
"""Insert the configuration attributes into the config.""" """Insert the configuration attributes into the config."""