can not run basic.py
suixin777 opened this issue · 3 comments
suixin777 commented
Type "scientific" for more details.
runfile('/home/sx/evosoro/evosoro/examples/basic.py', wdir=r'/home/sx/evosoro/evosoro/examples')
Traceback (most recent call last):
File "", line 1, in
File "/usr/lib/python2.7/dist-packages/spyderlib/widgets/externalshell/sitecustomize.py", line 540, in runfile
execfile(filename, namespace)
File "/home/sx/evosoro/evosoro/examples/basic.py", line 165, in
my_pop = Population(my_objective_dict, MyGenotype, MyPhenotype, pop_size=POPSIZE)
File "/home/sx/evosoro/evosoro/examples/../../evosoro/softbot.py", line 389, in init
self.add_random_individual()
File "/home/sx/evosoro/evosoro/examples/../../evosoro/softbot.py", line 450, in add_random_individual
ind = SoftBot(self.max_id, self.objective_dict, self.genotype, self.phenotype)
File "/home/sx/evosoro/evosoro/examples/../../evosoro/softbot.py", line 324, in init
self.genotype = genotype() # initialize new random genome
File "/home/sx/evosoro/evosoro/examples/basic.py", line 94, in init
self.add_network(CPPN(output_node_names=["shape", "muscleOrTissue", "muscleType", "tissueType"]))
File "/home/sx/evosoro/evosoro/examples/../../evosoro/networks.py", line 53, in init
self.mutate()
File "/home/sx/evosoro/evosoro/examples/../../evosoro/networks.py", line 114, in mutate
variation_degree = self.add_node()
File "/home/sx/evosoro/evosoro/examples/../../evosoro/networks.py", line 148, in add_node
this_edge = random.choice(self.graph.edges())
File "/usr/lib/python2.7/random.py", line 273, in choice
return seq[int(self.random() * len(seq))] # raises IndexError if seq is empty
File "/usr/local/lib/python2.7/dist-packages/networkx/classes/reportviews.py", line 926, in getitem
u, v = e
TypeError: 'int' object is not iterable
skriegman commented
Are you using Python 2.7?
suixin777 commented
I use ubantu 14.04 and I did not update python,so I think my python is python 2.7.
suixin777 commented
I have solved my problem ,thank you sincerely!