Properly align display of the algorithm's solution
(self)
| 195 | break |
| 196 | |
| 197 | def __pretty_data(self): |
| 198 | """ |
| 199 | Properly align display of the algorithm's solution |
| 200 | """ |
| 201 | print(" " * 9 + "Allocated Resource Table") |
| 202 | for item in self.__allocated_resources_table: |
| 203 | print( |
| 204 | f"P{self.__allocated_resources_table.index(item) + 1}" |
| 205 | + " ".join(f"{it:>8}" for it in item) |
| 206 | + "\n" |
| 207 | ) |
| 208 | print(" " * 9 + "System Resource Table") |
| 209 | for item in self.__maximum_claim_table: |
| 210 | print( |
| 211 | f"P{self.__maximum_claim_table.index(item) + 1}" |
| 212 | + " ".join(f"{it:>8}" for it in item) |
| 213 | + "\n" |
| 214 | ) |
| 215 | print( |
| 216 | "Current Usage by Active Processes: " |
| 217 | + " ".join(str(x) for x in self.__claim_vector) |
| 218 | ) |
| 219 | print( |
| 220 | "Initial Available Resources: " |
| 221 | + " ".join(str(x) for x in self.__available_resources()) |
| 222 | ) |
| 223 | |
| 224 | |
| 225 | if __name__ == "__main__": |
no test coverage detected