Quellcode durchsuchen

missing this in some method declarations

tarfeef101 vor 6 Jahren
Ursprung
Commit
145a7d8897
1 geänderte Dateien mit 4 neuen und 4 gelöschten Zeilen
  1. 4 4
      a3/router.py

+ 4 - 4
a3/router.py

@@ -81,7 +81,7 @@ class db:
     def __init__(this, routers):
         this.entries = [ [] for i in range(routers) ]
         
-    def insert(connection):
+    def insert(this, connection):
         src = connection.src
         # check each entry in the source's list within entries
         # index is src - 1 since router #s start at 1
@@ -110,17 +110,17 @@ class graph:
         # stores adjacency list (Graph)
         this.alist = [ [-1, -1, -1, -1, -1] for i in range(routers) ]
         
-    def lookup(dest):
+    def lookup(this, dest):
         return this.sssp[dest - 1]
         
-    def insert(connection):
+    def insert(this, connection):
         src = connection.src
         dest = connection.dest
         weight = connection.cost
         this.alist[src - 1][dest] = weight
         this.alist[dest - 1][src] = weight
             
-    def rebuild():
+    def rebuild(this):
         this.sssp = [inf * 5]
         this.sssp[rid - 1] = 0