Apr-16-2019, 10:07 AM
Hello, I have for files AllOnesGA.py with the main(), GeneticAlgorithm.py,Population.py and Individual.py
The cuestion is that pycharm mark as an error the overloading of the constructor
thanks
ps:the error is
The cuestion is that pycharm mark as an error the overloading of the constructor
thanks
class Population: def __init__(self,populationSize): self.populationSize=individual_file[populationSize] def __init__(self,populationSize,chromosomeLength): self.population = individual_file.Individual[populationSize] for individualCount in range (0,populationSize): individual = individual_file(chromosomeLength) self.population[individualCount]= individual ...what I'm doing wrong
ps:the error is
Error: File "/home/psm/PycharmProjects/AllOnesGA/genetic_algorithm.py", line 12, in initPopulation
population = population_file.Population(self.populationSize, chromosomeLength)
File "/home/psm/PycharmProjects/AllOnesGA/population_file.py", line 7, in __init__
self.population = individual_file.Individual[populationSize]
TypeError: 'type' object is not subscriptable