MCPcopy Create free account
hub / github.com/brain-workshop/brainworkshop / compute_bt_sequence

Function compute_bt_sequence

brainworkshop.py:4103–4141  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4101## mode.bt_sequence = seq.values()
4102
4103def compute_bt_sequence():
4104 bt_sequence = [[], []]
4105 for x in range(0, mode.num_trials_total):
4106 bt_sequence[0].append(0)
4107 bt_sequence[1].append(0)
4108
4109 for x in range(0, mode.back):
4110 bt_sequence[0][x] = random.randint(1, 8)
4111 bt_sequence[1][x] = random.randint(1, 8)
4112
4113 position = 0
4114 audio = 0
4115 both = 0
4116
4117 # brute force it
4118 while True:
4119 position = 0
4120 for x in range(mode.back, mode.num_trials_total):
4121 bt_sequence[0][x] = random.randint(1, 8)
4122 if bt_sequence[0][x] == bt_sequence[0][x - mode.back]:
4123 position += 1
4124 if position != 6:
4125 continue
4126 while True:
4127 audio = 0
4128 for x in range(mode.back, mode.num_trials_total):
4129 bt_sequence[1][x] = random.randint(1, 8)
4130 if bt_sequence[1][x] == bt_sequence[1][x - mode.back]:
4131 audio += 1
4132 if audio == 6:
4133 break
4134 both = 0
4135 for x in range(mode.back, mode.num_trials_total):
4136 if bt_sequence[0][x] == bt_sequence[0][x - mode.back] and bt_sequence[1][x] == bt_sequence[1][x - mode.back]:
4137 both += 1
4138 if both == 2:
4139 break
4140
4141 mode.bt_sequence = bt_sequence
4142
4143player = get_pyglet_media_Player()
4144player2 = get_pyglet_media_Player()

Callers 1

new_sessionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected