コード例 #1
0
ファイル: comparator.py プロジェクト: Macuyiko/PacH
 def generate_outputs(self, filename=""):
     filename = filename or "Generated automagically"
     pach = PacH(filename)
     pach.dim = self.dim
     # For every benchmark, generate the output
     qhull = self.qhull_no_smt
     pach.output.get("times", {}).update(qhull.output.get("times", {}))
     pach.qhull = qhull
     pach.smt_matrix = False
     pach.smt_iter = False
     pach.generate_output_file()
     logger.info("Generated output for NO SMT simplification")
     qhull = self.qhull_smt_iter
     pach.output.get("times", {}).update(qhull.output.get("times", {}))
     pach.qhull = qhull
     pach.smt_matrix = False
     pach.smt_iter = True
     pach.generate_output_file()
     logger.info("Generated output for Iterative SMT simplification")
     qhull = self.qhull_smt_matrix
     pach.output.get("times", {}).update(qhull.output.get("times", {}))
     pach.qhull = qhull
     pach.smt_matrix = True
     pach.smt_iter = False
     pach.generate_output_file()
     logger.info("Generated output for Matrix SMT simplification")
     return True
コード例 #2
0
ファイル: comparator.py プロジェクト: lucionardelli/PacH
 def generate_outputs(self, filename=''):
     filename = filename or 'Generated automagically'
     pach = PacH(filename)
     pach.dim = self.dim
     # For every benchmark, generate the output
     qhull = self.qhull_no_smt
     pach.output.get('times',{}).update(qhull.output.get('times',{}))
     pach.qhull = qhull
     pach.smt_matrix = False
     pach.smt_iter = False
     # Force initial complexity for effectiveness calculation
     pach.initial_complexity = self.no_smt_initial_complexity
     pach.generate_output_file()
     logger.info('Generated output for NO SMT simplification')
     qhull = self.qhull_smt_iter
     pach.output.get('times',{}).update(qhull.output.get('times',{}))
     pach.qhull = qhull
     pach.smt_matrix = False
     pach.smt_iter = True
     # Force initial complexity for effectiveness calculation
     pach.initial_complexity = self.iter_initial_complexity
     pach.generate_output_file()
     logger.info('Generated output for Iterative SMT simplification')
     qhull = self.qhull_smt_matrix
     pach.output.get('times',{}).update(qhull.output.get('times',{}))
     pach.qhull = qhull
     pach.smt_matrix = True
     pach.smt_iter = False
     # Force initial complexity for effectiveness calculation
     pach.initial_complexity = self.matrix_initial_complexity
     pach.generate_output_file()
     logger.info('Generated output for Matrix SMT simplification')
     return True
コード例 #3
0
ファイル: comparator_xes.py プロジェクト: lucionardelli/PacH
class ComparatorXes(object):

    def __init__(self, filename,
            samp_num=1, samp_size=None,
            proj_size=None, proj_connected=True,
            nfilename=None, max_coef=10,
            smt_timeout_iter=0,
            smt_timeout_matrix=0,
            sanity_check=False):
        self.pach = PacH(filename,
            samp_num=samp_num, samp_size=samp_size,
            proj_size=proj_size, proj_connected=proj_connected,
            nfilename=nfilename, max_coef=max_coef,
            sanity_check=sanity_check)
        self.pach.parse()

        qhull = self.pach.qhull
        # Hull for NO SMT
        qhull_no_smt = copy.deepcopy(qhull)
        # Hull for SMT iterative simp
        qhull_smt_iter = copy.deepcopy(qhull)
        # Hull for SMT matrix simp
        qhull_smt_matrix = copy.deepcopy(qhull)

        self.comparator = Comparator(qhull_no_smt, qhull_smt_iter, qhull_smt_matrix,
                max_coef, smt_timeout_iter, smt_timeout_matrix)

    def generate_pnml(self):
        return self.comparator.generate_pnml(filename=self.pach.filename,
                reversed_dictionary=self.pach.reversed_dictionary)

    def compare(self,log_file='', event_dictionary={}):
        return self.comparator.compare(log_file=log_file, event_dictionary=event_dictionary)

    def generate_outputs(self):
        # For every benchmark, generate the output
        qhull = self.comparator.qhull_no_smt
        self.pach.output.get('times',{}).update(qhull.output.get('times',{}))
        self.pach.qhull = qhull
        self.pach.smt_matrix = False
        self.pach.smt_iter = False
        # Force initial complexity for effectiveness calculation
        self.pach.initial_complexity = self.comparator.no_smt_initial_complexity
        self.pach.generate_output_file()
        logger.info('Generated output for NO SMT simplification')
        qhull = self.comparator.qhull_smt_iter
        self.pach.output.get('times',{}).update(qhull.output.get('times',{}))
        self.pach.qhull = qhull
        self.pach.smt_matrix = False
        self.pach.smt_iter = True
        # Force initial complexity for effectiveness calculation
        self.pach.initial_complexity = self.comparator.iter_initial_complexity
        self.pach.generate_output_file()
        logger.info('Generated output for Iterative SMT simplification')
        qhull = self.comparator.qhull_smt_matrix
        self.pach.output.get('times',{}).update(qhull.output.get('times',{}))
        self.pach.qhull = qhull
        self.pach.smt_matrix = True
        self.pach.smt_iter = False
        # Force initial complexity for effectiveness calculation
        self.pach.initial_complexity = self.comparator.matrix_initial_complexity
        self.pach.generate_output_file()
        logger.info('Generated output for Matrix SMT simplification')
        return True