Utilize various methods in this class to simulate the Banker's algorithm :Return: None >>> BankersAlgorithm(test_claim_vector, test_allocated_res_table, ... test_maximum_claim_table).main(describe=True) Allocated Resource Table P1
(self, **kwargs)
| 101 | return {self.__need().index(i): i for i in self.__need()} |
| 102 | |
| 103 | def main(self, **kwargs) -> None: |
| 104 | """ |
| 105 | Utilize various methods in this class to simulate the Banker's algorithm |
| 106 | :Return: None |
| 107 | |
| 108 | >>> BankersAlgorithm(test_claim_vector, test_allocated_res_table, |
| 109 | ... test_maximum_claim_table).main(describe=True) |
| 110 | Allocated Resource Table |
| 111 | P1 2 0 1 1 |
| 112 | <BLANKLINE> |
| 113 | P2 0 1 2 1 |
| 114 | <BLANKLINE> |
| 115 | P3 4 0 0 3 |
| 116 | <BLANKLINE> |
| 117 | P4 0 2 1 0 |
| 118 | <BLANKLINE> |
| 119 | P5 1 0 3 0 |
| 120 | <BLANKLINE> |
| 121 | System Resource Table |
| 122 | P1 3 2 1 4 |
| 123 | <BLANKLINE> |
| 124 | P2 0 2 5 2 |
| 125 | <BLANKLINE> |
| 126 | P3 5 1 0 5 |
| 127 | <BLANKLINE> |
| 128 | P4 1 5 3 0 |
| 129 | <BLANKLINE> |
| 130 | P5 3 0 3 3 |
| 131 | <BLANKLINE> |
| 132 | Current Usage by Active Processes: 8 5 9 7 |
| 133 | Initial Available Resources: 1 2 2 2 |
| 134 | __________________________________________________ |
| 135 | <BLANKLINE> |
| 136 | Process 3 is executing. |
| 137 | Updated available resource stack for processes: 5 2 2 5 |
| 138 | The process is in a safe state. |
| 139 | <BLANKLINE> |
| 140 | Process 1 is executing. |
| 141 | Updated available resource stack for processes: 7 2 3 6 |
| 142 | The process is in a safe state. |
| 143 | <BLANKLINE> |
| 144 | Process 2 is executing. |
| 145 | Updated available resource stack for processes: 7 3 5 7 |
| 146 | The process is in a safe state. |
| 147 | <BLANKLINE> |
| 148 | Process 4 is executing. |
| 149 | Updated available resource stack for processes: 7 5 6 7 |
| 150 | The process is in a safe state. |
| 151 | <BLANKLINE> |
| 152 | Process 5 is executing. |
| 153 | Updated available resource stack for processes: 8 5 9 7 |
| 154 | The process is in a safe state. |
| 155 | <BLANKLINE> |
| 156 | """ |
| 157 | need_list = self.__need() |
| 158 | alloc_resources_table = self.__allocated_resources_table |
| 159 | available_resources = self.__available_resources() |
| 160 | need_index_manager = self.__need_index_manager() |
no test coverage detected