Overview
Comment:Fix prob. when no bonds
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: 9dbc5c7804c82c588bc45982bc4d1f8a44bd977ac32c83363fd7ab9cb536aa12
User & Date: gawthrop@users.sourceforge.net on 2004-02-19 12:05:49
Other Links: branch diff | manifest | tags
Context
2004-02-19
18:27:47
[ 852694 ] octave 2.1.52 breaks rbg2abg

Octave now prefers row vectors to column vectors. check-in: 2e018ebcd2 user: geraint@users.sourceforge.net tags: origin/master, trunk

12:05:49
Fix prob. when no bonds check-in: 9dbc5c7804 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
00:47:19
898897 Separate examples from main .deb
Created new .deb package for examples (mtt-examples).

mtt-examples depends on mtt.
mtt recommends mtt-examples. check-in: e6c98916c8 user: geraint@users.sourceforge.net tags: origin/master, trunk

Changes

Modified mttroot/mtt/bin/trans/rbg2abg_m from [4cb8efbc5f] to [9082db29a6].

1
2
3
4
5
6
7
8
9
10
11
12
13




14
15
16
17
18
19
20
#! /bin/sh

     ###################################### 
     ##### Model Transformation Tools #####
     ######################################

# Bourne shell script: rbg2abg_m
#
###############################################################
## Version control history
###############################################################
## $Id$
## $Log$




## Revision 1.18  2001/03/30 15:13:58  gawthrop
## Rationalised simulation modes to each return mtt_data
##
## Revision 1.17  2000/12/05 12:04:03  peterg
## Changed function name to name()
##
## Revision 1.16  2000/12/05 09:04:08  peterg













>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#! /bin/sh

     ###################################### 
     ##### Model Transformation Tools #####
     ######################################

# Bourne shell script: rbg2abg_m
#
###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.19  2002/04/28 18:55:03  geraint
## Fixed [ 549658 ] awk should be gawk.
## Replaced calls to awk with call to gawk.
##
## Revision 1.18  2001/03/30 15:13:58  gawthrop
## Rationalised simulation modes to each return mtt_data
##
## Revision 1.17  2000/12/05 12:04:03  peterg
## Changed function name to name()
##
## Revision 1.16  2000/12/05 09:04:08  peterg
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154

155


156
157
158
159
160
161
162
# Use matrix manipulation to accomplish the transformation
$MATRIX > rbg2abg_m.log  2>mtt_error.txt << EOF
  name = '$1'
  infofile = fopen('mtt_info.txt', 'w');
  errorfile = fopen('mtt_error.txt', 'w');

  %Convert from the fig version of the bonds to a structured version
  [rbonds,rstrokes,rcomponents,port_coord,port_name,port_list] = $1_rbg;
  [n_ports, junk] = size(port_list);
 
  N_ports = 0;
  for i=1:n_ports		# Count the true number of ports.
    [subport,n_sub] = split_port(port_list(i,:), ',');
    N_ports = N_ports+n_sub;
  end;
 
 

  rbonds = rbonds(:,1:6);  # Strip  the directional information


  [bonds,components,n_vector_bonds] = rbg2abg(name,rbonds,rstrokes,rcomponents,port_coord,port_name,\
                               infofile,errorfile);

  %Write the function m-file for the causal bond graph
  write_abg(name,bonds,components,n_vector_bonds);    
EOF








|
|







|
>
|
>
>







142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
# Use matrix manipulation to accomplish the transformation
$MATRIX > rbg2abg_m.log  2>mtt_error.txt << EOF
  name = '$1'
  infofile = fopen('mtt_info.txt', 'w');
  errorfile = fopen('mtt_error.txt', 'w');

  %Convert from the fig version of the bonds to a structured version
  [rbonds,rstrokes,rcomponents,port_coord,port_name,port_list] = $1_rbg
  [n_ports, junk] = size(port_list)
 
  N_ports = 0;
  for i=1:n_ports		# Count the true number of ports.
    [subport,n_sub] = split_port(port_list(i,:), ',');
    N_ports = N_ports+n_sub;
  end;
 
  [n_bonds,m_bonds] = size(rbonds);
  if n_bonds>0
    rbonds = rbonds(:,1:6);  # Strip  the directional information
  endif

  [bonds,components,n_vector_bonds] = rbg2abg(name,rbonds,rstrokes,rcomponents,port_coord,port_name,\
                               infofile,errorfile);

  %Write the function m-file for the causal bond graph
  write_abg(name,bonds,components,n_vector_bonds);    
EOF


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