error when running my code
hay,
I have a an other errorin the run of the code gen.py
the error:
Traceback (most recent call last):
File "C:\Python25\ge n.py", line 111, in <module>
p = population (10,50) # population de 50 individus puis on initialise les distances
File "C:\Python25\ge n.py", line 62, in __init__
self.individus. append (individu(nombr e_genes))...
User Profile
Collapse
Profile Sidebar
Collapse
dooja
Last Activity: Feb 3 '13, 02:22 PM
Joined: Jan 17 '13
Location:
-
an error in run python code
good day,
I try to run the following code gen.py in python 2.5 in order to resolve the STP with genetic algorithm, but i find an error:
Traceback (most recent call last):
File "C:\Python25\ge n.py", line 55, in <module>
class population:
File "C:\Python25\ge n.py", line 61, in population
for v in range(self.nomb re_initial_popu lation):
NameError: name 'self' is... -
thank you for your help,
I indent all the code correctly, But;I find an other error is:
Traceback (most recent call last):
File "C:\Python25\ge n.py", line 57, in <module>
class population:
File "C:\Python25\ge n.py", line 63, in population
for v in range(self.nomb re_initial_popu lation):
NameError: name 'self' is not defined
I need your help again:
...Code:Leave a comment:
-
error of indent
hay for all;
a try to run the following code in python 2.5 in order to resolve the STP, but i find an error of indent (error: unexpected indent), please; can you help me.
...Code:# -*- coding: cp1252 -*- import random, sys, os, time class individu: def __init__ (self,nombre_genes,random=-1): self.genes = [] self.nombre_genes = nombre_genes if random == -1 : self.random
No activity results to display
Show More
Leave a comment: