CMSC 242 -- Lab 2

Lab 2

Getting Started

Log onto a computer science server making sure to change the port number.

Follow these instructions to get your files ready to start lab.
  • Use wget to download the file at http://cs.longwood.edu/courses/cmsc242/s19/files/srp.tgz
  • Uncompress the srp.tgz file by using tar -xvzf srp.tgz

The Problem

Markov Chains are a powerful tool for modeling state spaces and state transitions. I have written a Markov Chain to predict the next "move" in rock paper scissors. The Markov Chain keeps track of either the previous or last two "moves". The library will return the move it believes will win.
  1. use fork / exec
  2. write a README
  3. read and write from files

Implementation

You have been given a file named srp.h which contains the function signatures for the library libsrp.a. You will need to use the library to run you simultations.

  • You must use fork / exec in your solution.
  • You are to write code to identify the transition probabilities for the Markov Chain.
  • You should produce probs. for both 1 and 2 step history.
  • Your forks should save results to individual files BUT should then gather the information into a central file.

Handin

If you have changed file names or directory names you will need to change to the directory which contains the directory you wish to hand in. We will use the handin cmsc242 assignment directory command. In this case you will type: handin cmsc242 lab2 your_directory_name

You lab is due at 11:59pm Mar. 1st 2019.