Пример #1
0
    def __init__(self, filename, nfilename=None,
            max_coef=10, smt_timeout_iter=0, smt_timeout_matrix=0,
            positive_log=None):
        self.filename = filename
        parser = PnmlParser(filename)
        parser.parse()
        self.net = parser.petrinet
        self.dim = parser.dim
        self.event_dictionary = parser.event_dictionary
        self.positive_log = positive_log

        # Helper pach. Doesn't actually compute hull
        self.pach = PacH(filename,nfilename=nfilename)
        self.pach.event_dictionary = parser.event_dictionary
        self.pach.reversed_dictionary = rotate_dict(parser.event_dictionary)
        self.pach.parse_negatives()

        qhull = self.net.get_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)
Пример #2
0
 def parse_traces(self):
     if self.verbose:
         print 'Starting parse\n'
         start_time = time.time()
     if self.filename.endswith('.xes'):
         parser = XesParser(self.filename)
     elif self.filename.endswith('.txt'):
         parser = AdHocParser(self.filename)
     else:
         logger.error("Error in file %s extension. Only '.xes' and '.txt'"\
                 " are allowed!",(self.filename or ''))
         raise Exception("Error in file %s extension. Only '.xes' and '.txt'"\
                 " are allowed!"%(self.filename or ''))
     parser.parikhs_vector()
     self.event_dictionary = parser.event_dictionary
     self.reversed_dictionary = rotate_dict(parser.event_dictionary)
     self.pv_traces = parser.pv_traces
     self.pv_set = parser.pv_set
     self.pv_array = parser.pv_array
     self.dim = parser.dim
     if self.verbose:
         print 'Parse done\n'
         elapsed_time = time.time() - start_time
         print '# RESULTADO  obtenido en: ', elapsed_time
         print '#'*40+'\n'
Пример #3
0
 def parse_traces(self):
     if self.filename.endswith('.xes'):
         parser = XesParser(self.filename)
     elif self.filename.endswith('.txt'):
         parser = AdHocParser(self.filename)
     elif self.filename.endswith('.pnml'):
         parser = PnmlParser(self.filename)
     else:
         logger.error("Error in file %s extension. Only '.xes', '.pnml' and '.txt'"\
                 " are allowed!",(self.filename or ''))
         raise Exception("Error in file %s extension. Only '.xes', '.pnml' and '.txt'"\
                 " are allowed!"%(self.filename or ''))
     parser.parse()
     self.event_dictionary = parser.event_dictionary
     self.reversed_dictionary = rotate_dict(parser.event_dictionary)
     if self.filename.endswith('.pnml'):
         self.parsed_petrinet = parser.petrinet
     else:
         parser.parikhs_vector()
         self.pv_traces = parser.pv_traces
         self.pv_set = parser.pv_set
         self.pv_array = parser.pv_array
     self.dim = parser.dim