Commit e05c0108 authored by birk's avatar birk
Browse files

shuffle programs regularly

parent 73b64b01
......@@ -69,6 +69,21 @@ class Main(object):
print('***** load_program followup {} *****'.format(program._name))
else:
self._program_index = (self._program_index + 1) % len(self._programs)
# shuffle programs?
middle_index = int(0.5*len(self._programs))
one_third_index = int(0.3*len(self._programs))
if self._program_index == 0:
# shuffle last two third whenever program loop starts again
a = self._programs[:one_third_index]
b = self._programs[one_third_index:]
shuffle(b)
self._programs = a + b
elif self._program_index == middle_index + 1:
# shuffle first half whenever program loop has reached second half
a = self._programs[:middle_index]
b = self._programs[middle_index:]
shuffle(a)
self._programs = a + b
program = self._programs[self._program_index]
print('***** load_program {} *****'.format(program._name))
loop = self._api.start_session()
......
Supports Markdown
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