def show_stat(self): dprint(32 * '-' + ' Simulation ended -----------------------|') # Results dprint("") dprint("") dprint(32 * "-" + " Statistics -----------------------------") dprint('---- Sender Packet list ') Statsct.print_packet_list(Statsct.sender_packets) dprint('') dprint('---- Receiver Packet list ') Statsct.print_packet_list(Statsct.receiver_packets) dprint('') dprint('---- Packet lost Results ' + '(Status -> True = Received, False = Failed) ') Statsct.print_ordered_packets() dprint('') dprint('---- Performance metrics') params = Statsct.calculate_tx_parameters() dprint('') dprint("---- General result of the simulation {}".format(params))
# print("Exception: -> {}".format(e)) # input('Enter to continue') print('simulation ended') #Statsct.print_results() print('Sender Packet list ') Statsct.print_packet_list(Statsct.sender_packets) print('Receiver Packet list ') Statsct.print_packet_list(Statsct.receiver_packets) print("Results") Statsct.print_ordered_packets() #print(Statsct.get_results()) print('performance metrics') sim_results.append(Statsct.calculate_tx_parameters()) #print("{}".format(sim_results)) input('Continue to next sim') #-------------------------------------------------- average_goodput = 0 average_total_delay = 0 average_channe_occupancy = 0 reliability = 0 number_success_packets = 0 number_failed_packets = 0 number_success_fragments = 0 number_failed_fragments = 0 channel_occupancy_sender = 0 channel_occupancy_receiver = 0
sim.run() print( '-------------------------------- Simulation ended -----------------------|' ) #--------------------------------------------------------------------------- # Results print("") print("") print( "-------------------------------- Statistics -----------------------------" ) print('---- Sender Packet list ') Statsct.print_packet_list(Statsct.sender_packets) print('') print('---- Receiver Packet list ') Statsct.print_packet_list(Statsct.receiver_packets) print('') print('---- Packet lost Results (Status -> True = Received, False = Failed) ') Statsct.print_ordered_packets() print('') print('---- Performance metrics') params = Statsct.calculate_tx_parameters() print('') print("---- General result of the simulation {}".format(params))