?? plotmap.m
字號:
%-----------------------------------------------------------------------%
% Function : PlotMap CREATOR: Izaias %
% Credate : 072099 CURDATE:072099 %
% Description : This function draw the polytope related with each %
% location reachable from the initial locations. %
%-----------------------------------------------------------------------%
% Functional Description: %
% Load GLOBAL_PIHA.InitialLocation to initloc %
% Plot polytopes of initloc using GLOBAL_AUTOMATON %
% NOT_END = 1; %
% actloc = states from initloc using GLOBAL_TRANSITION ; %
% nextloc = 0; %
% while NOT_END %
% nextloc = next locations of actloc using GLOBAL_TRANSITION %
% remove redundancy of nextloc %
% plot polytopes of nextloc using GLOBAL_XSYS2AUTO_MAP %
% sort actloc and nextloc %
% if actloc==nextloc OR nextloc == 0 %
% NOT_END = 0 %
% end %
% end %
% clear figure and make initial arrangements to plot
clf;
hold on;
% Load GLOBAL_PIHA.InitialLocation to initloc %
initloc = GLOBAL_PIHA.InitialLocations;
% Plot polytopes of initloc using GLOBAL_AUTOMATON %
for i= 1:length(initloc)
for j= 1:length(GLOBAL_AUTOMATON{i}.initstate)
for k = 1:length(GLOBAL_AUTOMATON{i}.initstate{j}.mapping)
for m = 1:length(GLOBAL_AUTOMATON{i}.initstate{j}.mapping{k})
plot(GLOBAL_AUTOMATON{i}.initstate{j}.mapping{k}{m});
end
end
end
end
NOT_END = 1;
actloc = unique(initloc);
nextloc = 0;
counter = 1;
% Plot 'tree' of polytopes using GLOBAL_AUTOMATON %
while NOT_END
for i=1:length(actloc)
nextloc = [nextloc GLOBAL_TRANSITION{actloc(i)}];
end
if nextloc(1)==0
nextloc = nextloc(2:length(nextloc));
end
nextloc = unique(nextloc);
if compvec(nextloc,actloc)
NOT_END =0;
else
actloc = nextloc;
counter = counter + 1;
end
end
fprintf('Drawing polytopes, please wait... ');
for i= 1:length(nextloc)
var_location = GLOBAL_XSYS2AUTO_MAP{nextloc(i)}(1);
if ~(strcmp(var_location,'terminal'))
var_face = GLOBAL_XSYS2AUTO_MAP{nextloc(i)}(2);
var_state = GLOBAL_XSYS2AUTO_MAP{nextloc(i)}(3);
for j= 1:length(GLOBAL_AUTOMATON{var_location}.face{var_face}.state{var_state}.mapping)
for k = 1:length(GLOBAL_AUTOMATON{var_location}.face{var_face}.state{var_state}.mapping{j})
plot(GLOBAL_AUTOMATON{var_location}.face{var_face}.state{var_state}.mapping{j}{k})
end
end
end
end
fprintf('done! \n');
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -