⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 teste_map.m

📁 一个matlab的将军模型
💻 M
字号:
function teste_map()
%
% auxiliary routine used to check if there is any mapping with more than one set
% per face. In the linear case, it should not be the case.
%
% Basically the routine scans all states, checking the length of the mapping.
% null_event,time_limit, indeterminate and non_reachable states are not considered.
%

global_var;

counter=0;
for i=1:length(GLOBAL_TRANSITION)
   loc 	= GLOBAL_XSYS2AUTO_MAP{i}(1);
   if ~strcmp(loc,'terminal') & ~strcmp(loc,'out_of_bound')
      face 	= GLOBAL_XSYS2AUTO_MAP{i}(2);
      if length(GLOBAL_XSYS2AUTO_MAP{i})==3
         state = GLOBAL_XSYS2AUTO_MAP{i}(3);
         map={};
         map =GLOBAL_AUTOMATON{loc}.face{face}.state{state}.mapping;
      elseif ~strcmp(loc,'null_event')   & ...
             ~strcmp(loc,'time_limit')   & ...
             ~strcmp(loc,'indeterminate')& ...
             ~strcmp(loc,'non_reachable')
         map={};      
         map =GLOBAL_AUTOMATON{loc}.initstate{face}.mapping;
      end   
      for k = 1:length(map)
         if length(map{k})>1
            fprintf(1,'\n - found a double mapping')
            map{k}
            i
            counter = counter + 1;
         end
      end
   end
end
if ~counter
   fprintf(1,'\n - No double mapping found \n')
end

return

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -