from Node import Node
from Overlay import Overlay
from QueryMessage import QueryMessage

ov = Overlay()
node1 = Node(0, ['123455'], 0)
node2 = Node(1, ['123455'], 0 )
node3 = Node(2, ['123455'], 0)
node3 = Node(3, ['123455'], 0)
node3 = Node(4, ['123455'], 0)
msg = QueryMessage(1)
msg.visited_nodes.append(ov.get_unvisited_neighbor(1, msg.visited_nodes))
print msg.visited_nodes
msg.visited_nodes.append(ov.get_unvisited_neighbor(msg.visited_nodes[-1], msg.visited_nodes))
print msg.visited_nodes
msg.visited_nodes.append(ov.get_unvisited_neighbor(msg.visited_nodes[-1], msg.visited_nodes))
print msg.visited_nodes
msg.visited_nodes.append(ov.get_unvisited_neighbor(msg.visited_nodes[-1], msg.visited_nodes))
print msg.visited_nodes
msg.visited_nodes.append(ov.get_unvisited_neighbor(msg.visited_nodes[-1], msg.visited_nodes))
print msg.visited_nodes
msg.visited_nodes.append(ov.get_unvisited_neighbor(msg.visited_nodes[-1], msg.visited_nodes))
print msg.visited_nodes
msg.visited_nodes.append(ov.get_unvisited_neighbor(msg.visited_nodes[-1], msg.visited_nodes))
print msg.visited_nodes
'''
print node1.advertise([['Location', 3], ['Latitude', 52.22], ['Longitude', 4.53], ['NodeType', 1], ['KernVer', 2], ['FCNamex', 1], ['CPUSpeed', 3.2001], ['NumCores', 2], ['CoresPerCPU', 1], ['MemSize', 1.9682], ['DiskSize', 221.347], ['BWLimit', 100000]])
print node2.advertise([['Location', 1], ['Latitude', 42.27], ['Longitude', -71.8], ['NodeType', 1], ['KernVer', 2], ['FCNamex', 1], ['CPUSpeed', 2.99488], ['NumCores', 2], ['CoresPerCPU', 1], ['MemSize', 0.985874], ['DiskSize', 175.483], ['BWLimit', 'none']])
print node3.advertise([['Location', 1], ['Latitude', 42.27], ['Longitude', -71.8], ['NodeType', 1], ['KernVer', 2], ['FCNamex', 1], ['CPUSpeed', 2.49374], ['NumCores', 8], ['CoresPerCPU', 4], ['MemSize', 3.21139], ['DiskSize', 662.04], ['BWLimit', 10000]])
#print node1.advertise([['Location', 3], ['Latitude', 52.22], ['Longitude', 4.23], ['NodeType', 2], ['KernVer', 1], ['FCNamex', 4], ['CPUSpeed', 3.20011], ['NumCores', 2], ['CoresPerCPU', 1], ['MemSize', 1.9682111], ['DiskSize', 221.347198], ['BWLimit', 1000]])
#print node1.advertise([['Location', 2], ['Latitude', 52.21], ['Longitude', 4.23], ['NodeType', 2], ['KernVer', 1], ['FCNamex', 4], ['CPUSpeed', 3.20011], ['NumCores', 2], ['CoresPerCPU', 1], ['MemSize', 1.9682111], ['DiskSize', 221.347199], ['BWLimit', 1000]])
#print node2.advertise([['Location', 1], ['Latitude', 42.27], ['Longitude', -71.8], ['NodeType', 1], ['KernVer', 2], ['FCNamex', 1], ['CPUSpeed', 2.99488], ['NumCores', 2], ['CoresPerCPU', 1], ['MemSize', 0.985874], ['DiskSize', 175.483], ['BWLimit', 'none']])
print node1.advertise([['Location', 3], ['Latitude', 52.22], ['Longitude', 4.53], ['NodeType', 1], ['KernVer', 2], ['FCNamex', 1], ['CPUSpeed', 3.2001], ['NumCores', 2], ['CoresPerCPU', 1], ['MemSize', 1.9682], ['DiskSize', 221.347], ['BWLimit', 100000]])
print node2.advertise([['Location', 1], ['Latitude', 42.27], ['Longitude', -71.8], ['NodeType', 1], ['KernVer', 2], ['FCNamex', 1], ['CPUSpeed', 2.99488], ['NumCores', 2], ['CoresPerCPU', 1], ['MemSize', 0.985874], ['DiskSize', 175.483], ['BWLimit', 'none']])
'''
'''
node4 = Node(4, ['123455'])
print node4.advertise([['Location', 2], ['Latitude', 52.21], ['Longitude', 4.23], ['NodeType', 2], ['KernVer', 1], ['FCNamex', 4], ['CPUSpeed', 3.20011], ['NumCores', 3], ['CoresPerCPU', 2], ['MemSize', 1.9682111], ['DiskFree', 21.347199], ['5minLoad', 12.1]])
print node4.advertise([['Location', 2], ['Latitude', 52.21], ['Longitude', 4.23], ['NodeType', 2], ['KernVer', 1], ['FCNamex', 4], ['CPUSpeed', 3.20011], ['NumCores', 3], ['CoresPerCPU', 2], ['MemSize', 1.9682111], ['DiskFree', 21.347199], ['5minLoad', 14.2]])
print node4.advertise([['Location', 2], ['Latitude', 52.21], ['Longitude', 4.23], ['NodeType', 2], ['KernVer', 1], ['FCNamex', 4], ['CPUSpeed', 3.20011], ['NumCores', 3], ['CoresPerCPU', 2], ['MemSize', 1.9682111], ['DiskFree', 21.347199], ['5minLoad', 11.0]])

print node2.query([['Location', 2], ['Latitude', 52.21], ['Longitude', 4.23], ['NodeType', 2], ['KernVer', 1], ['FCNamex', 4], ['CPUSpeed', 3.20011], ['NumCores', 3], ['CoresPerCPU', 2], ['MemSize', 1.9682111]])
print node4.query([['Location', 2], ['Latitude', 52.21], ['Longitude', 4.23], ['NodeType', 2], ['KernVer', 1], ['FCNamex', 4], ['CPUSpeed', 3.20011], ['NumCores', 3], ['CoresPerCPU', 2], ['MemSize', 1.9682111], ['DiskFree', 21.347199], ['5minLoad', 11.0]])
'''

