How to keep track of markings in a Petri net

3 次查看(过去 30 天)
I am writing some code for a class assignment that determines the reachable states for a petri net. The net is fully conservative so there are no dominant nodes, but there may be repeats. I have come up with some basic code that determines the next states based on a given state.(See below) Now I am trying to figure out how to keep track of the paths (the tree)
Any advice or tips?
Thanks!
%B (Incident Matrix) of plant and controller
%M0 is initial condition
%initial values
p=0; Mk=zeros(12,1);M=zeros(12,1);
% This loop tests each transition, and adds to list if fireable
for k=1:1:12
Mk=M0+Bc(:,k);% Mk is M0 + kth column of Bc
C=(Mk>=0); %C is test vector, returns 1 for elements >=0
if(all(C)) % if all elements in Mk are non-neg
p=p+1; %increment p
M(:,p)=Mk; %Add to the Marking List
end
end
M %display M

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Graph and Network Algorithms 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by