Programming Assignment 1 specifies that data must be collected for 1, 10, 100, 1,000, and 10,000 generations. Therefore, the programs should be run with a command line similar to this:
[terragni] ~/eecs380/PA1 % life -i acorn -n 10000After the program has run, something like this will be displayed:
Elapse time for 10000 step(s): 149122 ms Step to continue ?This data should be included in the input file corresponding to the program --- in this case, "life_times.txt". Data in the input files should be arranged in two columns separated by spaces or tabs. The first column should be the number of generations, and the second column should be the run time. So each of the two input files should look like this:
1 XXXX 10 XXXX 100 XXXX 1000 XXXX 10000 XXXXWhere XXXX equals the length of the run time in milliseconds.
[terragni] ~ % gnuplot
G N U P L O T unix version 3.5 patchlevel 188.8.131.52, 27 Aug 93 last modified Fri Aug 27 05:21:33 GMT 1993 Copyright(C) 1986 - 1993 Thomas Williams, Colin Kelley Send comments and requests for help to firstname.lastname@example.org Send bugs, suggestions and mods to email@example.com Terminal type set to 'x11' gnuplot>The line which says "gnuplot>" is the GNUPLOT prompt where GNUPLOT commands can be entered. The following command should be eneterd at the GNUPLOT prompt:
gnuplot> set data style linesThis command tells GNUPLOT to use solid lines to plot the data.
gnuplot> plot 'life_times.txt', 'Life_times.txt'Note that GNUPLOT can accept a variable number of file names after the "plot" command, but this assignment only uses two.
You should see a window open with the data plotted as two lines.
gnuplot> set terminal postscript color gnuplot> set output 'acorn.ps' gnuplot> plot 'life_times.txt', 'Life_times.txt' gnuplot> quitThe commands tell GNUPLOT to output in color PostScript format to a file called 'acorn.ps'. Note that any file name can be given, but 'acorn.ps' is required for Programming Assignment 1.
[terragni] ~/eecs380/PA1 % ghostview acorn.psYou should see the same plot as in GNUPLOT. Pull down the file menu and select Quit to exit GhostView.