- Implement your answer inside
banker.py
, there are TWO tasks; Task 1 and Task 2 - DO NOT PRINT ANYTHING ELSE to the console. All debug messages must be commented out.
- Test your implementation using
banker_test.py
There are 6 test cases in total inside test_files/
, each testing different scenarios.
- q0: Will PASS by default, simply setup all matrices only
- q1: Will PASS by default, P0 request
i
rejected because >NEED[i]
- q2: Will PASS by default, simply perform granted safe request
- q3-q5 will FAIL by default, there are many unsafe requests. It will PASS if you implement
check_safe
algorithm properly insideBanker.py
and use it inrequest_resource
algorithm.
In order for banker_test.py
to print PASS, you MUST NOT PRINT ANYTHING ELSE to the console, we simply perform string matching.
DO NOT CHANGE ANY OTHER FILE besides the dedicated places in banker.py
.