示例#1
0
    def __init__(self, algorithm_pairs, **kwargs):
        """
        See :py:class:`AbsoluteReport <downward.reports.absolute.AbsoluteReport>`
        for inherited parameters.

        *algorithm_pairs* is the list of algorithm pairs you want to
        compare.

        All columns in the report will be arranged such that the
        compared algorithms appear next to each other. After the two
        columns containing absolute values for the compared algorithms,
        a third column ("Diff") is added showing the difference between
        the two values.

        Algorithms may appear in multiple comparisons. Algorithms not
        mentioned in *algorithm_pairs* are not included in the report.

        If you want to compare algorithms A and B, instead of a pair
        ``('A', 'B')`` you may pass a triple ``('A', 'B', 'A vs.
        B')``. The third entry of the triple will be used as the name
        of the corresponding "Diff" column.

        For example, if the properties file contains algorithms A, B, C
        and D and *algorithm_pairs* is ``[('A', 'B', 'Diff BA'), ('A',
        'C')]`` the resulting columns will be A, B, Diff BA (contains B
        - A), A, C , Diff (contains C - A).

        Example:

        >>> from downward.experiment import FastDownwardExperiment
        >>> exp = FastDownwardExperiment()
        >>> algorithm_pairs = [
        ...     ('default-lmcut', 'issue123-lmcut', 'Diff lmcut')]
        >>> exp.add_report(ComparativeReport(
        ...     algorithm_pairs, attributes=['coverage']))

        Example output:

            +----------+---------------+----------------+------------+
            | coverage | default-lmcut | issue123-lmcut | Diff lmcut |
            +==========+===============+================+============+
            | depot    |            15 |             17 |          2 |
            +----------+---------------+----------------+------------+
            | gripper  |             7 |              6 |         -1 |
            +----------+---------------+----------------+------------+

        """
        if 'filter_algorithm' in kwargs:
            logging.critical(
                'ComparativeReport doesn\'t support "filter_algorithm". '
                'Use "algorithm_pairs" to select and order algorithms.')
        if algorithm_pairs:
            algos = set()
            for tup in algorithm_pairs:
                for algo in tup[:2]:
                    algos.add(algo)
            kwargs['filter_algorithm'] = algos
        AbsoluteReport.__init__(self, **kwargs)
        self._algorithm_pairs = algorithm_pairs
    def __init__(self, nick, output_file, **kwargs):

        AbsoluteReport.__init__(self, **kwargs)
        #add new attributes to list
        self.derived_properties.append(hstar_to_h)
        self.derived_properties.append(statistics)
        self.derived_properties.append(commualtive_hstar_to_h)
        self.nick = 'WORK-' + nick
        self.outFile = output_file
示例#3
0
    def __init__(self, baseline, checks, **kwargs):
        """
        *baseline* must be a global revision identifier.

        *checks must be an iterable of Check instances.*
        """
        AbsoluteReport.__init__(self, **kwargs)
        self.baseline = baseline
        self.checks = checks
示例#4
0
    def __init__(self, baseline, checks, **kwargs):
        """
        *baseline* must be a global revision identifier.

        *checks must be an iterable of Check instances.*
        """
        AbsoluteReport.__init__(self, **kwargs)
        self.baseline = baseline
        self.checks = checks
示例#5
0
    def __init__(self, nick, output_file, **kwargs):

        AbsoluteReport.__init__(self, **kwargs)
        #add new attributes to list
        self.derived_properties.append(hstar_to_h)
        self.derived_properties.append(statistics)
        self.derived_properties.append(commualtive_hstar_to_h)
        self.nick = 'WORK-'+nick
        self.outFile = output_file
示例#6
0
    def __init__(self, resolution, rel_change=0.0, abs_change=0, **kwargs):
        """
        Compare exactly two configurations. For each problem and attribute
        add a table row with the two absolute values and their quotient.

        *resolution* must be one of "domain" or "problem".

        Only include pairs of attribute values x and y if
        abs(y/x - 1) >= *rel_change*.

        Only add pairs of values to the result if their absolute difference is
        bigger than *abs_change*.

        If neither *rel_change* nor *abs_change* are given, no problem rows are
        filtered out.
        """
        AbsoluteReport.__init__(self, resolution, **kwargs)
        self.rel_change = rel_change
        self.abs_change = abs_change
