Explorar o código

i hate everything. giving up is life

tarfeef101 %!s(int64=6) %!d(string=hai) anos
pai
achega
66b80efd0f
Modificáronse 1 ficheiros con 2 adicións e 6 borrados
  1. 2 6
      a3/router.py

+ 2 - 6
a3/router.py

@@ -129,9 +129,9 @@ class graph:
         return this.sssp[dest - 1]
         
     def show(this):
-        print("RIB: ")
+        log.write("RIB: " + '\n')
         for i in range(0, 5):
-            print("R" + str(rid) + " -> R"+ str(i + 1) + " = " + str(this.sssp[i][0]) + " using node " + str(this.sssp[i][1] + 1))
+            log.write("R" + str(rid) + " -> R"+ str(i + 1) + " = " + str(this.sssp[i][0]) + " using node " + str(this.sssp[i][1] + 1) + '\n')
         
     def insert(this, connection):
         src = connection.src
@@ -141,10 +141,6 @@ class graph:
         this.alist[dest - 1][src - 1] = weight
             
     def rebuild(this):
-        print("Before building")
-        print(this.alist)
-        #this.sssp = [(inf, rid - 1)] * 5
-        
         # set the adjacent node for each node
         for i in range(0, 5):
             this.sssp[i] = (this.sssp[i][0], i)