diff --git a/src/structure/chromosome.py b/src/structure/chromosome.py index b6406ab..b51a0c0 100644 --- a/src/structure/chromosome.py +++ b/src/structure/chromosome.py @@ -163,12 +163,13 @@ class Chromosome: """ Allows the user to use chromosome_string = repr(chromosome) - chromosome = eval(chromosome_string) + chromosome_data = eval(chromosome_string) + chromosome = ga.make_chromosome(chromosome_data) to get a backend representation of the chromosome which can be evaluated directly as code to create the chromosome. """ - return f"EasyGA.make_chromosome({repr(self.gene_list)})" + return repr(self.gene_list) def __str__(self): diff --git a/src/structure/gene.py b/src/structure/gene.py index f2d0126..b19495a 100644 --- a/src/structure/gene.py +++ b/src/structure/gene.py @@ -29,10 +29,11 @@ class Gene: """ Allows the user to use gene_string = repr(gene) - gene = eval(gene_string) + gene_data = eval(gene_string) + gene = ga.make_gene(gene_data) to get a backend representation of the gene. """ - return f"EasyGA.make_gene({repr(self.value)})" + return repr(self.value) def __str__(self): diff --git a/src/structure/population.py b/src/structure/population.py index 7fd3aa3..ec99c5e 100644 --- a/src/structure/population.py +++ b/src/structure/population.py @@ -188,12 +188,13 @@ class Population: """ Allows the user to use population_string = repr(population) - population = eval(population_string) + population_data = eval(population_string) + population = ga.make_population(population_data) to get a backend representation of the population which can be evaluated directly as code to create the population. """ - return f"EasyGA.make_population({repr(self.chromosome_list)})" + return repr(self.chromosome_list) def __str__(self):