evolvablehardware / BitstreamEvolution

Evolvable Hardware: Begin using the BitstreamEvolution Open Source Toolkit
https://evolvablehardware.org
GNU General Public License v3.0
10 stars 4 forks source link

When i run evolve.py and can't go to the next generation (said Circuit object is not iterable) #7

Open learnerfelix opened 1 year ago

learnerfelix commented 1 year ago

File "/home/felix/Desktop/BitstreamEvolution/BitstreamEvolution-main/src/evolve.py", line 28, in

population.evolve()

File "/home/felix/Desktop/BitstreamEvolution/BitstreamEvolution-main/src/CircuitPopulation.py", line 188, in evolve

self.__run_selection()

File "/home/felix/Desktop/BitstreamEvolution/BitstreamEvolution-main/src/CircuitPopulation.py", line 212, in __run_classic_tournament

for ckt1, ckt2 in CircuitPopulation.__group(population, 2):

File "/home/felix/Desktop/BitstreamEvolution/BitstreamEvolution-main/src/CircuitPopulation.py", line 376, in __group

args = [iter(iterable)] * n

TypeError: 'Circuit' object is not iterable

learnerfelix commented 1 year ago

and i'm using classic tourment

derekwhitley commented 1 year ago

Will look into this further, but at first glance it appears that your population may be too small. Can you provide further details about your current configuration?

learnerfelix commented 1 year ago

Well, i've deleted the [0] and k=... in the 207 lines: population = self.rand.permutation(self.circuits) and it works with not error traceback, the figue is no good as the sample but generated full time. i might try a bigger population.Thank you !