File mttroot/mtt/bin/trans/modpar_txt2r artifact 2a377a6f2c part of check-in b52250ca63


#! /bin/sh

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

# Bourne shell script: modpar_txt2r
# Creates the reduce code for modulated parameters

# Copyright (C) 2001 by Peter J. Gawthrop

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

# Inform user
echo Creating $1_modpar.r

#Create the modpar file complete with headers.
echo "% Modpar file ($1_modpar.r)" > $1_modpar.r
echo "% Generated by MTT at `date`" >> $1_modpar.r

parameters=`strip_comments < $1_modpar.txt |  cut -f1`
inputs=`strip_comments < $1_modpar.txt |  cut -f2`


for parameter in $parameters; do
    grep $parameter $1_struc.txt | grep input |\
     awk '{printf("%s := mttu(%i,1);\n", parameter, $2)}' parameter=$parameter >> $1_modpar.r
done


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