예제 #1
0
        # --- Also plotting the history of means
        if saveallfigs:
            savefig = mainfig.replace('main', 'main_HistoryOfMeans')
            print(
                " - Plotting the history of means, and saving the plot to {} ..."
                .format(savefig))
            evaluation.plotHistoryOfMeans(
                envId, savefig=savefig)  # XXX To save the figure
        else:
            evaluation.plotHistoryOfMeans(envId)  # XXX To plot without saving

        # --- Also plotting the boxplot of last regrets
        if saveallfigs:
            savefig = mainfig.replace('main', 'main_BoxPlotRegret')
            evaluation.plotLastRegrets(envId, boxplot=True, savefig=savefig)
        else:
            evaluation.plotLastRegrets(
                envId, boxplot=True)  # XXX To plot without saving

        # --- Also plotting the running times
        if saveallfigs:
            savefig = mainfig.replace('main', 'main_RunningTimes')
            print(
                " - Plotting the running times, and saving the plot to {} ...".
                format(savefig))
            evaluation.plotRunningTimes(
                envId, savefig=savefig)  # XXX To save the figure
        else:
            evaluation.plotRunningTimes(envId)  # XXX To plot without saving
# Start the evaluation and then print final ranking and plot, for each environment
for envId, env in enumerate(evaluation.envs):
    # Evaluate just that env
    evaluation.startOneEnv(envId, env)

# Compare them
for envId, env in enumerate(evaluation.envs):
    evaluation.plotHistoryOfMeans(envId)  # XXX To plot without saving

    print("\nGiving all the vector of final regrets ...")
    evaluation.printLastRegrets(envId)
    print("\nGiving the final ranking ...")
    evaluation.printFinalRanking(envId)

    print("\n\n- Plotting the last regrets...")
    evaluation.plotLastRegrets(envId, boxplot=True)

    print("\nGiving the mean and std running times ...")
    evaluation.printRunningTimes(envId)
    evaluation.plotRunningTimes(envId)

    print("\nGiving the mean and std running times ...")
    evaluation.printMemoryConsumption(envId)
    evaluation.plotMemoryConsumption(envId)

    print("\n\n- Plotting the mean reward...")
    evaluation.plotRegrets(envId, meanReward=True)

    print("\n\n- Plotting the regret...")
    evaluation.plotRegrets(envId)