def apply_with_alignments(tree, m_tree, log, alignments, parameters=None, option=1): pt_number.apply(tree, 'D') pt_number.apply(m_tree, 'D') com_res = pt_compare.apply(tree, m_tree, option) if com_res.value: return alignments, copy.deepcopy(alignments) else: mapping_t, tree_info = dict(), dict() tree_utils.recursively_init_tree_tables(tree, tree_info, mapping_t, [1]) best_worst_cost = alignments_on_pt(EventLog([Trace()]), m_tree, parameters)[0]['cost'] repairing_alignment = compute_repairing_alignments( com_res, log, alignments, tree_info, mapping_t, parameters, best_worst_cost) return alignments, repairing_alignment
def apply(tree, m_tree, log, parameters=None, option=1): alignments = alignments_on_pt(log, tree, parameters) return apply_with_alignments(tree, m_tree, log, alignments, parameters, option)