@@ -125,46 +125,3 @@ def haveEnoughPeople(people_per_task, task_counters, assigned_task = None):
125125print ("----- Final Assignment History for Each Task -----" )
126126for task , residents_assigned in task_assign_hist .items ():
127127 print (f"{ task } : { residents_assigned } " )
128-
129- # # Update assignment history for the task
130- # task_assign_hist[assigned_task].append(resident)
131-
132- # print(f"Person {resident} assigned to {assigned_task}")
133- # # while (assigned_task not in ['Toilet&Shower'])
134-
135- # # if assigned_task not in ['Toilet&Shower']:
136-
137- # # # Check if this person has been assigned the same task in previous weeks
138- # # while len(res_assign_hist[resident]) > 0 and \
139- # # assigned_task == res_assign_hist[resident][week - 1]:
140- # # # If the same, reassign task to the person
141- # # assigned_task = random.choice(eligible_tasks[resident])
142-
143- # # # # Check if this person has been assigned the same task in previous weeks
144- # # # if week > 1 and len(res_assign_hist[resident]) > 0:
145- # # # while assigned_task == res_assign_hist[resident][week - 1]:
146- # # # # If the same, reassign task to the person
147- # # # assigned_task = random.choice(eligible_tasks[resident])
148-
149- # # # # Check if the task has reached its maximum number of people for the week
150- # # # if assigned_task != '-' and task_counters[assigned_task] <= people_per_task[assigned_task]:
151- # # # # Update assignment history for the resident and task
152-
153- # # if (assigned_task != '-') and (task_counters[assigned_task] \
154- # # <= people_per_task[assigned_task]):
155-
156-
157- # # Update assignment history for the resident
158- # res_assign_hist[resident].append(assigned_task)
159-
160- # # Reset task counters for the next week
161- # task_counters = {task: 0 for task in tasks}
162-
163- # print()
164-
165- # # ######## End assignment ########
166-
167- # # Print the final assignment for each resident
168- # print("----- Final Assignment History for Each Resident -----")
169- # for resident, tasks_assigned in res_assign_hist.items():
170- # print(f"Resident {resident}: {tasks_assigned}")
0 commit comments