Esempio n. 1
0
def quality(problem_runs):
    """IPC score."""
    min_cost = reports.minimum(run.get('cost') for run in problem_runs)
    for run in problem_runs:
        cost = run.get('cost')
        if cost is None or not run.get('coverage'):
            quality = 0.0
        elif cost == 0:
            assert min_cost == 0
            quality = 1.0
        else:
            quality = min_cost / cost
        run['quality'] = round(quality, 4)
Esempio n. 2
0
    def print_domain(self, domain, problems):
        print r"\section*{%s %s --- %s}" % (
            escape(self.attribute_name), escape(domain), get_date_and_time())
        print r"\tablehead{\hline"
        print r"\textbf{prob}"
        for config in self.configs:
            print r"& %s\textbf{%s}" % (self._tiny_if_squeeze(),
                                        escape(config))
        if self.best_value_column:
            print r"& %s\textbf{BEST}" % self._tiny_if_squeeze()
        print r"\\ \hline}"
        print r"\tabletail{\hline}"
        column_desc = "|l|%s|" % ("r" * len(self.configs))
        if self.best_value_column:
            column_desc += "r|"
        print r"\begin{supertabular}{%s}" % column_desc

        for problem in problems:
            problem_runs = self.problem_runs[(domain, problem)]
            print r"\textbf{%s}" % problem.replace('.pddl', '')
            scores = []
            for run in problem_runs:
                if self.score == 'quality':
                    quality = run.get('quality')
                    scores.append(quality)
                print r"& %s" % self._format_result(run)
            if self.best_value_column:
                if self.score == 'quality':
                    best = max(scores)
                else:
                    values = [run.get(self.attribute) for run in problem_runs]
                    best = reports.minimum(values)
                print r"& %s" % ("---" if best is None else best)
            print r"\\"
        print r"\hline"
        print r"\textbf{total}"
        for config in self.configs:
            print r"& \textbf{%.2f}" % self.total_scores[config, domain]
        if self.best_value_column:
            print r"&"
        print r"\\"
        print r"\end{supertabular}"