def initialisation():
    # a temporary chromosome to be manipulated before adding to the population
    tempChromosome = Chromosome()
    for i in range(0, 100000):
        for j in range(0, tempChromosome.numTasks):
            k = randrange(0, tempChromosome.numProcs)
            tempChromosome.schedule[k].append(j)
        for j in range(0, tempChromosome.numProcs):
            tempChromosome.schedule[j].sort()
        # tempChromosome.schedule.sort(key=tempChromosome.schedule.itemgetter(0))
        tempChromosome.calculateFitness()
        population.append(tempChromosome)
        tempChromosome = Chromosome()
def initialisation(populationSize):  # done
    population = []  # a list of chromosomes
    tempChromosome = Chromosome()
    # a temporary chromosome to be manipulated before adding to the population
    for i in range(0, populationSize):
        for j in Chromosome.data:
            k = randrange(0, Chromosome.numProcs)
            tempChromosome.schedule[k].append(j)
        for j in range(0, Chromosome.numProcs):
            tempChromosome.schedule[j].sort(key=cmp_to_key(compare))
        tempChromosome.calculateFitness()
        population.append(tempChromosome)
        tempChromosome = Chromosome()
    return population