Beispiel #1
0
import unittest
import time
current_dir = os.path.dirname(
    os.path.abspath(inspect.getfile(inspect.currentframe())))
parent_dir = os.path.dirname(current_dir)
sys.path.insert(0, parent_dir)

from pm4pydistr.remote_wrapper import factory as wrapper_factory
from pm4py.algo.discovery.inductive import factory as inductive_miner

# possibility to limit the number of sublogs (per slave) that are considered
max_no_samples = 5
# create the wrapper
wrapper = wrapper_factory.apply("137.226.117.71",
                                "5001",
                                "hello",
                                "receipt",
                                parameters={"no_samples": max_no_samples})
# gets the log summary (number of cases and number of events)
print(wrapper.get_log_summary())
dfg = wrapper.calculate_dfg()
net, im, fm = inductive_miner.apply_dfg(dfg)
tbr_result = wrapper.perform_tbr_net_variants(net, im, fm, var_list=None)
aa = time.time()
#aligned_traces = wrapper.perform_alignments_net_variants(net, im, fm, var_list=None, parameters={"align_variant": "dijkstra_less_memory"})
aligned_traces = wrapper.perform_alignments_net_variants(
    net, im, fm, var_list=None, parameters={"align_variant": "recomp_maximal"})
bb = time.time()
print(aligned_traces)
print(bb - aa)
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)
import sys
import unittest
import time
current_dir = os.path.dirname(
    os.path.abspath(inspect.getfile(inspect.currentframe())))
parent_dir = os.path.dirname(current_dir)
sys.path.insert(0, parent_dir)

from pm4pydistr.remote_wrapper import factory as wrapper_factory
from pm4py.algo.discovery.inductive import factory as inductive_miner

# possibility to limit the number of sublogs (per slave) that are considered
max_no_samples = 5
# create the wrapper
wrapper = wrapper_factory.apply("212.237.8.106",
                                "5001",
                                "hello",
                                "receipt",
                                parameters={"no_samples": max_no_samples})
# gets the log summary (number of cases and number of events)
print(wrapper.get_log_summary())
net, im, fm = wrapper.get_imd_net_im_fm_from_dfg()
tbr_result = wrapper.perform_tbr_net_variants(net, im, fm, var_list=None)
aa = time.time()
#aligned_traces = wrapper.perform_alignments_net_variants(net, im, fm, var_list=None, parameters={"align_variant": "dijkstra_less_memory"})
aligned_traces = wrapper.perform_alignments_net_variants(
    net, im, fm, var_list=None, parameters={"align_variant": "recomp_maximal"})
bb = time.time()
print(aligned_traces)
print(bb - aa)
import os
import sys
import unittest
current_dir = os.path.dirname(
    os.path.abspath(inspect.getfile(inspect.currentframe())))
parent_dir = os.path.dirname(current_dir)
sys.path.insert(0, parent_dir)

from pm4pydistr.remote_wrapper import factory as wrapper_factory

# possibility to limit the number of sublogs (per slave) that are considered
max_no_samples = 1
# create the wrapper
wrapper = wrapper_factory.apply("127.0.0.1",
                                "5001",
                                "hello",
                                "roadtraffic",
                                parameters={"no_samples": max_no_samples})
# gets the log summary (number of cases and number of events)
print(wrapper.get_log_summary())
# gets all the attributes of the log
print(wrapper.get_attribute_names())
# gets all the values of the concept:name attribute along with the count
print(wrapper.get_attribute_values("concept:name"))
# gets the start and end activities of the log
print(wrapper.get_start_activities())
print(wrapper.get_end_activities())
# gets the path of the log (frequency DFG) along with their count
print(wrapper.calculate_dfg())
print(wrapper.calculate_performance_dfg())
# add a filter on the presence of the "Send Fine" activity