修訂. | 50b29c493d1f6355f19683fc274be1d9f5c5ae08 |
---|---|
大小 | 1,181 bytes |
時間 | 2011-02-21 22:39:08 |
作者 | lorenzo |
Log Message | A simple script printing out the names of the antennas. |
#!/usr/bin/env python
# loop over 20-second intervals, compute contact graph for each interval, print out the nodes of the graph
import sys, string
import scipy as s
from sociopatterns.loader import Loader
from sociopatterns.analysis import ContactGraphAnalyzer
from sociopatterns.loader import TagMapping
M = TagMapping()
f = open('tag_mapping_high_presence.dat')
for line in f:
(mapped_id, orig_id, t1, t2, type) = string.split(line[:-1])
mapped_id = int(mapped_id)
orig_id = int(orig_id)
t1 = int(t1)
t2 = int(t2)
M.add_mapping(orig_id, mapped_id, t1, t2)
f.close()
#import string #Probably I do not need this module any longer.
#Python has a lot of methods already inbuilt for a string object.
#XXTEA_CRYPTO_KEY = ( 0xf6e103d4, 0x77a739f6, 0x65eecead, 0xa40543a9 )
#XXTEA_CRYPTO_KEY = ( 0xd2e3fd73, 0xfa70ca9c, 0xe2575826, 0x0fe09946 )
#loader = Loader(sys.argv[1:], decode=0,experiment='OBG',load_contacts=1, unique_contacts=1, load_sightings=0)
loader = Loader(sys.argv[1:], decode=0,experiment='OBG',load_contacts=1, unique_contacts=1, load_sightings=0, mapping=M)
for test in loader:
print hex(test.ip)
print 'So far so good'