Example #1
0
def run_experiment(agents, envs, episode=100, train_after_every=10, save_trajectory_every=100, report_after_every=10):
    try:
        for agent in agents:
            for env in envs:
                logger.info("Begin {} vs {}".format(str(agent), str(env)))
                manager = Manager(agent, env)
                manager.run(episode, train_after_every, save_trajectory_every, report_after_every=report_after_every)
                manager.report()
    except:
        logger.error(traceback.format_exc())
Example #2
0
File: main.py Project: KPiasta/ZPI
def main():
    name = ""
    surname = ""
    param = 0
    path = ""
    query = ''
    lower = 0
    upper = 0
    path_2 = ""

    if len(sys.argv) == 4:
        query = sys.argv[1]
        path = sys.argv[2]
        param = sys.argv[3]
    elif len(sys.argv) == 7:
        query = sys.argv[1]
        path = sys.argv[2]
        param = sys.argv[3]
        lower = sys.argv[4]
        upper = sys.argv[5]
        path_2  = sys.argv[6]

    if param == '0':

        if query is not None:
            query_list = query.split(" ")
            if len(query_list) >= 2:
                name = query_list[0].strip()
                surname = query[len(name):].strip()
            else:
                name = ""
                surname = query
        manager = Manager(name, surname)
        ms.run_individual(manager, surname)
        wiki1.run(manager, query)
        generic.get_raw(manager, query)

        manager.run(path)

    elif param == '1':

        if query is not None:
            query_list = query.split(" ")
            if len(query_list) >= 2:
                name = query_list[0].strip()
                surname = query[len(name):].strip()
            else:
                name = ""
                surname = query
        manager = Manager(name, surname)
        ms.run_list_artists(manager, surname)
        wiki1.get_list(manager, query)

        manager.run_list(path)

    elif param == '2':

        manager = Manager("", "")
        ms.run_list_kategory(manager, query)
        wiki1.get_list_kategory(manager, query)
        manager.run_list(path)

    elif param == '3':

        lower_int = int(lower)
        upper_int = int(upper)
        manager = Manager("", "")
        wiki1.get_images_with_index(path, path_2, lower_int, upper_int)