I'm doing Simulation of Round-Robbin algorithm and code listed below gives me error
RR.Przesuniecie[Oczekujace_procesy]
TypeError: 'instancemethod' object is unsubscriptable
Here piece of code:
class RR:
def Przesuniecie(self, Lista):
if(len(Lista) < 2):
return Lista
else:
head = Lista[0]
for i in range(1, len(Lista)):
Lista[i-1] = Lista[i]
Lista[-1] = head
return Lista
def Symulacja(self, n ,kwant):
Oczekujace_procesy = []
[....]
if(timer == kwant):
RR.Przesuniecie[Oczekujace_procesy]
I have no idea why it gives me error. There just piece of code, on list Oczekujace_procesy
I'm doing some operations.