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

📄 find_location.m

📁 CheckMate is a MATLAB-based tool for modeling, simulating and investigating properties of hybrid dyn
💻 M
字号:
function [next_location,destination_location] = find_location(srcloc,destination,transition_index)
%
% 	Syntax:
%   "next_location = find_location(srcloc,destination,transition_index)"
%
% Description:
% 	Given a source location, src_loc,  and a destination number in 
% 	GLOBAL_PIHA.Locations{src_loc}.transitions{transition}.destination, 
%	returns the destination location number. If the location is terminal,
%	returns empty.
%
%	inputs:
%
%   * "srcloc": a location number. 
%
%	 * "destination": number of the StateFlow state that changed from one
%		 one location to another.
%
%	 * "transition_index": index referring to the transition whose guard was enabled
%		 by the reachable set. 
%
                
	destination_location=[];
    global GLOBAL_PIHA
    next_loc_q = GLOBAL_PIHA.Locations{srcloc}.q;
	
         
   %Find destination location number
  	transition_struc = GLOBAL_PIHA.Locations{srcloc}.transitions;
   for count_index =1: length(transition_struc{transition_index}.idx)
       next_loc_q(transition_struc{transition_index}.idx(count_index)) = transition_struc{transition_index}.destination(count_index);
   end
   % temp=setdiff(GLOBAL_PIHA.Locations{srcloc}.q,transition_struc{transition_index}.source);
   destination_temp=next_loc_q;%[temp transition_struc{transition_index}.destination];
   next_location=[];
   
   for i=1:length(GLOBAL_PIHA.Locations)
      
     	if all(GLOBAL_PIHA.Locations{i}.q ==destination_temp)
         next_location=i;
         break;
      end
   end
   if isempty(next_location)
      destination_location = destination_temp;
   end
   return
            

⌨️ 快捷键说明

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