Commit 93fc8044 authored by Jan Kiene's avatar Jan Kiene
Browse files

implement start_br for exhaustive strategy

parent 1d16f57e
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -104,8 +104,6 @@ def create_br_switching_pattern(
    # if no seed given, compute it from other parameters, so that same params => same seed
    if seed is None:
        seed = brs.sum() + STRATEGIES.index(strategy) + switch_time + length_frames
        if starting_br is not None:
            seed += starting_br
    random.seed(seed)

    if strategy == "exhaustive":
@@ -116,6 +114,15 @@ def create_br_switching_pattern(
            random.shuffle(split_permuts[i])
        split_permuts = np.asarray(split_permuts)
        brs = np.concatenate([split_permuts[:, i] for i in range(n)])

        if starting_br is not None:
            # brs is still a 2-D array here
            # find first row with starting br in first column, then roll array by that amount
            i_row, i_col = np.where(brs == starting_br)
            idx_col = np.where(i_col == 0)[0][0]
            shift = i_row[idx_col]
            brs = np.roll(brs, -shift, axis=0)

    elif strategy == "random":
        brs = list()