My current code is trying to take a list of lists of lists, and then add members of a global variable list to it randomly. My code is like this:
def createIndividual(courses): #Courses is equal to an individual, but without people
individual = courses.copy()
for course in individual:
myPeople = PEOPLE.copy()
random.shuffle(myPeople)
for table in course:
while len(table) < table.maximum: table.append(myPeople.pop())
return individual
I run this function a bunch of times, trying to get lots of copies with different results. However, each time I run the program, it creates the exact same results for the course variable, both within the individual and within the population. The results differ each time I run the program, but are the same every time within. I cannot seem to find anything on the internet about what could be happening.
Aucun commentaire:
Enregistrer un commentaire