#!/bin/sh ####################################################################### # Tom Laramee - ECE 671, Homework 3 # 12/95 # # Script to automate the generation of the GNU plot plots for # my DCF simulation. # # It generates the 3 plot-creation files which are used by Gnu Plot # to generate .ps output. This simply echos the correct parameters # to the 3 plot files....which the "sim" script will later use # to generate the data # ####################################################################### file1=data.plot1 # the names of the files which will be generated file2=data.plot2 # by this script file3=data.plot3 file4=data.plot4 op1=$1 # data files which will be eventuallty plotted op2=$2 op3=$3 op4=$4 nodes=$5 # the number of nodes prob=$6 # the prob of unsuccessful transmission # ------------------------- generate file 1 rm -f $file1 touch $file1 echo "set terminal postscript landscape \"helvetica\" 20" >> $file1 echo "set output \"data.plot1.ps\" " >> $file1 echo "set format xy \"%g\" " >> $file1 echo "set xlabel \"System Arrival Rate\" " >> $file1 echo "set ylabel \"Channel Utilization\" " >> $file1 echo "set title \"Utilization vs. System Arrival Rate\" " >> $file1 echo "set key" >> $file1 echo "plot \"$op1\" t '($5 nodes, $6 prob) Util.' with lines 1 " >> $file1 # ------------------------- generate file 2 rm -f $file2 touch $file2 echo "set terminal postscript landscape \"helvetica\" 20 " >> $file2 echo "set output \"data.plot2.ps\" " >> $file2 echo "set format xy \"%g\" " >> $file2 echo "set xlabel \"System Arrival Rate\" " >> $file2 echo "set ylabel \"Average Packet Delay\" " >> $file2 echo "set title \"Average Packet Delay vs. System Arrival Rate\" " >> $file2 echo "set key" >> $file2 echo "plot \"$op2\" t '($5 nodes, $6 prob) Delay)' with lines 1 " >> $file2 # ------------------------- generate file 3 rm -f $file3 touch $file3 echo "set terminal postscript landscape \"helvetica\" 20 " >> $file3 echo "set output \"data.plot3.ps\" " >> $file3 echo "set format xy \"%g\" " >> $file3 echo "set xlabel \"System Arrival Rate\" " >> $file3 echo "set ylabel \"Average Queue Length\" " >> $file3 echo "set title \"Average Queue Length vs. System Arrival Rate\" " >> $file3 echo "set key" >> $file3 echo "plot \"$op3\" t '($5 nodes, $6 prob) Queue length' with lines 1 " >> $file3 # ------------------------- generate file 4 rm -f $file4 touch $file4 echo "set terminal postscript landscape \"helvetica\" 20 " >> $file4 echo "set output \"data.plot4.ps\" " >> $file4 echo "set format xy \"%g\" " >> $file4 echo "set xlabel \"System Arrival Rate\" " >> $file4 echo "set ylabel \"NUM RE_ARRIVALS\" " >> $file4 echo "set title \"NUM _ARRIVALS vs. System Arrival Rate\" " >> $file4 echo "set key" >> $file4 echo "plot \"$op4\" t '($5 nodes, $6 prob) Num RE_ARR' with lines 1 " >> $file4