Beispiel #1
0
 def showBestBag(self):
     bag = Bag()
     bag.makeMapping(self.items, self.bestGene)
     print("The best fitness: ", self.bestFitness)
     print("The best generation: ", self.bestGeneration)
     bag.show()
Beispiel #2
0
 def showBags(self):
     for gene in self.population:
         bag = Bag()
         bag.makeMapping(self.items, gene)
         bag.show()
         print("------------------------")