Overview
Comment:Just write causality information at top level -- it gets a bit
voluminous if written at deeper levels.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: 53097c3f8aa24b0f3099a6e5bbc25d4a80b3a59ea3bea57489059d2bc68c1f80
User & Date: gawthrop@users.sourceforge.net on 1996-12-31 16:20:42
Other Links: branch diff | manifest | tags
Context
1997-01-02
11:21:17
Now assumes all components bonds etc at depth zero in fig file.
Ie anything at depth>0 is ignored.
Thanks to Donald for suggesting this.
check-in: a79c1594e3 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
1996-12-31
16:20:42
Just write causality information at top level -- it gets a bit
voluminous if written at deeper levels.
check-in: 53097c3f8a user: gawthrop@users.sourceforge.net tags: origin/master, trunk
16:14:53
Now handles multi-character subscripts. check-in: dbdafa4472 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
Changes

Modified mttroot/mtt/bin/trans/m/abg2cbg.m from [c7cfca2b49] to [48fbab77ba].

13
14
15
16
17
18
19




20
21
22
23
24
25
26
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
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 propogates causality
  % 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
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;;
mtt_info(sprintf('Final causality of %s is %3.0f%s complete.', ...
                  full_name, final_done, pc), infofile);
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);
  % 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);


MTT: Model Transformation Tools
GitHub | SourceHut | Sourceforge | Fossil RSS ]