# Path: visual/visual_util.py
# def interpolate_curve(orig_x, orig_y, new_x):
# def read_csv(filepath, skipfirst=True, convert2num=True):
# def read_topo(filepath, window=40):
# def hms_to_seconds(time_format):
# def examine_log_time(task, experiment):
# def examine_brute_force(task, experiment):
# def plot_curves(line_x, line_y, xlabel, ylabel, 
#                 title, legends=None, filename=None,
#                 fontsize=14,
#                 line_color=None,
#                 line_style=None,
#                 line_w=3.0,
#                 figsize=(8, 6)
#                ):
# def plot_curves_shaded(line_x, line_y, xlabel, ylabel,
#                        title, legends=None, filename=None,
#                        fontsize=14,
#                        line_color=None,
#                        line_style=None,
#                        line_w=3.0,
#                        sliding_window=5):
# def smooth_curve(x, y, window):
# def plot_curves_shadedV2(line_x, line_y, xlabel, ylabel,
#                        title, legends=None, filename=None,
#                        fontsize=14,
#                        line_color=None,
#                        line_style=None,
#                        line_w=3.0,
#                        sliding_window=5):
# def plot_curves_shaded_seaborn(line_x, line_y, xlabel, ylabel,
#                        title, legends=None, filename=None,
#                        fontsize=14,
#                        line_color=None,
#                        line_style=None,
#                        line_w=3.0,
#                        sliding_window=5):
# def plot_curves_shaded_seaborn_fish_rebuttal(line_x, line_y, xlabel, ylabel,
#                        title, legends=None, filename=None,
#                        fontsize=14,
#                        line_color=None,
#                        line_style=None,
#                        line_w=3.0,
#                        sliding_window=5):
# def plot_curves_shaded_seaborn_walker_rebuttal(line_x, line_y, xlabel, ylabel,
#                        title, legends=None, filename=None,
#                        fontsize=14,
#                        line_color=None,
#                        line_style=None,
#                        line_w=3.0,
#                        sliding_window=5):
# 
# Path: visual/visual_info.py
# USE_TIME_AS_X = 2
# BF_EVOLUTION = 1
# SINGLE_TOPO_FILE = 3


import init_path
import os
import glob
import argparse
import numpy as np
from copy import deepcopy
from visual import visual_util
from visual import visual_info
    task_list = list( task_data.keys() )
    
    if 'fishspeed' == task_name or 'walker-speed' == task_name:
        task_list.insert(0, task_list.pop(task_list.index('NGE')))
    if 'finetune' in task_name:
        task_list.insert(2, task_list.pop(task_list.index('Fixed')))
        task_list.insert(0, task_list.pop(task_list.index('NGE-Unconstrained')))
    if 'prune64_fish' in task_name:
        task_list.insert(0, task_list.pop(task_list.index('NGE+Pruning')))
        # task_list.insert(-1, task_list.pop(task_list.index('NGE')))
    if 'prune64_walker' in task_name:
        task_list.insert(0, task_list.pop(task_list.index('NGE+Pruning')))
        # task_list.insert(-1, task_list.pop(task_list.index('NGE')))
    if 'reset' in task_name:
        task_list.insert(0, task_list.pop(task_list.index('Reset')))


    for i, name_exp in enumerate(task_list):
        data_exp = task_data[name_exp]
        
        if 'Fixed' in name_exp or 'nnpp' in task_name:
            lines_x += [data_exp['x1']]
            lines_y += [data_exp['reward']]
            style += ['-']
            color += [visual_util.con_color[i]] * 1
            legends += [('%s' % name_exp)]
        elif 'bump' in name_exp:
            lines_x += [data_exp['x2'], data_exp['x1']]
            lines_y += [data_exp['max_r'], data_exp['avg_r']]
            style += ['--', '-']

# Path: visual/visual_util.py
# def interpolate_curve(orig_x, orig_y, new_x):
# def read_csv(filepath, skipfirst=True, convert2num=True):
# def read_topo(filepath, window=40):
# def hms_to_seconds(time_format):
# def examine_log_time(task, experiment):
# def examine_brute_force(task, experiment):
# def plot_curves(line_x, line_y, xlabel, ylabel, 
#                 title, legends=None, filename=None,
#                 fontsize=14,
#                 line_color=None,
#                 line_style=None,
#                 line_w=3.0,
#                 figsize=(8, 6)
#                ):
# def plot_curves_shaded(line_x, line_y, xlabel, ylabel,
#                        title, legends=None, filename=None,
#                        fontsize=14,
#                        line_color=None,
#                        line_style=None,
#                        line_w=3.0,
#                        sliding_window=5):
# def smooth_curve(x, y, window):
# def plot_curves_shadedV2(line_x, line_y, xlabel, ylabel,
#                        title, legends=None, filename=None,
#                        fontsize=14,
#                        line_color=None,
#                        line_style=None,
#                        line_w=3.0,
#                        sliding_window=5):
# def plot_curves_shaded_seaborn(line_x, line_y, xlabel, ylabel,
#                        title, legends=None, filename=None,
#                        fontsize=14,
#                        line_color=None,
#                        line_style=None,
#                        line_w=3.0,
#                        sliding_window=5):
# def plot_curves_shaded_seaborn_fish_rebuttal(line_x, line_y, xlabel, ylabel,
#                        title, legends=None, filename=None,
#                        fontsize=14,
#                        line_color=None,
#                        line_style=None,
#                        line_w=3.0,
#                        sliding_window=5):
# def plot_curves_shaded_seaborn_walker_rebuttal(line_x, line_y, xlabel, ylabel,
#                        title, legends=None, filename=None,
#                        fontsize=14,
#                        line_color=None,
#                        line_style=None,
#                        line_w=3.0,
#                        sliding_window=5):
# 
# Path: visual/visual_info.py
# USE_TIME_AS_X = 2
# BF_EVOLUTION = 1
# SINGLE_TOPO_FILE = 3


# Path: visual/vis_data.py
import init_path
import os
import glob
import argparse
import numpy as np
from copy import deepcopy
from visual import visual_util
from visual import visual_info

    task_list = list( task_data.keys() )
    
    if 'fishspeed' == task_name or 'walker-speed' == task_name:
        task_list.insert(0, task_list.pop(task_list.index('NGE')))
    if 'finetune' in task_name:
        task_list.insert(2, task_list.pop(task_list.index('Fixed')))
        task_list.insert(0, task_list.pop(task_list.index('NGE-Unconstrained')))
    if 'prune64_fish' in task_name:
        task_list.insert(0, task_list.pop(task_list.index('NGE+Pruning')))
        # task_list.insert(-1, task_list.pop(task_list.index('NGE')))
    if 'prune64_walker' in task_name:
        task_list.insert(0, task_list.pop(task_list.index('NGE+Pruning')))
        # task_list.insert(-1, task_list.pop(task_list.index('NGE')))
    if 'reset' in task_name:
        task_list.insert(0, task_list.pop(task_list.index('Reset')))


    for i, name_exp in enumerate(task_list):
        data_exp = task_data[name_exp]
        
        if 'Fixed' in name_exp or 'nnpp' in task_name:
            lines_x += [data_exp['x1']]
            lines_y += [data_exp['reward']]
            style += ['-']
            color += [visual_util.con_color[i]] * 1
            legends += [('%s' % name_exp)]
        elif 'bump' in name_exp:
            lines_x += [data_exp['x2'], data_exp['x1']]
            lines_y += [data_exp['max_r'], data_exp['avg_r']]
            style += ['--', '-']

            color += [visual_util.con_color[i], visual_util.con_color[i+1]]