Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[Lua] Fixed kademlia.lua test
authorChristian Heinrich <franz-christian.heinrich@inria.fr>
Thu, 23 Jul 2015 16:59:04 +0000 (18:59 +0200)
committerChristian Heinrich <franz-christian.heinrich@inria.fr>
Thu, 15 Oct 2015 17:17:18 +0000 (19:17 +0200)
- Index 0 was out of bounds
- Updated tesh file

examples/lua/kademlia/kademlia.tesh
examples/lua/kademlia/routing_table.lua

index 2092ee8..216f069 100644 (file)
@@ -11,17 +11,16 @@ $ lua kademlia.lua
 > [Tanguay:node:(11) 0.000000] [lua/INFO] Hi, I'm going to join the network with the id 1111111111 !
 > [Morin:node:(12) 0.000000] [lua/INFO] Hi, I'm going to join the network with the id 11111111111 !
 > [Ethernet:node:(13) 0.000000] [lua/INFO] Hi, I'm going to join the network with the id 11111111111 !
+> [Ethernet:node:(13) 900.000000] [lua/INFO] 8/8 FIND_NODE have succedded
 > [Morin:node:(12) 900.000000] [lua/INFO] 7/7 FIND_NODE have succedded
 > [Tanguay:node:(11) 900.000000] [lua/INFO] 7/7 FIND_NODE have succedded
-> [iRMX:node:(7) 900.000000] [lua/INFO] 7/7 FIND_NODE have succedded
+> [McGee:node:(8) 900.000000] [lua/INFO] 7/7 FIND_NODE have succedded
 > [Gatien:node:(9) 900.000000] [lua/INFO] 7/7 FIND_NODE have succedded
-> [TeX:node:(4) 900.000000] [lua/INFO] 7/7 FIND_NODE have succedded
-> [Laroche:node:(10) 900.000000] [lua/INFO] 7/7 FIND_NODE have succedded
+> [iRMX:node:(7) 900.000000] [lua/INFO] 7/7 FIND_NODE have succedded
 > [Disney:node:(6) 900.000000] [lua/INFO] 7/7 FIND_NODE have succedded
-> [Geoff:node:(5) 900.000000] [lua/INFO] 7/7 FIND_NODE have succedded
-> [McGee:node:(8) 900.000000] [lua/INFO] 7/7 FIND_NODE have succedded
 > [Jean_Yves:node:(3) 900.000000] [lua/INFO] 8/8 FIND_NODE have succedded
-> [Jacquelin:node:(1) 900.000000] [lua/INFO] 0/8 FIND_NODE have succedded
+> [Geoff:node:(5) 900.000000] [lua/INFO] 7/7 FIND_NODE have succedded
+> [Laroche:node:(10) 900.000000] [lua/INFO] 7/7 FIND_NODE have succedded
+> [TeX:node:(4) 900.000000] [lua/INFO] 7/7 FIND_NODE have succedded
 > [Boivin:node:(2) 900.000000] [lua/INFO] 8/8 FIND_NODE have succedded
-> [Ethernet:node:(13) 900.000000] [lua/INFO] 8/8 FIND_NODE have succedded
-
+> [Jacquelin:node:(1) 900.000000] [lua/INFO] 0/8 FIND_NODE have succedded
index d4f4d04..089cc89 100644 (file)
@@ -52,7 +52,7 @@ function routing_table_update(id)
                simgrid.debug("Updating " .. id .. " in my routing table")
                -- If the element is already in the bucket, we update it.
                table.remove(bucket.list,index_of(bucket.list,id))
-               table.insert(bucket.list,0,id)
+               table.insert(bucket.list,id)
        else    
                simgrid.debug("Insert " .. id .. " in my routing table in bucket " .. bucket.id)
                table.insert(bucket.list,id)
@@ -95,4 +95,4 @@ function find_closest(destination_id)
        end
        
        return answer
-end
\ No newline at end of file
+end