def evaluate_sequential_all(agent_type, env, agent, data_size, verbose=True):
    num_positive = 0
    num_negative = 0
    total_profit = 0.0
    total_steps = 0
    num_episodes = 0
    env.transaction_state_idx = 0
    while True:
        num_episodes += 1
        (profit, step) = evaluate(env, agent, verbose=False)
        if (profit > 0):
            num_positive += 1
        else:
            num_negative += 1
        total_profit += profit
        total_steps += step
        if (env.transaction_state_idx >= (data_size - 1)):
            break
    avg_num_steps_per_episode = (total_steps / num_episodes)
    if verbose:
        print('###[{0:6}] POSITIVE: {1}/{3}, NEGATIVE: {2}/{3}, TOTAL PROFIT: {4:.1f}, AVG. STEP FOR EPISODE: {5:.1f}'.format(agent_type, num_positive, num_negative, num_episodes, total_profit, avg_num_steps_per_episode))
    return (num_positive, num_negative, num_episodes, total_profit, avg_num_steps_per_episode)
def evaluate_sequential_all(agent_type, env, agent, data_size, verbose=True):
    num_positive = 0
    num_negative = 0
    total_profit = 0.0
    total_steps = 0
    num_episodes = 0
    env.transaction_state_idx = 0
    while True:
        num_episodes += 1
        (profit, step) = evaluate(env, agent, verbose=False)
        if (profit > 0):
            num_positive += 1
        else:
            num_negative += 1
        total_profit += profit
        total_steps += step
        if (env.transaction_state_idx >= (data_size - 1)):
            break
    avg_num_steps_per_episode = (total_steps / num_episodes)
    if verbose:
        print('###[{0:6}] POSITIVE: {1}/{3}, NEGATIVE: {2}/{3}, TOTAL PROFIT: {4:.1f}, AVG. STEP FOR EPISODE: {5:.1f}'.format(agent_type, num_positive, num_negative, num_episodes, total_profit, avg_num_steps_per_episode))
    return (num_positive, num_negative, num_episodes, total_profit, avg_num_steps_per_episode)