def run_experiments(self): for exp in range(conf.max_experiments): random.seed(exp) self.actual_time = 0.0 self.pop = XCSClassifierSet(self.env, self.actual_time) self.init() for iteration in range(conf.max_iterations): self.run_explor() self.run_exploit(iteration) print "now" + str(exp) self.file_writer(exp) self.performance_writer(exp) self.make_graph()
['40%', '50%', '60%', '70%', '80%', '90%', '100%', '']) ax.grid() filenamepng = "performance.png" plt.savefig(filenamepng, dpi=150) filenameeps = "performance.eps" plt.savefig(filenameeps) plt.show() if __name__ == '__main__': """ print("main start") xcs = XCSProgram() print("initialized XCSProgram") xcs.run_experiments() """ xcs = XCSProgram() xcs.pop = XCSClassifierSet(xcs.env, 0.0) xcs.init() xcs.env.set_state() xcs.match_set = XCSMatchSet(pop, xcs.env, 0.0) xcs.generate_prediction_array() xcs.match_set = XCSMatchSet(xcs.pop, xcs.env, 0.0) xcs.generate_prediction_array() xcs.select_action() xcs.action_set = XCSActionSet(xcs.match_set, xcs.action, xcs.env, 0.0) actset = xcs.action_set.get_cls() actset = xcs.action_set.get_cls() actset[0].get_cond()