Download General Purpose Petri Net Simulator
Transcript
10.2.1 Petri net definition file
The Petri net definition file is given below:
% PDF Example-10: Cotree example-2
% file:
function [PN_name, set_of_places, set_of_trans, set_of_arcs]...
= fig_9_def()
PN_name = 'Petri net in fig 4.12';
set_of_places = {'p1', 'p2', 'p3', 'p4'};
set_of_trans = {'t1','t2', 't3'};
set_of_arcs = {'p1', 't1', 1, 't1', 'p2', 1, 't1', 'p3', 1,...
'p2','t2',1, 't2','p1',1, 'p2','t3',1 ...
'p3','t3',1, 't3','p3',1, 't3','p4', 1};
10.2.2 The main file
The main file (after phases 2 & 3) is given below:
% Example-10: Cotree example-2
% the main file to get co-tree
clear, clc;
png = petrinetgraph('fig_9_def');
dyn.initial_markings = {'p1',1};
CT = cotree(png, dyn);
print_cotree(CT); %
The print system will print the following on the screen, which is equivalent to the graphical
co-tree shown in figure 17.
Petri net in fig 4.12'
state:1
p1
1
ROOT node
p2
0
p3
0
p4
0
state:2
Firing event: t1
p1
p2
p3
p4
0
1
1
0
Node type: ' '
Parent state: 1
state:3
Firing event: t2
p1
p2
p3
p4
1
0
Inf
0
Node type: ' '
Parent state: 2
state:4
Firing event: t3
p1
p2
p3
p4
0
0
1
1
Node type: 'T'
Parent state: 2
state:5
Firing event: t1
p1
p2
p3
p4
0
1
Inf
0
Node type: ' '
Parent state: 3
48