Overview
Comment:Now handles steady-state computation for _state.txt.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: 78075a67949925a77efd03dab120f6d3a8cd2f142e562bb4d7291052830a5ffd
User & Date: gawthrop@users.sourceforge.net on 2003-08-04 09:10:30
Other Links: branch diff | manifest | tags
Context
2003-08-04
09:15:09
-ss switch reinstated check-in: 48d1c380c5 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
09:10:30
Now handles steady-state computation for _state.txt. check-in: 78075a6794 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
07:39:49
Updated for current MTT check-in: 6fbec1021d user: gawthrop@users.sourceforge.net tags: origin/master, trunk
Changes

Modified mttroot/mtt/bin/trans/mtt_update from [9bbb28550a] to [57a4091ca6].

9
10
11
12
13
14
15




16
17
18
19
20
21
22
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26







+
+
+
+







# Copyright (C) 2000 by Peter J. Gawthrop

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.17  2002/04/28 18:41:27  geraint
## Fixed [ 549658 ] awk should be gawk.
## Replaced calls to awk with call to gawk.
##
## Revision 1.16  2000/10/17 13:45:18  peterg
## split up state and input - different defaults
##
## Revision 1.15  2000/10/17 09:53:05  peterg
## More on logic rep
##
## Revision 1.14  2000/10/17 08:36:56  peterg
71
72
73
74
75
76
77















78
79
80
81
82
83
84
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103







+
+
+
+
+
+
+
+
+
+
+
+
+
+
+







update=$3 # Update or not
date=`date`

if [ -z "$2" ]; then
  echo Usage mtt_update system representation [update]    
  exit
fi

## Extract initial value from steady-state information
initial_value() {
    i=$1
    ssfile=${sys}_ss.r
    if [ "${rep}" = "state" ]; then
       if [ -f "${ssfile}" ]; then
	value=`grep "MTTx($i" ${ssfile}| sed 's/ //g' | gawk -F '=' '{print substr($2,1,length($2)-2)}'`
       else
	value=${default}   
       fi 
    else
	value=${default}
    fi
}

rm -f mtt_empty
touch mtt_empty

case $rep in
    numpar)
	    lang=txt
126
127
128
129
130
131
132

133


134

135
136
137
138
139
140
141
145
146
147
148
149
150
151
152
153
154
155

156
157
158
159
160
161
162
163







+

+
+
-
+







if [ -f "$textfile" ]; then
  # Inform User
  echo Checking $textfile
else
  echo Creating $textfile
  mtt_header $sys $rep $lang > $textfile 
  info=`cut -f1 $infofile | sort`
  i=0;
  for new in $info; do
    let i=$i+1;
    initial_value $i;
    echo $new $default  |\
    echo $new $value  |\
    gawk '{printf("%s\t= %s; # Default\n",$1,$2)}' >> $textfile
  done
  exit    
fi

# Remove tmp files
rm -f mtt_in_text mtt_in_info


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