?? clean_up_boundary.m
字號:
function [boundary_new,hpflags_new] = clean_up_boundary(first_boundary,second_boundary,first_hpflags,second_hpflags)global GLOBAL_PIHAglobal GLOBAL_APPROX_PARAMhyperplanes = GLOBAL_PIHA.Hyperplanes;[c1,d1]=cell_ineq(first_boundary,first_hpflags);[c2,d2]=cell_ineq(second_boundary,second_hpflags);a=linearcon([],[],c1,d1);b=linearcon([],[],c2,d2);if isempty(a&b) boundary_new=[]; hpflags_new=[];elseboundary=[first_boundary second_boundary];hpflags=[first_hpflags second_hpflags];[CBND,dBND] = cell_ineq(boundary,hpflags);[CE,dE,CI,dI] = linearcon_data(clean_up(linearcon([],[],CBND,dBND)));%Use the following to indicate which hpflags elements will still be validhp_flag_index=[];if (length(dI) == length(dBND)) boundary_new = boundary;else hyperplane_tol = GLOBAL_APPROX_PARAM.poly_hyperplane_tol; boundary_new = []; for k = 1:length(boundary) ck = hyperplanes{boundary(k)}.c; dk = hyperplanes{boundary(k)}.d; found = 0; for l = 1:length(dI) if rank([CI(l,:) dI(l); ck dk],hyperplane_tol) == 1 found = 1; break; end end if found&~ismember(boundary(k),boundary_new) boundary_new = [boundary_new boundary(k)]; hp_flag_index=[hp_flag_index k]; endend%Create new hpflags vectorfor j=1:length(hp_flag_index) hpflags_new(j)=hpflags(hp_flag_index(j));endendendreturn%-------------------------------------------------------------------------------------------------------------------------------% function clean_transition()%% This function eliminates duplicate transitions. It compares the guards of two transitions.%If the lists of guards are equal, merge the transitions.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -