if __name__ == '__main__': # Update configuration configuration['showplot'] = interactive if os.path.isdir(PLOT_DIR): print("{}/ is already a directory here...".format(PLOT_DIR)) elif os.path.isfile(PLOT_DIR): raise ValueError( "[ERROR] {} is a file, cannot use it as a directory !".format( PLOT_DIR)) else: mkdir(PLOT_DIR) evaluation = Evaluator(configuration, finalRanksOnAverage=finalRanksOnAverage, averageOn=averageOn) # Start the evaluation and then print final ranking and plot, for each environment N = len(evaluation.envs) for envId, env in enumerate(evaluation.envs): # # Plot histogram for rewards for that env # if do_plots and interactive: # env.plotHistogram(evaluation.horizon * evaluation.repetitions) # (almost) unique hash from the configuration hashvalue = abs( hash((tuple(configuration.keys()), tuple([(len(k) if isinstance(k, (dict, tuple, list)) else k) for k in configuration.values()]))))
from Environment import Evaluator from configuration import configuration evaluation = Evaluator(configuration) evaluation.start() evaluation.plotResults(0)
__version__ = "0.9" import sys if __name__ != '__main__': sys.exit(0) from Environment import Evaluator, notify if 'very_simple_configuration' in sys.argv or 'very_simple_configuration.py' in sys.argv: from very_simple_configuration import configuration else: from example_of_configuration_singleplayer import configuration configuration['showplot'] = True evaluation = Evaluator(configuration) # 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)