# along with this program; if not, write to the Free Software # # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA# # # ########################################################################### import sys from myprintfparser import MyTraceParser from decimal import * # using decimal for decimal precision if __name__ == '__main__': if len(sys.argv) == 2: input_file = open(sys.argv[1], 'r') # apre il file in read else: print "usage tracana.py input_file" sys.exit(1) parser = MyTraceParser(input_file) pkts = parser.get_sent_pkts() ulsubframe_start_times = parser.get_ulsubframe_start_times() # This gets start times of UpLink Sub Frame bursts = parser.get_sent_bursts() # This gets bursts (start,stop) of trasmission from a file in MyPrintf format # This prints trasmission bursts ordered in UpLink Subframes for frameno, frame_start in enumerate(ulsubframe_start_times): print "UpLink SubFrame number",frameno,'starting at',frame_start nodes = pkts.keys() nodes.sort() for nodeid in nodes: if nodeid != '0': (start, duration) = bursts[nodeid][frameno] print "Node id:", nodeid,"in a slot of duration:",duration,"send packets",len(pkts[nodeid][frameno]),"PktId:", pkts[nodeid][frameno]
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA# # # ########################################################################### import sys from myprintfparser import MyTraceParser from decimal import * # using decimal for decimal precision if __name__ == '__main__': if len(sys.argv) == 2: input_file = open(sys.argv[1], 'r') # apre il file in read else: print "usage tracana.py input_file" sys.exit(1) parser = MyTraceParser(input_file) ul_map = parser.get_ss_ulmap() # This gets UpLink Map from file in MyPrintf format bursts = parser.get_sent_bursts() # This gets bursts (start,stop) of trasmission from a file in MyPrintf format ulsubframe_start_times = parser.get_ulsubframe_start_times() # This gets start times of UpLink Sub Frame nodes = bursts.keys() nodes_map = ul_map.keys() nodes_map.sort() nodes.sort() # This compares UpLink Map and transmission burts for each UpLink Subframe for frameno, frame_start in enumerate(ulsubframe_start_times): print "UpLink SubFrame number:",frameno, "Start:",frame_start for nodeid in nodes_map: if nodeid != '0':
# along with this program; if not, write to the Free Software # # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA# # # ########################################################################### import sys from myprintfparser import MyTraceParser from decimal import * # using decimal for decimal precision if __name__ == '__main__': if len(sys.argv) == 2: input_file = open(sys.argv[1], 'r') # apre il file in read else: print "usage tracana.py input_file" sys.exit(1) parser = MyTraceParser(input_file) ulsubframe_start_times = parser.get_ulsubframe_start_times() # This gets start times of UpLink Sub Frame ul_map = parser.get_ss_ulmap() # This gets UpLink Map from file in MyPrintf format nodes = ul_map.keys() nodes.sort() # This prints UpLink Map ordered in UpLink Subframes for frameno, frame_start in enumerate(ulsubframe_start_times): print "UpLink SubFrame number:",frameno, "Start:",frame_start for nodeid in nodes: (start_time, duration) = ul_map[nodeid][frameno] print "Node id:", nodeid, "Start:", start_time, "Duration:", duration