Esempio n. 1
0
def read_process_tree(file_path):
    """
    Reads a process tree from a .ptml file

    Parameters
    ---------------
    file_path
        File path

    Returns
    ----------------
    tree
        Process tree
    """
    from pm4py.objects.process_tree.importer import importer as tree_importer
    tree = tree_importer.apply(file_path)
    return tree
Esempio n. 2
0
def read_ptml(file_path: str) -> Tuple[PetriNet, Marking, Marking]:
    """
    Reads a process tree from a .ptml file

    Parameters
    ---------------
    file_path
        File path

    Returns
    ----------------
    tree
        Process tree
    """
    from pm4py.objects.process_tree.importer import importer as tree_importer
    tree = tree_importer.apply(file_path)
    return tree
Esempio n. 3
0
def read_process_tree(file_path: str) -> Tuple[PetriNet, Marking, Marking]:
    warnings.warn('read_process_tree is deprecated, use read_ptml instead', DeprecationWarning)
    """
    Reads a process tree from a .ptml file

    Parameters
    ---------------
    file_path
        File path

    Returns
    ----------------
    tree
        Process tree
    """
    from pm4py.objects.process_tree.importer import importer as tree_importer
    tree = tree_importer.apply(file_path)
    return tree
Esempio n. 4
0
 def test_import_export_ptml(self):
     tree = ptree_importer.apply(os.path.join("input_data", "running-example.ptml"))
     ptree_exporter.apply(tree, os.path.join("test_output_data", "running-example2.ptml"))
     os.remove(os.path.join("test_output_data", "running-example2.ptml"))
from pm4pydistr.remote_wrapper import factory as wrapper_factory
from pm4py.objects.process_tree.importer import importer as pt_importer
from pm4py.evaluation.replay_fitness.versions import alignment_based
import time

wrapper = wrapper_factory.apply("127.0.0.1", "5001", "hello", "receipt")
tree = pt_importer.apply('../tests/receipt.ptml')
# tree = wrapper.get_imd_tree_from_dfg()
aa = time.time()
alignments = wrapper.perform_alignments_tree_variants(
    tree,
    parameters={
        "max_align_time_trace": 10.0,
        "max_align_time": 100.0,
        "max_thread_join_time": 150.0
    })
alignments = [y for x, y in alignments.items()]
bb = time.time()
# print(alignments)
fitness = alignment_based.evaluate(alignments)
print(bb - aa)
print(fitness)
print("total traces = ", len(alignments))
print("successful alignments = ", len([x for x in alignments]))
# print(alignments)