示例#7
0
    def __init__(self, resolution, rel_change=0.0, abs_change=0, **kwargs):
        """
        Compare exactly two configurations. For each problem and attribute
        add a table row with the two absolute values and their quotient.

        *resolution* must be one of "domain" or "problem".

        Only include pairs of attribute values x and y if
        abs(y/x - 1) >= *rel_change*.

        Only add pairs of values to the result if their absolute difference is
        bigger than *abs_change*.

        If neither *rel_change* nor *abs_change* are given, no problem rows are
        filtered out.
        """
        AbsoluteReport.__init__(self, resolution, **kwargs)
        self.rel_change = rel_change
        self.abs_change = abs_change
示例#8
0
    def __init__(self, compared_configs, **kwargs):
        """
        See :py:class:`AbsoluteReport <downward.reports.absolute.AbsoluteReport>`
        for inherited parameters.

        *compared_configs* is a list of tuples of 2 or 3 elements. The first two entries
        in each tuple are configs that should be compared. If a third entry is present it
        is used as the name of the column showing the difference between the two configs.
        Otherwise the column will be named 'Diff'.
        All columns in the report will be arranged such that the configurations that are
        compared are next to each other. After those two columns a diff column is added
        that shows the difference between the two values. If a config occurs in more than
        one comparison it is repeated every time. Configs that are in the original data
        but are not mentioned in compared_configs are not printed.
        For example if the data contains configs A, B, C and D and *compared_configs* is
        ``[('A', 'B', 'Diff BA'), ('A', 'C')]`` the resulting columns will be
        A, B, Diff BA (contains B - A), A, C , Diff (contains C - A).

        Example::

            compared_configs = [
                ('c406c4f77e13-astar_lmcut', '6e09db9b3003-astar_lmcut', 'Diff (lmcut)'),
                ('c406c4f77e13-astar_ff', '6e09db9b3003-astar_ff', 'Diff (ff)')]
            exp.add_report(CompareConfigsReport(compared_configs))

        """
        if 'filter_config' in kwargs or 'filter_config_nick' in kwargs:
            logging.critical(
                'Filtering config(nicks) is not supported in '
                'CompareConfigsReport. Use the parameter '
                '"compared_configs" to define which configs are shown '
                'and in what order they should appear.')
        if compared_configs:
            configs = set()
            for t in compared_configs:
                for config in t[0:2]:
                    configs.add(config)
            kwargs['filter_config'] = configs
        AbsoluteReport.__init__(self, **kwargs)
        self._compared_configs = compared_configs
示例#9
0
文件: compare.py 项目: galdreiman/PAC
    def __init__(self, compared_configs, **kwargs):
        """
        See :py:class:`AbsoluteReport <downward.reports.absolute.AbsoluteReport>`
        for inherited parameters.

        *compared_configs* is a list of tuples of 2 or 3 elements. The first two entries
        in each tuple are configs that should be compared. If a third entry is present it
        is used as the name of the column showing the difference between the two configs.
        Otherwise the column will be named 'Diff'.
        All columns in the report will be arranged such that the configurations that are
        compared are next to each other. After those two columns a diff column is added
        that shows the difference between the two values. If a config occurs in more than
        one comparison it is repeated every time. Configs that are in the original data
        but are not mentioned in compared_configs are not printed.
        For example if the data contains configs A, B, C and D and *compared_configs* is
        ``[('A', 'B', 'Diff BA'), ('A', 'C')]`` the resulting columns will be
        A, B, Diff BA (contains B - A), A, C , Diff (contains C - A).

        Example::

            compared_configs = [
                ('c406c4f77e13-astar_lmcut', '6e09db9b3003-astar_lmcut', 'Diff (lmcut)'),
                ('c406c4f77e13-astar_ff', '6e09db9b3003-astar_ff', 'Diff (ff)')]
            exp.add_report(CompareConfigsReport(compared_configs))

        """
        if 'filter_config' in kwargs or 'filter_config_nick' in kwargs:
            logging.critical('Filtering config(nicks) is not supported in '
                             'CompareConfigsReport. Use the parameter '
                             '"compared_configs" to define which configs are shown '
                             'and in what order they should appear.')
        if compared_configs:
            configs = set()
            for t in compared_configs:
                for config in t[0:2]:
                    configs.add(config)
            kwargs['filter_config'] = configs
        AbsoluteReport.__init__(self, **kwargs)
        self._compared_configs = compared_configs
示例#10
0
    def __init__(self, **kwargs):

        AbsoluteReport.__init__(self, **kwargs)
	self.derived_properties.append(hstar_to_h)
示例#11
0
    def __init__(self, **kwargs):

        AbsoluteReport.__init__(self, **kwargs)
        self.derived_properties.append(hstar_to_h)