The purpose of this programming project is to explore resource allocation algorithms. This can be achieved by implementing the banker's algorithm as described in our textbook and discussed in class.
This project is worth 100 points. 20 extra points will be awarded if you correctly implement this project in some other programming language (Python, Java, R, FORTRAN, C# etc.)
Review the banker's algorithm discussed in class and on pages 330-336 from the book. Your program must be named "banker" and will read the allocation, max, available, and request vectors from a file. The name of the file will be passed to your program as a command line argument. The input file format is the following:
- number of processes: n
- number of resource types: m
- An n x m allocation matrix
- An n x m max matrix
- A 1 x m available vector
- A i : 1 x m request vector
Your program will output the following in a standardized format.
Here is a sample input file.Here is how the program should be run.% banker s1.txt
Here is the sample output.
Sample input is provided however you should test your program with different number of processes and resource types (i.e. different datasets).
ASSESSMENT AND GRADING
This is an individual assignment. Your program may be written in C or C++. Comment and document all code submitted! Use penguin.tamucc.edu for your program development and testing. You may do development work on your personal machine but final submissions must compile without errors or warnings and execute without core dumping. Your program will be tested using one of our departmental machines. Your project must follow the documentation standards defined here. Use good programming practices by implementing procedures and functions where necessary. You may use the STL in your solution.
Please see the project submission guidelines for details on how your project should be formatted for submission.