def test_plot_summary(self): # tes data test_dir = "./analyzer_test_data/arabas_et_al-f1/seed_0/pop_100/" test_data_1 = "0.8-0.8.zip" test_1_fp = os.path.join(test_dir, test_data_1) test_data_2 = "0.8-0.7.zip" test_2_fp = os.path.join(test_dir, test_data_2) # summarize data test_data_1 = analyzer.summarize_data(test_1_fp) test_data_2 = analyzer.summarize_data(test_2_fp) data = [test_data_1, test_data_2] labels = [ "c_prob = 0.8, mut_prob = 0.8", "c_prob = 0.8, mut_prob = 0.7" ] analyzer.plot_summary(data, labels)
def test_plot_summary(self): # tes data test_dir = "./analyzer_test_data/arabas_et_al-f1/seed_0/pop_100/" test_data_1 = "0.8-0.8.zip" test_1_fp = os.path.join(test_dir, test_data_1) test_data_2 = "0.8-0.7.zip" test_2_fp = os.path.join(test_dir, test_data_2) # summarize data test_data_1 = analyzer.summarize_data(test_1_fp) test_data_2 = analyzer.summarize_data(test_2_fp) data = [test_data_1, test_data_2] labels = [ "c_prob = 0.8, mut_prob = 0.8", "c_prob = 0.8, mut_prob = 0.7" ] analyzer.plot_summary(data, labels)
def test_summarize_data_min_level(self): # pass test result = analyzer.summarize_data(data_file) # import pprint # pprint.pprint(result) self.assertIsNotNone(result) self.assertTrue(len(result["population"]["generation"]), 11) self.assertTrue(len(result["population"]["best_score"]), 11) self.assertTrue(len(result["population"]["best_individual"]), 11) self.assertTrue(len(result["crossover"]["crossovers"]), 11) self.assertTrue(len(result["crossover"]["no_crossovers"]), 11) self.assertTrue(len(result["mutation"]["mutations"]), 11) self.assertTrue(len(result["mutation"]["no_mutations"]), 11)
def test_summarize_data_min_level(self): # pass test result = analyzer.summarize_data(data_file) # import pprint # pprint.pprint(result) self.assertIsNotNone(result) self.assertTrue(len(result["population"]["generation"]), 11) self.assertTrue(len(result["population"]["best_score"]), 11) self.assertTrue(len(result["population"]["best_individual"]), 11) self.assertTrue(len(result["crossover"]["crossovers"]), 11) self.assertTrue(len(result["crossover"]["no_crossovers"]), 11) self.assertTrue(len(result["mutation"]["mutations"]), 11) self.assertTrue(len(result["mutation"]["no_mutations"]), 11)
def test_summarize_data_max_level(self): # test data test_dir = "./analyzer_test_data/arabas_et_al-f1/seed_0/pop_100/" test_data = "0.8-0.8.zip" test_fp = os.path.join(test_dir, test_data) test_fp = os.path.normpath(test_fp) # summarize data result = analyzer.summarize_data(test_fp) # import pprint # pprint.pprint(result) # self.assertIsNotNone(result) self.assertTrue(len(result["population"]["generation"]), 14) self.assertTrue(len(result["population"]["best_score"]), 14) self.assertTrue(len(result["population"]["best_individual"]), 14) self.assertTrue(len(result["crossover"]["crossovers"]), 14) self.assertTrue(len(result["crossover"]["no_crossovers"]), 14) self.assertTrue(len(result["mutation"]["mutations"]), 14) self.assertTrue(len(result["mutation"]["no_mutations"]), 14)
def test_summarize_data_max_level(self): # test data test_dir = "./analyzer_test_data/arabas_et_al-f1/seed_0/pop_100/" test_data = "0.8-0.8.zip" test_fp = os.path.join(test_dir, test_data) test_fp = os.path.normpath(test_fp) # summarize data result = analyzer.summarize_data(test_fp) # import pprint # pprint.pprint(result) # self.assertIsNotNone(result) self.assertTrue(len(result["population"]["generation"]), 14) self.assertTrue(len(result["population"]["best_score"]), 14) self.assertTrue(len(result["population"]["best_individual"]), 14) self.assertTrue(len(result["crossover"]["crossovers"]), 14) self.assertTrue(len(result["crossover"]["no_crossovers"]), 14) self.assertTrue(len(result["mutation"]["mutations"]), 14) self.assertTrue(len(result["mutation"]["no_mutations"]), 14)