from twisted.python import log
from khash import intify
+from ktable import K
from util import uncompact
class ActionBase:
This implementation is suitable for a recurring search over all nodes.
"""
self.sortNodes()
- return self.sorted_nodes[:self.config['K']]
+ return self.sorted_nodes[:K]
def generateArgs(self, node):
"""Generate the arguments to the node's action.
def generateResult(self):
"""Result is the K closest nodes to the target."""
self.sortNodes()
- return (self.sorted_nodes[:self.config['K']], )
+ return (self.sorted_nodes[:K], )
class FindValue(ActionBase):