Exemplo n.º 1
0
        EV_list_Astar_time = copy.deepcopy(EV_list)
        CS_list_Astar_time = copy.deepcopy(CS_list)
        ta.every_time_check_refer_time(EV_list_Astar_time, CS_list_Astar_time,
                                       graph)

        EV_list_Astar_shortest = copy.deepcopy(EV_list)
        CS_list_Astar_shortest = copy.deepcopy(CS_list)
        ta.every_time_check_refer_shortest(EV_list_Astar_shortest,
                                           CS_list_Astar_shortest, graph)

        # ta.sim_result_text_ref(i, CS_list, graph, resultdir, EV_list_DQN_REF=EV_list_DQN_REF, EV_list_Astar_ref=EV_list_Astar_ref, EV_list_Astar_shortest=EV_list_Astar_shortest)
        ta.sim_result_text_last(i,
                                CS_list,
                                graph,
                                resultdir,
                                EV_list_DQN_REF=EV_list_DQN_REF,
                                EV_list_Astar_ref=EV_list_Astar_ref,
                                EV_list_optimal_ref=EV_list_optimal_ref,
                                EV_list_Astar_shortest=EV_list_Astar_shortest)

        ta.sim_result_general_presentation_last(
            i,
            graph,
            resultdir,
            npev,
            EV_list_DQN_REF=EV_list_DQN_REF,
            EV_list_Astar_ref=EV_list_Astar_ref,
            EV_list_optimal_ref=EV_list_optimal_ref)

        # ta.sim_result_general_presentation_ref(i, graph, resultdir, npev, EV_list_DQN_REF=EV_list_DQN_REF,EV_list_Astar_ref=EV_list_Astar_ref, EV_list_Astar_shortest=EV_list_Astar_shortest)
        # ta.sim_result_general_presentation_ref(i, graph, resultdir, npev, EV_list_Astar_time=EV_list_Astar_time,EV_list_Astar_ref=EV_list_Astar_ref, EV_list_Astar_shortest=EV_list_Astar_shortest)
Exemplo n.º 2
0
        EV_list_Greedy_short = copy.deepcopy(EV_list)
        CS_list_Greedy_short = copy.deepcopy(CS_list)
        ta.greedy_shortest_search(EV_list_Greedy_short, CS_list_Greedy_short,
                                  graph_test)
        #
        # EV_list_optimal_ref = copy.deepcopy(EV_list)
        # CS_list_optimal_ref = copy.deepcopy(CS_list)
        # EV_list_optimal_ref = ta.optimal_solution(EV_list_optimal_ref, CS_list_optimal_ref, graph_test)
        #
        # EV_list_Astar_time = copy.deepcopy(EV_list)
        # CS_list_Astar_time = copy.deepcopy(CS_list)
        # ta.every_time_check_refer_time(EV_list_Astar_time, CS_list_Astar_time, graph)
        #
        # EV_list_Astar_shortest = copy.deepcopy(EV_list)
        # CS_list_Astar_shortest = copy.deepcopy(CS_list)
        # ta.every_time_check_refer_shortest(EV_list_Astar_shortest, CS_list_Astar_shortest, graph)

        # ta.sim_result_text_ref(i, CS_list, graph, resultdir, EV_list_DQN_REF=EV_list_DQN_REF, EV_list_Astar_ref=EV_list_Astar_ref, EV_list_Astar_shortest=EV_list_Astar_shortest)
        ta.sim_result_text_last(i,
                                CS_list,
                                graph_test,
                                resultdir,
                                EV_list_DQN_REF=EV_list_DQN_REF,
                                EV_list_Greedy=EV_list_Greedy,
                                EV_list_Greedy_short=EV_list_Greedy_short)
        # ta.sim_result_general_presentation_ref(i, graph, resultdir, npev,  EV_list_DQN_REF=EV_list_DQN_REF, EV_list_Greedy=EV_list_Greedy)

        # ta.sim_result_general_presentation_ref(i, graph, resultdir, npev, EV_list_DQN_REF=EV_list_DQN_REF,EV_list_Astar_ref=EV_list_Astar_ref, EV_list_Astar_shortest=EV_list_Astar_shortest)
        # ta.sim_result_general_presentation_ref(i, graph, resultdir, npev, EV_list_Astar_time=EV_list_Astar_time,EV_list_Astar_ref=EV_list_Astar_ref, EV_list_Astar_shortest=EV_list_Astar_shortest)
Exemplo n.º 3
0
        fig = plt.gcf()
        fig.savefig('{}/train step.png'.format(resultdir), facecolor='#eeeeee', dpi=300)
        plt.clf()

###############################  performance evaluation  #############

    for i in range(5):

        npev=39
        EV_list, CS_list, graph = gen_test_envir_simple(npev)

        agent.epsilon = 0
        env = Env(graph, state_size, action_size)

        EV_list_DQN_REF = copy.deepcopy(EV_list)
        CS_list_DQN_REF = copy.deepcopy(CS_list)
        test_dqn(EV_list_DQN_REF, CS_list_DQN_REF, graph, env, agent)


        EV_list_Astar_ref = copy.deepcopy(EV_list)
        CS_list_Astar_ref = copy.deepcopy(CS_list)
        ta.every_time_check_refer(EV_list_Astar_ref, CS_list_Astar_ref, graph)

        EV_list_Astar_shortest = copy.deepcopy(EV_list)
        CS_list_Astar_shortest = copy.deepcopy(CS_list)
        ta.every_time_check_refer_shortest(EV_list_Astar_shortest, CS_list_Astar_shortest, graph)

        ta.sim_result_text_last(i, resultdir, EV_list_DQN_REF=EV_list_DQN_REF, EV_list_Astar_ref=EV_list_Astar_ref, EV_list_Astar_shortest=EV_list_Astar_shortest)
        ta.sim_result_general_presentation_last(i, graph, resultdir, npev, EV_list_DQN_REF=EV_list_DQN_REF, EV_list_Astar_ref=EV_list_Astar_ref, EV_list_Astar_shortest=EV_list_Astar_shortest)