Index: mttroot/mtt/bin/trans/m/abg2cbg.m ================================================================== --- mttroot/mtt/bin/trans/m/abg2cbg.m +++ mttroot/mtt/bin/trans/m/abg2cbg.m @@ -15,10 +15,13 @@ % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % %% Version control history % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % %% $Id$ % %% $Log$ +% %% Revision 1.18 1997/08/08 08:11:04 peterg +% %% Suppress compoment trace. +% %% % %% Revision 1.17 1997/08/07 16:10:13 peterg % %% Move the if status .. to the beginning of the main loop. % %% % %% Revision 1.16 1997/08/04 13:11:19 peterg % %% Only change to component-orientated causality for simple components @@ -126,10 +129,11 @@ return end; % Evaluate the system function to get the bonds and number of ports eval(['[bonds,components,n_ports]=', fun_name, ';']); + % Find number of bonds [n_bonds,columns] = size(bonds); if (columns ~= 2)&(n_bonds>0) error('Incorrect bonds matrix: must have 2 columns'); @@ -158,11 +162,14 @@ else % Copy the port bonds & status j = abs(components(1:n_ports,1)); %relevant bond numbers bonds(j,:) = port_bonds; status(1:n_ports) = port_status; end +else + n_port_bonds=0; end; +bonds,port_bonds % Causality indicator total = 2*n_bonds; done = sum(sum(abs(bonds)))/total*100; @@ -174,17 +181,17 @@ % Inner loop propagates causality while done~=old_done % disp(sprintf('Causality is %3.0f%s complete.', done, pc)); old_done = done; - for i = 1:n_components + for i = n_port_bonds+1:n_components if status(i) ~= 0 % only do this if causality not yet complete % Get the bonds on this component comp = nozeros(components(i,:)) - bond_list = abs(comp) - direction = sign(comp)'*[1 1] + bond_list = abs(comp); + direction = sign(comp)'*[1 1]; n_bonds = length(bond_list); % Get the component details eval([ '[comp_type,name,cr,arg] = ', system_type, '_cmp(i);' ]);