13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
% [bonds,status] = abg2cbg(system_name, system_type, full_name, port_bonds, infofile)
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %% Version control history
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %% $Id$
% %% $Log$
% %% Revision 1.12 1996/12/31 11:42:36 peterg
% %% *** empty log message ***
% %%
% %% Revision 1.11 1996/12/07 17:10:48 peterg
% %% Allows port SS at top level - ie takes it to be an ardianry SS at top
% %% level.
% %%
|
>
>
>
>
|
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
% [bonds,status] = abg2cbg(system_name, system_type, full_name, port_bonds, infofile)
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %% Version control history
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %% $Id$
% %% $Log$
% %% Revision 1.13 1996/12/31 11:49:09 peterg
% %% Don't copy port bond causality if already set -- allows subsystem
% %% causality to be preset directely on named SS.
% %%
% %% Revision 1.12 1996/12/31 11:42:36 peterg
% %% *** empty log message ***
% %%
% %% Revision 1.11 1996/12/07 17:10:48 peterg
% %% Allows port SS at top level - ie takes it to be an ardianry SS at top
% %% level.
% %%
|
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
|
done = sum(sum(abs(bonds)))/total*100;
% Outer while loop sets preferred causality
ci_index=1;
while( ci_index>0)
old_done = inf;
% Inner loop propogates causality
while done~=old_done
disp(sprintf('Causality is %3.0f%s complete.', done, pc));
old_done = done;
for i = 1:n_components
if status(i) ~= 0 % only do this if causality not yet complete
|
|
|
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
|
done = sum(sum(abs(bonds)))/total*100;
% Outer while loop sets preferred causality
ci_index=1;
while( ci_index>0)
old_done = inf;
% 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
if status(i) ~= 0 % only do this if causality not yet complete
|
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
|
bonds(bond_index,1) = prefered;
bonds(bond_index,2) = prefered;
end;
end;
% Print final causality
final_done = (sum(status==zeros(n_components,1))/n_components)*100;;
mtt_info(sprintf('Final causality of %s is %3.0f%s complete.', ...
full_name, final_done, pc), infofile);
% List overcausal bonds
[over_causal_bonds,n] = getindex(status,1);
if n>0
for i=over_causal_bonds'
eval([ '[comp_type,name] = ', system_type, '_cmp(i);' ]);
mtt_info(sprintf('Component %s (%s) is overcausal', name, comp_type), ...
infofile);
end;
end;
% List undercausal bonds
[under_causal_bonds,n] = getindex(status,-1);
if n>0
for i=under_causal_bonds'
eval([ '[comp_type,name] = ', system_type, '_cmp(i);' ]);
mtt_info(sprintf('Component %s (%s) is undercausal', name, comp_type), ...
infofile);
end;
end;
% $$$ file_name = [full_name, '_', system_type]
file_name = [full_name, '_cbg.m']
cbgfilenum = fopen(file_name,'w');
write_cbg(cbgfilenum,full_name,system_type,bonds,status);
|
|
>
>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
>
|
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
|
bonds(bond_index,1) = prefered;
bonds(bond_index,2) = prefered;
end;
end;
% Print final causality
final_done = (sum(status==zeros(n_components,1))/n_components)*100;
if at_top_level
mtt_info(sprintf('Final causality of %s is %3.0f%s complete.', ...
full_name, final_done, pc), infofile);
% List overcausal bonds
[over_causal_bonds,n] = getindex(status,1);
if n>0
for i=over_causal_bonds'
eval([ '[comp_type,name] = ', system_type, '_cmp(i);' ]);
mtt_info(sprintf('Component %s (%s) is overcausal', name, comp_type), ...
infofile);
end;
end;
% List undercausal bonds
[under_causal_bonds,n] = getindex(status,-1);
if n>0
for i=under_causal_bonds'
eval([ '[comp_type,name] = ', system_type, '_cmp(i);' ]);
mtt_info(sprintf('Component %s (%s) is undercausal', name, comp_type), ...
infofile);
end;
end;
end;
% $$$ file_name = [full_name, '_', system_type]
file_name = [full_name, '_cbg.m']
cbgfilenum = fopen(file_name,'w');
write_cbg(cbgfilenum,full_name,system_type,bonds,status);
|