def __init__(self, *args, **kwargs): Table.__init__(self, *args, **kwargs) if self.title in ['search_time', 'total_time']: self.add_summary_function('GEOMETRIC MEAN', reports.gm) else: self.add_summary_function('SUM', sum) if 'score' in self.title: # When summarising score results from multiple domains we show # normalised averages so that each domain is weighed equally. self.add_summary_function('AVERAGE', reports.avg)
def build_tables(): def tuple2string(t): s = "" for x in t: s = s + x + "/" return s tables = {} for what, group in ds.groups("what"): t = Table(what) for cfg, res in group.groups("config","domain","problem"): t.add_cell('title', tuple2string(cfg), 'title ' + tuple2string(cfg)) for r in res: t.add_cell(str(r['start_time']), tuple2string(cfg), r['value']) tables[what] = t return tables
def _get_table(self): table = PlanningReport._get_table(self) if self.resolution == 'domain': self.set_grouping('domain') for (domain, ), group in self.group_dict.items(): values = Table() config_prob_to_group = group.group_dict('config', 'problem') for (config, problem), subgroup in config_prob_to_group.items(): vals = subgroup[self.focus] assert len(vals) == 1 val = vals[0] values.add_cell(problem, config, val) (config1, config2), sums = values.get_comparison() table.add_cell(domain, config1 + '/' + config2, '%d - %d - %d' % tuple(sums)) elif self.resolution == 'problem': logging.error( 'Comparative reports only make sense for domains and suites') sys.exit(1) if self.resolution == 'suite' or not self.hide_sum_row: if self.resolution == 'suite': row_name = '-'.join(self.suite) if self.suite else 'Suite' else: row_name = 'SUM' self.set_grouping() for _, group in self.group_dict.items(): values = Table() config_prob_to_group = group.group_dict( 'config', 'domain', 'problem') for (config, domain, problem), subgroup in config_prob_to_group.items(): vals = subgroup[self.focus] assert len(vals) == 1 val = vals[0] values.add_cell(domain + ':' + problem, config, val) (config1, config2), sums = values.get_comparison() table.add_cell(row_name, config1 + '/' + config2, '%d - %d - %d' % tuple(sums)) return table
def build_tables(): def tuple2string(t): s = "" for x in t: s = s + x + "/" return s tables = {} for what, group in ds.groups("what"): t = Table(what) for cfg, res in group.groups("config", "domain", "problem"): t.add_cell('title', tuple2string(cfg), 'title ' + tuple2string(cfg)) for r in res: t.add_cell(str(r['start_time']), tuple2string(cfg), r['value']) tables[what] = t return tables
def __str__(self): text = Table.__str__(self) if 'score' in self.focus: text += self.get_normalized_avg_row() return text
def __init__(self, *args, **kwargs): Table.__init__(self, *args, **kwargs) self.focus = self.title