Addenda and Clarifications for Project 2 Q: Do I need to call srand to seed the random number generator? A: No - it's done in the call to InitializeExperiment Q: Speaking of InitializeExperiment, what should its paramteter be? A: The parameter should be N, the number of items to be used. Q: And when should I call InitializeExperiment? A: Just once, before doing any of the 5 experiments called for in the project. Q: before we leave the topic of random numbers, what should I be doing about a randomly generated fraction? A: check the man pages. You will notice that there's a library function which exactly fits the bill. Q: What exactly am I suppoesd to be counting in the experiments? A: Each time your code obtains a value (by calling either of GetRecencyDatum or GetRandomDatum) it needs to count the number of comparisons made to decide what to do with that datum - "what to do" means - whether to insert it at front, move it to front (in case of MRAF), or to insert it at end (of the IAB list). You do not need to count the number of comparisons made to delete an item, and you do not need to count the number of comarisons to insert the item (which should be O(1), irrespective of which list the item is being inserted into). That is the "total accesses" data. Your code will also count the number of items that came from GetRandomDatum and GetRecencyDatum. Unique items is pretty self-explanatory. Average number of accesses = total accesses/# items. The sample data was not done with benefit of the program having been complete, so the data is off: this is what the last line should have been about: MRAF IAE Average Number 1.07 5.18 of accesses Average number of accesses is per "trial". Q: What about output? What should I be doing about K? A: Each K data items your code obtains (each K "trials"), your code should be dumping the statistics. You should be reporting cumulative statistics (e.g. if K were 500, you should produce output for the first 500 trials, the first 1000 trials, the first 1500 trials, etc.) Then, when the experiment ends (you have handled N trials), you should print out the grand totals. NOTE: it is possible that N is an exact multiple of K, in which case the last running total will also be the Grand Totals for the experiment. In that case, you might be repeating outputing the same data. Q: It looks like the high recency data isnt too high recency. What should I do? A: If you have listed P2DataGen.o as a dependency in your makefile, just remake. You will get data exhibiting a very high degree of recency. The old P2DataGen.o is still in the project 2 directory with the rather unimaginative name, OldP2DataGen.o (if you want to experiment with it, too). So you should ReLink.