Example #1
0
	def test_loop_of_one(self):
		lg = EventLog()
		lg.add_trace(1, ['a', 'b', 'b', 'c'])
		lg.add_trace(2, ['a', 'c'])

		miner = InductiveMiner(lg)
		tree = miner.discover()

		print()
		tree.print_tree()
		dot.draw_process_tree(tree, 'single_loop', format='pdf')
Example #2
0
	def test_prepare_log(self):

		lg = EventLog()

		lg.add_trace(1, ['a', 'b', 'g', 'h', 'i', 'j', 'k'])
		lg.add_trace(2, ['a', 'b', 'g', 'h', 'j', 'i', 'k'])
		lg.add_trace(3, ['a', 'b', 'g', 'h', 'i', 'k'])
		lg.add_trace(4, ['a', 'b', 'g', 'h', 'j', 'k'])
		lg.add_trace(5, ['a', 'b', 'c', 'd', 'e', 'h', 'i', 'k'])
		lg.add_trace(6, ['a', 'b', 'c', 'd', 'e', 'f', 'c', 'd',
						 'e', 'h', 'i', 'k'])

		miner = InductiveMiner(lg)

		result = [	['a', 'b', 'g', 'h', 'i', 'j', 'k'],
					['a', 'b', 'g', 'h', 'j', 'i', 'k'],
					['a', 'b', 'g', 'h', 'i', 'k'],
					['a', 'b', 'g', 'h', 'j', 'k'],
					['a', 'b', 'c', 'd', 'e', 'h', 'i', 'k'],
					['a', 'b', 'c', 'd', 'e', 'f', 'c', 'd', 'e', 'h', 'i', 'k']]

		result.sort()
		miner.log.sort()

		self.assertListEqual(miner.log, result)
Example #3
0
	def test_simple_example(self):
		lg = EventLog()

		lg.add_trace(1, ['a', 'b', 'g', 'h', 'i', 'j', 'k'])
		lg.add_trace(2, ['a', 'b', 'g', 'h', 'j', 'i', 'k'])
		lg.add_trace(3, ['a', 'b', 'g', 'h', 'i', 'k'])
		lg.add_trace(4, ['a', 'b', 'g', 'h', 'j', 'k'])
		lg.add_trace(5, ['a', 'b', 'c', 'd', 'e', 'h', 'i', 'k'])
		lg.add_trace(6, ['a', 'b', 'c', 'd', 'e', 'f', 'c', 'd',
						 'e', 'h', 'i', 'k'])

		miner = InductiveMiner(lg)
		tree = miner.discover()

		tree.print_tree()
		dot.draw_process_tree(tree, format='pdf')
Example #4
0
	def test_tree_to_net(self):
		lg = EventLog()

		lg.add_trace(1, ['a', 'b', 'g', 'h', 'i', 'j', 'k'])
		lg.add_trace(2, ['a', 'b', 'g', 'h', 'j', 'i', 'k'])
		lg.add_trace(3, ['a', 'b', 'g', 'h', 'i', 'k'])
		lg.add_trace(4, ['a', 'b', 'g', 'h', 'j', 'k'])
		lg.add_trace(5, ['a', 'b', 'c', 'd', 'e', 'h', 'i', 'k'])
		lg.add_trace(6, ['a', 'b', 'c', 'd', 'e', 'f', 'c', 'd',
						 'e', 'h', 'i', 'k'])

		miner = InductiveMiner(lg)
		tree = miner.discover()

		tree.print_tree()
		# dot.draw_process_tree(tree, format='pdf')

		net = miner.tree_to_petri_net(tree)
		dot.draw_petri_net(net, 'process_tree_to_net')
Example #5
0
	def test_extended_example(self):
		lg = EventLog()

		lg.add_trace(1, ['submit application',  # a
						 'review application',  # b
						 'fast forwarding',  # g
						 'final review',  # h
						 'supervisor signature',  # i
						 'sign application',  # j
						 'close application'])  # k
		lg.add_trace(2, ['submit application',  # a
						 'review application',  # b
						 'fast forwarding',  # c
						 'final review',  # h
						 'sign application',  # j
						 'supervisor signature',  # i
						 'close application'])  # k
		lg.add_trace(3, ['submit application',  # a
						 'review application',  # b
						 'fast forwarding',  # g
						 'final review',  # h
						 'supervisor signature',  # i
						 'close application'])  # k
		lg.add_trace(4, ['submit application',  # a
						 'review application',  # b
						 'fast forwarding',  # g
						 'final review',  # h
						 'sign application',  # j
						 'close application'])  # k
		lg.add_trace(5, ['submit application',  # a
						 'review application',  # b
						 'check documents',  # c
						 'check financial status',  # d
						 'write report',  # e
						 'final review',  # h
						 'supervisor signature',  # i
						 'close application'])  # k
		lg.add_trace(6, ['submit application',  # a
						 'review application',  # b
						 'check documents',  # c
						 'check financial status',  # d
						 'write report',  # e
						 'reject report',  # f
						 'check documents',  # c
						 'check financial status',  # d
						 'write report',  # e
						 'final review',  # h
						 'supervisor signature',  # i
						 'close application'])  # k

		miner = InductiveMiner(lg)
		tree = miner.discover()

		g = Graph()
		g = g.from_log(miner.log)
		d = dot.draw_graph(g)
		dot.render_dot(d, 'dfg_process_tree')

		tree.print_tree()
		dot.draw_process_tree(tree, 'example', format='pdf')