Differences From Artifact [fd9c2c8fdf]:

To Artifact [5418171295]:


11
12
13
14
15
16
17




18
19
20
21
22
23
24


# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# %% Version control history
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# %% $Id$
# %% $Log$




# %% Revision 1.9  2000/10/10 21:03:06  peterg
# %% *** empty log message ***
# %%
# %% Revision 1.8  1998/08/10 13:57:33  peterg
# %% Removed debugging lines
# %%
# %% Revision 1.7  1998/08/10 13:55:11  peterg







>
>
>
>







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


# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# %% Version control history
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# %% $Id$
# %% $Log$
# %% Revision 1.10  2000/10/16 08:20:23  peterg
# %% New version with direct naming.
# %% Note ss version is broken - ss.r file in wrong format
# %%
# %% Revision 1.9  2000/10/10 21:03:06  peterg
# %% *** empty log message ***
# %%
# %% Revision 1.8  1998/08/10 13:57:33  peterg
# %% Removed debugging lines
# %%
# %% Revision 1.7  1998/08/10 13:55:11  peterg
69
70
71
72
73
74
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

if [ -n "$steadystate_computation" ]; then 
# Compute state from ss.r file
# Inform user
echo Creating $1_state.txt - compute from steady-state information

cat $1_ss.r  $1_struc.txt | sed 's/\$//' |\
awk '{
  if(match($1,"MTTx")>0) {
    j++
    split($0,a,"=");
    x[j]=a[2];
  }
    
  if($1=="state") {
    i++; 
    # print  "x(" i ") =\t", x[i], " \# " $4 " (" $3 ")"
    printf("%s =\t%s; # MTT initial value\n", $4, x[i]);
  }
}'  >> $1_state.txt
else
# Set states to zero
# Inform user
echo Creating $1_state.txt - default states to $default

awk '{
  if ($1=="state") printf("%s \t= %s; # MTT initial value\n", $4, default)
}' default=$default <$1_struc.txt >> $1_state.txt
    
fi









|

















|






73
74
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
104

if [ -n "$steadystate_computation" ]; then 
# Compute state from ss.r file
# Inform user
echo Creating $1_state.txt - compute from steady-state information

cat $1_ss.r  $1_struc.txt | sed 's/\$//' |\
gawk '{
  if(match($1,"MTTx")>0) {
    j++
    split($0,a,"=");
    x[j]=a[2];
  }
    
  if($1=="state") {
    i++; 
    # print  "x(" i ") =\t", x[i], " \# " $4 " (" $3 ")"
    printf("%s =\t%s; # MTT initial value\n", $4, x[i]);
  }
}'  >> $1_state.txt
else
# Set states to zero
# Inform user
echo Creating $1_state.txt - default states to $default

gawk '{
  if ($1=="state") printf("%s \t= %s; # MTT initial value\n", $4, default)
}' default=$default <$1_struc.txt >> $1_state.txt
    
fi



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