# Path: pyrl/tasktools.py
# def generate_ei(N, pE=0.8):
# def to_map(*args):
# def get_idx(t, (start, end)):
# def get_epochs_idx(dt, epochs):
# def choice(rng, a):
# def unravel_index(i, dims):
# def uniform(rng, dt, xmin, xmax):
# def truncated_exponential(rng, dt, mean, xmin=0, xmax=np.inf):
# def divide(x, y):
# def correct_2AFC(perf):
#     def __init__(self):
#     EXC = idx[:Nexc]
#     INH = idx[Nexc:]
# class Task(object):


import numpy as np
from pyrl import tasktools
                status['correct'] = (rL >= rR)
                reward = rL
            elif a == actions['CHOOSE-RIGHT']:
                if juiceR == 'A':
                    status['choice'] = 'A'
                else:
                    status['choice'] = 'B'
                status['correct'] = (rR >= rL)
                reward = rR

    #-------------------------------------------------------------------------------------
    # Inputs
    #-------------------------------------------------------------------------------------

    u = np.zeros(len(inputs))
    if t not in epochs['decision']:
        u[inputs['FIXATION']] = 1
    if t in epochs['offer-on']:
        juiceL, juiceR = trial['juice']
        u[inputs['L-'+juiceL]] = 1
        u[inputs['R-'+juiceR]] = 1

        u[inputs['N-L']] = scale(trial['nL']) + rng.normal(scale=sigma)/np.sqrt(dt)
        u[inputs['N-R']] = scale(trial['nR']) + rng.normal(scale=sigma)/np.sqrt(dt)

    #-------------------------------------------------------------------------------------

    return u, reward, status

def terminate(perf):

# Path: pyrl/tasktools.py
# def generate_ei(N, pE=0.8):
# def to_map(*args):
# def get_idx(t, (start, end)):
# def get_epochs_idx(dt, epochs):
# def choice(rng, a):
# def unravel_index(i, dims):
# def uniform(rng, dt, xmin, xmax):
# def truncated_exponential(rng, dt, mean, xmin=0, xmax=np.inf):
# def divide(x, y):
# def correct_2AFC(perf):
#     def __init__(self):
#     EXC = idx[:Nexc]
#     INH = idx[Nexc:]
# class Task(object):


# Path: examples/models/padoaschioppa2006_1A3B.py
import numpy as np
from pyrl import tasktools

                status['correct'] = (rL >= rR)
                reward = rL
            elif a == actions['CHOOSE-RIGHT']:
                if juiceR == 'A':
                    status['choice'] = 'A'
                else:
                    status['choice'] = 'B'
                status['correct'] = (rR >= rL)
                reward = rR

    #-------------------------------------------------------------------------------------
    # Inputs
    #-------------------------------------------------------------------------------------

    u = np.zeros(len(inputs))
    if t not in epochs['decision']:
        u[inputs['FIXATION']] = 1
    if t in epochs['offer-on']:
        juiceL, juiceR = trial['juice']
        u[inputs['L-'+juiceL]] = 1
        u[inputs['R-'+juiceR]] = 1

        u[inputs['N-L']] = scale(trial['nL']) + rng.normal(scale=sigma)/np.sqrt(dt)
        u[inputs['N-R']] = scale(trial['nR']) + rng.normal(scale=sigma)/np.sqrt(dt)

    #-------------------------------------------------------------------------------------

    return u, reward, status

def terminate(perf):

    p_decision, p_correct = tasktools.correct_2AFC(perf)