# Path: util/logger.py
# class _MyFormatter(logging.Formatter):
#     def format(self, record):
# def set_file_handler(path=None, prefix='', time_str=''):
# _LOGGING_METHOD = ['info', 'warning', 'error', 'critical',
#                    'warn', 'exception', 'debug']
# 
# Path: util/visdom_util.py
# def visdom_initialize(args):
# def visdom_plot_curve(it, val, viz_win=None, title=''):
# def visdom_print_info(str_list, mytitle):
# def viz_line(i, vals, viz_win=None, 
#              title='', xlabel='', ylabel='', 
#              legend=None):
# def vis_stem_as_hist(samples):
# def vis_hist_plot(i, samples, viz_win=None, title='', numbin=20):
#     X = [np.array([i]) for _ in range(data_num)]
#     Y = [np.array([val]) for val in vals]
#         X = np.column_stack(X)
#         Y = np.column_stack(Y)
#         X = X[-1]
#         Y = Y[-1]


import init_path
import numpy as np
from util import logger
from sklearn.decomposition import PCA
from util import visdom_util
        logger.error('Need to set up visdom to visualize analysis')
        return -1
    if i_gen == 0:
        plot_item = ['reward', 
                     'size_dist', 'pc_relationship', 'angle_range',
                     'pca_size_eigenvalue', 'size_v_dist', 'size_v_line',
                     'pca_pc_eigenvalue',
                     'body_num_line', 'body_size_line']
        analyse_gen.win_dict = {item: None for item in plot_item}

    title_module = '%s %s' % (args.time_id, args.task) + '-%s'

    required_info = ['AvgRwd', 'adj_matrix', 'node_attr']
    species_book = {}

    # parse the species list for required info
    for i, species in enumerate(all_species):
        species_book[i] = {}
        for item in required_info:
            species_book[i][item] = species[item]

    # reward
    gen_reward = [v['AvgRwd'] for k, v in species_book.items()]
    gen_reward = np.array(gen_reward)
    if len(gen_reward) == 0:
        return -1
    avg_r = float(gen_reward.mean())
    max_r = float(gen_reward.max())
    min_r = float(gen_reward.min())
    analyse_gen.win_dict['reward'] =  \

# Path: util/logger.py
# class _MyFormatter(logging.Formatter):
#     def format(self, record):
# def set_file_handler(path=None, prefix='', time_str=''):
# _LOGGING_METHOD = ['info', 'warning', 'error', 'critical',
#                    'warn', 'exception', 'debug']
# 
# Path: util/visdom_util.py
# def visdom_initialize(args):
# def visdom_plot_curve(it, val, viz_win=None, title=''):
# def visdom_print_info(str_list, mytitle):
# def viz_line(i, vals, viz_win=None, 
#              title='', xlabel='', ylabel='', 
#              legend=None):
# def vis_stem_as_hist(samples):
# def vis_hist_plot(i, samples, viz_win=None, title='', numbin=20):
#     X = [np.array([i]) for _ in range(data_num)]
#     Y = [np.array([val]) for val in vals]
#         X = np.column_stack(X)
#         Y = np.column_stack(Y)
#         X = X[-1]
#         Y = Y[-1]


# Path: evolution/evo_analysis.py
import init_path
import numpy as np
from util import logger
from sklearn.decomposition import PCA
from util import visdom_util

        logger.error('Need to set up visdom to visualize analysis')
        return -1
    if i_gen == 0:
        plot_item = ['reward', 
                     'size_dist', 'pc_relationship', 'angle_range',
                     'pca_size_eigenvalue', 'size_v_dist', 'size_v_line',
                     'pca_pc_eigenvalue',
                     'body_num_line', 'body_size_line']
        analyse_gen.win_dict = {item: None for item in plot_item}

    title_module = '%s %s' % (args.time_id, args.task) + '-%s'

    required_info = ['AvgRwd', 'adj_matrix', 'node_attr']
    species_book = {}

    # parse the species list for required info
    for i, species in enumerate(all_species):
        species_book[i] = {}
        for item in required_info:
            species_book[i][item] = species[item]

    # reward
    gen_reward = [v['AvgRwd'] for k, v in species_book.items()]
    gen_reward = np.array(gen_reward)
    if len(gen_reward) == 0:
        return -1
    avg_r = float(gen_reward.mean())
    max_r = float(gen_reward.max())
    min_r = float(gen_reward.min())
    analyse_gen.win_dict['reward'] =  \

        visdom_util.viz_line(i_gen, [max_r, avg_r, min_r],