clean

parent 12ada05c
......@@ -12,6 +12,7 @@ class Node(SystemEntity):
self.adjacentNodes = []
self.messageQueue = []
self.sk,self.pk = Utility.genratePublicPrivateKey()
self.ResumeTasks = []
'''make sure methods included here are not overriddenn'''
self.commands={"sendMessage":self.sendMessage,
"nextOn":self.nextOn
......@@ -84,6 +85,9 @@ class Node(SystemEntity):
self.dequeMessage()
# check if main ba* has to be resumed or not
# TODO : perform task from todolist which are relevant for current tick
try:
......
......@@ -9,6 +9,8 @@ class OverlayNode(Node):
def __init__(self,id,network,weight):
Node.__init__(self,id,network,weight)
self.startNodeLifeCycleGenerator = self.startNodeLifeCycle()
# adding initial task of bootstraping node.
self.todoList['0'].append(("nextOn", self.startNodeLifeCycleGenerator,))
self.commands.update({})
def processMessage(self,time,payload):
......
......@@ -18,11 +18,12 @@ def populateTodolist(net):
instruction = row[0].split() # tuple of a link
node = network.nodes.get(instruction[0])
node.todoList[instruction[1]].append(tuple(instruction[2:]))
for id, node in network.nodes.items():
node.todoList['0'].append(("nextOn",node.startNodeLifeCycleGenerator,))
# for id, node in network.nodes.items():
# node.todoList['0'].append(("nextOn",node.startNodeLifeCycleGenerator,))
for id,node in network.nodes.items():
logger.info(id +" : "+str(node.todoList))
# logger.info(id +" : "+str(node.todoList))
pass
def simulateNetwork(net):
if not net:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment