Commit cbb3f42e authored by Ashkan Taslimi's avatar Ashkan Taslimi

Fix bug in adding new alements to set and array

Rename some varibles to improve readability
parent 9173018d
......@@ -24,13 +24,13 @@ def gen_repair_schedule(redundancy, positions, min, max, is_order_ascending):
arbitrary_schedules = []
ordered_schedules = set()
f = generate_restricted_integer_compositions(redundancy, positions, min, max)
for i in f:
arbitrary_schedules.add(i)
gen_rics = generate_restricted_integer_compositions(redundancy, positions, min, max)
for ric in gen_rics:
arbitrary_schedules.append(ric)
if not is_order_ascending:
for i in arbitrary_schedules:
ordered_schedules.append(itertools.permutations(i))
for ric in arbitrary_schedules:
ordered_schedules.add(itertools.permutations(ric))
return list(ordered_schedules)
else:
return arbitrary_schedules
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment