MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / __init__

Method __init__

other/bankers_algorithm.py:41–57  ·  view source on GitHub ↗

:param claim_vector: A nxn/nxm list depicting the amount of each resources (eg. memory, interface, semaphores, etc.) available. :param allocated_resources_table: A nxn/nxm list depicting the amount of each resource each process is currently holding :param m

(
        self,
        claim_vector: list[int],
        allocated_resources_table: list[list[int]],
        maximum_claim_table: list[list[int]],
    )

Source from the content-addressed store, hash-verified

39
40class BankersAlgorithm:
41 def __init__(
42 self,
43 claim_vector: list[int],
44 allocated_resources_table: list[list[int]],
45 maximum_claim_table: list[list[int]],
46 ) -> None:
47 """
48 :param claim_vector: A nxn/nxm list depicting the amount of each resources
49 (eg. memory, interface, semaphores, etc.) available.
50 :param allocated_resources_table: A nxn/nxm list depicting the amount of each
51 resource each process is currently holding
52 :param maximum_claim_table: A nxn/nxm list depicting how much of each resource
53 the system currently has available
54 """
55 self.__claim_vector = claim_vector
56 self.__allocated_resources_table = allocated_resources_table
57 self.__maximum_claim_table = maximum_claim_table
58
59 def __processes_resource_summation(self) -> list[int]:
60 """

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected