File size: 5,682 Bytes
8097001
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
import pm4py
import os
import unittest


class OcelDiscoveryTest(unittest.TestCase):
    def test_discovery_ocfg_f1(self):
        target_path = os.path.join("test_output_data", "model.svg")
        ocel = pm4py.read_ocel(os.path.join("input_data", "ocel", "example_log.jsonocel"))
        ocdfg = pm4py.discover_ocdfg(ocel)
        pm4py.save_vis_ocdfg(ocdfg, target_path, annotation="frequency", act_metric="events", edge_metric="ev_couples", act_threshold=2, edge_threshold=1)
        os.remove(target_path)

    def test_discovery_ocfg_f2(self):
        target_path = os.path.join("test_output_data", "model.svg")
        ocel = pm4py.read_ocel(os.path.join("input_data", "ocel", "example_log.jsonocel"))
        ocdfg = pm4py.discover_ocdfg(ocel)
        pm4py.save_vis_ocdfg(ocdfg, target_path, annotation="frequency", act_metric="unique_objects", edge_metric="ev_couples", act_threshold=2, edge_threshold=1)
        os.remove(target_path)

    def test_discovery_ocfg_f3(self):
        target_path = os.path.join("test_output_data", "model.svg")
        ocel = pm4py.read_ocel(os.path.join("input_data", "ocel", "example_log.jsonocel"))
        ocdfg = pm4py.discover_ocdfg(ocel)
        pm4py.save_vis_ocdfg(ocdfg, target_path, annotation="frequency", act_metric="total_objects", edge_metric="ev_couples", act_threshold=2, edge_threshold=1)
        os.remove(target_path)


    def test_discovery_ocfg_f4(self):
        target_path = os.path.join("test_output_data", "model.svg")
        ocel = pm4py.read_ocel(os.path.join("input_data", "ocel", "example_log.jsonocel"))
        ocdfg = pm4py.discover_ocdfg(ocel)
        pm4py.save_vis_ocdfg(ocdfg, target_path, annotation="frequency", act_metric="unique_objects", edge_metric="unique_objects", act_threshold=2, edge_threshold=1)
        os.remove(target_path)


    def test_discovery_ocfg_f5(self):
        target_path = os.path.join("test_output_data", "model.svg")
        ocel = pm4py.read_ocel(os.path.join("input_data", "ocel", "example_log.jsonocel"))
        ocdfg = pm4py.discover_ocdfg(ocel)
        pm4py.save_vis_ocdfg(ocdfg, target_path, annotation="frequency", act_metric="unique_objects", edge_metric="total_objects", act_threshold=2, edge_threshold=1)
        os.remove(target_path)


    def test_discovery_ocfg_p1(self):
        target_path = os.path.join("test_output_data", "model.svg")
        ocel = pm4py.read_ocel(os.path.join("input_data", "ocel", "example_log.jsonocel"))
        ocdfg = pm4py.discover_ocdfg(ocel)
        pm4py.save_vis_ocdfg(ocdfg, target_path, annotation="performance", act_metric="events", edge_metric="ev_couples", act_threshold=2, edge_threshold=1)
        os.remove(target_path)

    def test_discovery_ocfg_p2(self):
        target_path = os.path.join("test_output_data", "model.svg")
        ocel = pm4py.read_ocel(os.path.join("input_data", "ocel", "example_log.jsonocel"))
        ocdfg = pm4py.discover_ocdfg(ocel)
        pm4py.save_vis_ocdfg(ocdfg, target_path, annotation="performance", act_metric="unique_objects", edge_metric="ev_couples", act_threshold=2, edge_threshold=1)
        os.remove(target_path)

    def test_discovery_ocfg_p3(self):
        target_path = os.path.join("test_output_data", "model.svg")
        ocel = pm4py.read_ocel(os.path.join("input_data", "ocel", "example_log.jsonocel"))
        ocdfg = pm4py.discover_ocdfg(ocel)
        pm4py.save_vis_ocdfg(ocdfg, target_path, annotation="performance", act_metric="total_objects", edge_metric="ev_couples", act_threshold=2, edge_threshold=1)
        os.remove(target_path)


    def test_discovery_ocfg_p4(self):
        target_path = os.path.join("test_output_data", "model.svg")
        ocel = pm4py.read_ocel(os.path.join("input_data", "ocel", "example_log.jsonocel"))
        ocdfg = pm4py.discover_ocdfg(ocel)
        pm4py.save_vis_ocdfg(ocdfg, target_path, annotation="performance", act_metric="unique_objects", edge_metric="total_objects", act_threshold=2, edge_threshold=1)
        os.remove(target_path)


    def test_discovery_ocfg_p5(self):
        target_path = os.path.join("test_output_data", "model.svg")
        ocel = pm4py.read_ocel(os.path.join("input_data", "ocel", "example_log.jsonocel"))
        ocdfg = pm4py.discover_ocdfg(ocel, business_hours=True)
        pm4py.save_vis_ocdfg(ocdfg, target_path, annotation="performance", act_metric="unique_objects", edge_metric="total_objects", act_threshold=2, edge_threshold=1)
        os.remove(target_path)


    def test_discovery_ocfg_p6(self):
        target_path = os.path.join("test_output_data", "model.svg")
        ocel = pm4py.read_ocel(os.path.join("input_data", "ocel", "example_log.jsonocel"))
        ocdfg = pm4py.discover_ocdfg(ocel, business_hours=True)
        pm4py.save_vis_ocdfg(ocdfg, target_path, annotation="performance", act_metric="unique_objects", edge_metric="total_objects", act_threshold=2, edge_threshold=1, performance_aggregation="median")
        os.remove(target_path)

    def test_discovery_ocpn_im(self):
        ocel = pm4py.read_ocel(os.path.join("input_data", "ocel", "example_log.jsonocel"))
        ocpn = pm4py.discover_oc_petri_net(ocel, inductive_miner_variant="im")

    def test_discovery_ocpn_imd(self):
        ocel = pm4py.read_ocel(os.path.join("input_data", "ocel", "example_log.jsonocel"))
        ocpn = pm4py.discover_oc_petri_net(ocel, inductive_miner_variant="imd")

    def test_discovery_saw_nets_ocel(self):
        from pm4py.algo.discovery.ocel.saw_nets import algorithm as saw_nets_disc
        ocel = pm4py.read_ocel(os.path.join("input_data", "ocel", "example_log.jsonocel"))
        saw_nets_disc.apply(ocel)


if __name__ == "__main__":
    unittest.main()